help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Display "dash" as "minus" in programming language mode?


From: Pascal J. Bourguignon
Subject: Re: Display "dash" as "minus" in programming language mode?
Date: Wed, 08 Jul 2009 23:39:47 +0200
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin)

Torsten Bronger <bronger@physik.rwth-aachen.de> writes:

> Hallöchen!
>
> I have an arguably odd question: Is it possible to tell Emacs to
> display every "dash" character as an "en-dash" character?
>
> The reason is that I use the DejaVu fonts which have a particularly
> short dash.  In source code, this is unfortunate.  Is is possible to
> use e.g. font-lock-mode to substitute "en-dash" or "minus" for every
> "dash"?

Yes, it's trivial:

(font-lock-add-keywords nil
   '(("-" (0 (progn (compose-region (match-beginning 0) (match-end 0)  "–"
                                  'decompose-region)
                     nil)))))


-- 
__Pascal Bourguignon__


reply via email to

[Prev in Thread] Current Thread [Next in Thread]