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

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

Re: [TIP] Get rid of the `foo' eyesore


From: Oliver Scholz
Subject: Re: [TIP] Get rid of the `foo' eyesore
Date: Fri, 18 Jul 2003 11:21:49 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (windows-nt)

Jesper Harder <harder@myrealbox.com> writes:

> There's an entrenched habit in Emacs and Info of abusing ` (grave
> accent) and ' (apostrophe) as left and right single quotation marks.
>
> They aren't, and it looks horrible.
>
> Some old broken X fonts do have the "wrong" glyphs in those positions
> -- that's probably how the habit started.  But fortunately there's a
> better way to get rid of the eyesore than using a broken font.  By
> modifying the display table like this
>
>   (aset standard-display-table ?` [342392])  ; ‘
>   (aset standard-display-table ?' [342393])  ; ’
[...]

But this changes the appearance of ` and ' in all places, even where
they are not perused as quotation marks. How about using fontlock to
correct this only for `foo-bar' etc.?

(defvar my-false-quotations-keywords
  `(("\\(`\\)[-?.![:alnum:]]+\\('\\)"
     (0 (progn (compose-region (match-beginning 1) (match-end 1)
                               ,(decode-char 'ucs #x2018))
               (compose-region (match-beginning 2) (match-end 2)
                               ,(decode-char 'ucs #x2019)))))))

(font-lock-add-keywords nil my-false-quotations-keywords)


    Oliver
-- 
30 Messidor an 211 de la Révolution
Liberté, Egalité, Fraternité!


reply via email to

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