[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Display "dash" as "minus" in programming language mode?
From: |
Torsten Bronger |
Subject: |
Re: Display "dash" as "minus" in programming language mode? |
Date: |
Thu, 09 Jul 2009 11:15:02 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.94 (gnu/linux) |
Hallöchen!
Miles Bader writes:
> Torsten Bronger <bronger@physik.rwth-aachen.de> writes:
>
>> (add-hook 'python-mode-hook
>> (lambda ()
>> (font-lock-add-keywords nil
>> '(("\\B-\\B"
>> (0 (progn (compose-region (match-beginning 0) (match-end 0) "−"
>> 'decompose-region)
>> nil)))
>> ))))
>> (add-hook 'python-mode-hook
>> (lambda ()
>> (aset (or buffer-display-table
>> (setq buffer-display-table (make-display-table)))
>> ?* [?✻])))
>
> Hmm, why add font-lock stuff, when using display-table for dash
> too would be easier and far more efficient (and you're already
> setting up the display table anyway, so even simpler...)?
I couldn't restrict the effect to (Python) code, so all dashs in
comments and strings became minuses, too. But the "\\B-\\B" worked
quite well.
Tschö,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: torsten.bronger@jabber.rwth-aachen.de
or http://bronger-jmp.appspot.com
Re: Display "dash" as "minus" in programming language mode?, Kevin Rodgers, 2009/07/08