From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.help Subject: Re: Display "dash" as "minus" in programming language mode? Date: Thu, 09 Jul 2009 18:00:33 +0900 Organization: NEC Electronics Message-ID: 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 1247132976 17256 80.91.229.12 (9 Jul 2009 09:49:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 Jul 2009 09:49:36 +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:49:30 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 1MOqFs-0006E1-Cl for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Jul 2009 11:49:29 +0200 Original-Received: from localhost ([127.0.0.1]:49979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOqFr-0000vX-Qq for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Jul 2009 05:49:27 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-X-Trace: individual.net Mml7SgdKlZyxP34RRUBXYAqFePJp+nvqIQDICnfpcfasUbb50B Cancel-Lock: sha1:cZ3xjEMGQWufGbmKd7cdIJRDzxI= sha1:L0lMyvr2Obs1HC9BOPJaEgRgQf0= System-Type: x86_64-unknown-linux-gnu Blat: Foop Original-Xref: news.stanford.edu gnu.emacs.help:170685 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:65888 Archived-At: 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 mean, like: (add-hook 'python-mode-hook (lambda () (unless buffer-display-table (setq buffer-display-table (make-display-table))) (aset buffer-display-table ?* [?✻]) (aset buffer-display-table ?- [?−]))) ] -Miles -- Politics, n. A strife of interests masquerading as a contest of principles. The conduct of public affairs for private advantage.