emacs-devel
[Top][All Lists]
Advanced

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

Re: master ff4de1b: Fix quoting style in Lisp comments


From: Stefan Kangas
Subject: Re: master ff4de1b: Fix quoting style in Lisp comments
Date: Sat, 18 Sep 2021 01:17:35 -0700

Eli Zaretskii <eliz@gnu.org> writes:

> If this idea is a non-starter, and we want to do this only in comments
> and strings, I guess the only reasonable alternative is to do it as
> part of font-lock?  Which means people who turn off font-lock will not
> be able to have the feature.

Yes, I guess font-lock is unavoidable here.

BTW, as a minor extension to what I did above, I guess we could do
something like this if we want Unicode quotes in files like NEWS:

(define-minor-mode fancy-quotes-mode "Fancy quotes."
  :init-value nil
  (if fancy-quotes-mode
      (let ((table (or (copy-sequence standard-display-table)
                       (make-display-table))))
        (aset table ?` `[,(string-to-char (substitute-command-keys "`"))])
        (aset table ?' `[,(string-to-char (substitute-command-keys "'"))])
        (aset table ?\" [?”])
        (setq buffer-display-table table))
    (setq buffer-display-table nil)))

(add-hook 'outline-mode-hook
          (lambda ()
            (if (equal (file-name-base (buffer-file-name)) "NEWS")
                (fancy-quotes-mode))))



reply via email to

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