From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Torsten Bronger Newsgroups: gmane.emacs.help Subject: Re: Display "dash" as "minus" in programming language mode? Date: Thu, 09 Jul 2009 11:15:02 +0200 Organization: Phoenix Foundation Message-ID: <87y6qyi5ex.fsf@physik.rwth-aachen.de> References: <874otm28kw.fsf@physik.rwth-aachen.de> <87hbxmluqk.fsf@galatea.local> <873a9670ic.fsf@physik.rwth-aachen.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1247133064 17503 80.91.229.12 (9 Jul 2009 09:51:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 Jul 2009 09:51:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 09 11:50:57 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MOqHJ-0006lh-50 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Jul 2009 11:50:57 +0200 Original-Received: from localhost ([127.0.0.1]:54624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOqHI-0002j5-Hq for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Jul 2009 05:50:56 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-X-Trace: news.dfncis.de Z/7/OtzZD/CyLBxHj9lnBQBDKSSzvzke+I35XI1Jv/1PzoO+6Nwbd/QHS9 X-Orig-Path: wilson.homeunix.com!not-for-mail Cancel-Lock: sha1:foa1wtWAhzbNJpHg1aFW6FZxSYc= sha1:YEv76n1qxtzpjxDbWM3yjb5f/NU= X-PGP-Fingerprint: C5C8 D6E2 79D2 EFE9 8C0F 6D77 D5E3 CEFC 9F51 6B77 X-PGP-Affinity: will accept encrypted message for GPG X-Home-Page: http://www.wikipedia.org/wiki/User:Bronger X-Face: +wpw"|jN2Fde|7_lKBa0\7!_6suIE_m! x)'S9ytBu8tkt'k779jbzQ4o|p+@H_DCrIdnKG]E*w X-Binford: 6100 (more power) X-Accept-Language: de, en Jabber-ID: torsten.bronger@jabber.rwth-aachen.de User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.94 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:170686 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:65889 Archived-At: Hallöchen! Miles Bader writes: > Torsten Bronger 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