unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Garreau\, Alexandre" <galex-713@galex-713.eu>
To: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
Cc: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <87h8hjuwr8.fsf@portable.galex-713.eu> (raw)
In-Reply-To: <51f91341-65a3-466e-abf5-364feab7e103@gmail.com> ("Clément Pit-Claudel"'s message of "Thu, 18 Oct 2018 10:35:08 -0400")

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	other threads:[~2018-10-18 14:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18 14:07 In docstrings: `sym' and ‘sym’ are equivalent to mismatched `sym’ and ‘sym' (and ‘'sym’, nor `undefined' cannot be used) Garreau, Alexandre
2018-10-18 14:35 ` Clément Pit-Claudel
2018-10-18 14:58   ` Garreau, Alexandre [this message]
2018-10-18 15:01 ` Paul Eggert
2018-10-18 16:34   ` Garreau, Alexandre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h8hjuwr8.fsf@portable.galex-713.eu \
    --to=galex-713@galex-713.eu \
    --cc=cpitclaudel@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).