emacs-devel
[Top][All Lists]
Advanced

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

In docstrings: `sym' and ‘sym’ are equivalent to mismatched `sym’ and ‘s


From: Garreau\, Alexandre
Subject: In docstrings: `sym' and ‘sym’ are equivalent to mismatched `sym’ and ‘sym' (and ‘'sym’, nor `undefined' cannot be used)
Date: Thu, 18 Oct 2018 16:07:52 +0200
User-agent: Gnus (5.13), GNU Emacs 25.1.1 (i686-pc-linux-gnu)

Take the following piece of code, directly taken from Gnus v5.13:

#+BEGIN_SRC emacs-lisp
(defcustom gnus-build-sparse-threads nil
  "*If non-nil, fill in the gaps in threads.
If `some', only fill in the gaps that are needed to tie loose threads
together.  If `more', fill in all leaf nodes that Gnus can find.  If
non-nil and non-`some', fill in all gaps that Gnus manages to guess."
  :group 'gnus-thread
  :type '(choice (const :tag "off" nil)
                 (const some)
                 (const more)
                 (sexp :menu-tag "all" t)))
#+END_SRC

Passing on the fact the second `more', as it is undefined, oddly acts
differently than the others, which are defined.

The following is equivalent (look at the quotes), and gives in the end
just the same curly quotes and highlighting, while it is mismatched (I
believe it shouldn’t, when mismatched):

#+BEGIN_SRC emacs-lisp
(defcustom gnus-build-sparse-threads nil
  "*If non-nil, fill in the gaps in threads.
If ‘some', only fill in the gaps that are needed to tie loose threads
together.  If `more', fill in all leaf nodes that Gnus can find.  If
non-nil and non-`some’, fill in all gaps that Gnus manages to guess."
  :group 'gnus-thread
  :type '(choice (const :tag "off" nil)
                 (const some)
                 (const more)
                 (sexp :menu-tag "all" t)))
#+END_SRC

I noticed it while trying this:

#+BEGIN_SRC emacs-lisp
(defcustom gnus-build-sparse-threads nil
  "*If non-nil, fill in the gaps in threads.
If “'some”, only fill in the gaps that are needed to tie loose threads
together.  If ‘'more’, fill in all leaf nodes that Gnus can find.  If
non-nil and non-‘some’, fill in all gaps that Gnus manages to guess."
  :group 'gnus-thread
  :type '(choice (const :tag "off" nil)
                 (const some)
                 (const more)
                 (sexp :menu-tag "all" t)))
#+END_SRC

Note how it is impossible to refer to anything quoted without getting
the (wrong) curly quote.  This joins the previous thread about odd
symbols and modifying the reader (should it be also used for quoting?
or should it be accepted to be impossible to correctly write a quote in
docstrings?)



reply via email to

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