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: Fri, 17 Sep 2021 15:46:25 -0700

Eli Zaretskii <eliz@gnu.org> writes:

>> IMO, we should automatically display in comments and docstrings whatever
>> quote character the user prefers according to `text-quoting-style', and
>> automatically insert the correct quote character when typing "'".
>
> Patches welcome to make that happen.  One idea for implementation
> would be to use the display-table feature.

I can't see any way to limit `buffer-display-table' to docstrings.
Am I missing something?

Here's what I tried:

(define-minor-mode emacs-lisp-fancy-docstring-mode
  "Minor mode for fancy display of Emacs Lisp `docstrings'."
  :init-value nil
  (if emacs-lisp-fancy-docstring-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 "'"))])
        (setq buffer-display-table table))
    (setq buffer-display-table nil)))

It does the job in the sense that it correctly displays these quotes in
docstrings, but it also does it in code, which makes things hard to
read.



reply via email to

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