all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Andreas Schwab <schwab@linux-m68k.org>, 25461@debbugs.gnu.org
Subject: bug#25461: Missing doc strings for "," and ",@".
Date: Wed, 18 Jan 2017 19:28:48 +0000	[thread overview]
Message-ID: <20170118192848.GA4108@acm.fritz.box> (raw)
In-Reply-To: <87h94xdtvn.fsf@web.de>

Hello, Michael.

On Wed, Jan 18, 2017 at 02:44:28AM +0100, Michael Heerdegen wrote:
> Alan Mackenzie <acm@muc.de> writes:

> > I don't expect the typical novice Elisp hacker cares about such nice
> > distinctions.  She can get a doc string for `, so why not one for , or
> > ,@?

> ' and #' also "don't have a docstring".  That ` "has a docstring" is
> just coincidence - because the reader transforms

>   `expr

> to

>   (` expr)

> and the symbol ` has an associated symbol-function.

I'm sure that's true.  But ' is not really difficult enough to need a
doc string (IMAO).  Well, it didn't used to be, before it became
(ab)used by pcase.  #' could certainly do with one, I think.

But in my patch (which I expect to post within a few minutes of this
post), I have created a mechanism by which other reader macros can have
doc strings added.

> FWIW when I first saw `, , and ,@, it looked strange enough to me to
> open the manual, because the syntax seemed so unusual that I believed
> that I missed an essential part of knowledge about Elisp.  At least this
> is what I think happened...

Yes, but unless you're a genius, you probably had to look at the manual
several times before you internalised the meaning of , and ,@, with a
fair bit of practice in between.  During that practice, you might well
have found opening the manual to have been a hassle which you could have
avoided, had there been doc strings at the time.

> But I agree that some people might try C-h f on any of these, and we
> would not all die if we would show something useful in this case.  We
> could just say that C-f explains symbol functions and "reader macros"
> and the thing would still be consistent.

Or, not say anything at all - just do it.  C-h f after all does explain
named functions.  That it also explains a couple of reader macros as a
bonus hardly needs going on about.

> OTOH, I think that saying anything about `pcase' there would be a bad
> idea.

I disagree.  I was confused fairly badly for a long time when pcase
appeared (without announcement, IIRC) and purloined the reader macros
which, up till then, had had single definite functionalities.  I assume
other people were and will be confused by pcase usages, so it will do no
harm to draw people's attention towards them.  Anyhow, I've included a
sentence about pcase at the end of the proposed doc string for ,.  I
don't think pcase uses ,@, or at least I haven't seen any such use of it.

> Michael.

-- 
Alan Mackenzie (Nuremberg, Germany).





  reply	other threads:[~2017-01-18 19:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 21:22 bug#25461: Missing doc strings for "," and ",@" Alan Mackenzie
2017-01-17 19:34 ` Glenn Morris
2017-01-17 19:56   ` Alan Mackenzie
2017-01-17 20:36     ` Andreas Schwab
2017-01-17 20:41       ` Alan Mackenzie
2017-01-17 20:53         ` Andreas Schwab
2017-01-18  1:44         ` Michael Heerdegen
2017-01-18 19:28           ` Alan Mackenzie [this message]
     [not found] ` <handler.25461.B.148460180922707.ack@debbugs.gnu.org>
2017-01-18 19:43   ` bug#25461: [Patch]: " Alan Mackenzie
2017-01-19  0:16     ` npostavs
2017-01-19 17:37       ` Alan Mackenzie
2017-01-19 18:10         ` Noam Postavsky
2017-01-19 18:36           ` Alan Mackenzie
2017-01-20  0:24             ` Michael Heerdegen
2017-01-19  2:23     ` Michael Heerdegen
2017-01-19 17:58       ` Alan Mackenzie
2017-01-20  0:12         ` Michael Heerdegen
2017-01-20 16:58           ` Alan Mackenzie
2017-01-21  2:26             ` Michael Heerdegen
2017-01-21 15:56               ` Alan Mackenzie
2017-01-21 20:46                 ` bug#25461: [Patch #2]: " Alan Mackenzie
2017-01-24  1:58                   ` Michael Heerdegen
2017-01-24 19:43                     ` Alan Mackenzie
2017-01-24  4:01                   ` npostavs
2017-01-24 19:39                     ` Alan Mackenzie
2017-01-24 20:00                       ` Noam Postavsky
2017-01-23 19:09               ` bug#25461: [Patch]: " Alan Mackenzie

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

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

  git send-email \
    --in-reply-to=20170118192848.GA4108@acm.fritz.box \
    --to=acm@muc.de \
    --cc=25461@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=schwab@linux-m68k.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.