emacs-devel
[Top][All Lists]
Advanced

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

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


From: Garreau\, Alexandre
Subject: Re: 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:58:51 +0200
User-agent: Gnus (5.13), GNU Emacs 25.1.1 (i686-pc-linux-gnu)

Le 18/10/2018 à 10h35, Clément Pit-Claudel a écrit :
> On 2018-10-18 10:07, Garreau, Alexandre wrote:
>> (should it be also used for quoting?
>> or should it be accepted to be impossible to correctly write a quote in
>> docstrings?)
>
> Try \\='

Interesting, thank you, it works for embedding quotes (see thereafter):

#+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 emacs-lisp-mode highlights it wrong.)

Yet it doesn’t work with quotes, I guess this is intentional, but even
in cases it is escaped (and thus is part of the symbol name as any
character) it doesn’t work:

#+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

Also I just discovered part of my questionnings were because this
docstring doesn’t respect the tip of putting the word “symbol” before
the ref, as says the elisp manual (info "(elisp) Documentation Tips").

It is still disturbing that any mismatcher “`” or “'” is translated, in
docstrings.  I’d understand for “'” maybe, if it was to follow unicode
statement that “’” is better for apostrophe, but sometimes it’s not,
afaik (in french I use it when the apostrophe is part of the word (like
“aujourd'hui”), or in languages where it is a letter, or part of a
letter (like in breton the letter “c'h”: like in “c'hwi”)).  Yet I can’t
understand why doing it for `: though it is true I don’t see any usage
for it in normal natural language text, I’m disturbed by a such
translation happening on mismatched stuff.



reply via email to

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