From: Drew Adams <drew.adams@oracle.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 35222@debbugs.gnu.org
Subject: bug#35222: 26.1; `read-command' documentation
Date: Wed, 10 Apr 2019 16:32:47 -0700 (PDT) [thread overview]
Message-ID: <e5e4e9d4-e34d-4628-a9c8-dfd2f9472ebf@default> (raw)
In-Reply-To: <CAM-tV-_Yrzb=0_GN2=ShiNjG4hShr4ZAr61XUCsa5caXA0JakQ@mail.gmail.com>
> > 1. The doc string does not say what happens if DEFAULT is not provided
> > (so `nil') and the user enters empty input. And what happens is not
> > obvious. Please add that information to the doc string.
>
> Um, can we declare the current behaviour a bug, and instead return nil
> in this case? That matches the current doc string (i.e., return
> DEFAULT-VALUE), and avoids the whole mess with the empty string symbol
> which is weird and pretty useless as far as I can tell.
Good question. That was in fact my first reaction.
I wrote the bug report that way, then reconsidered.
I agree that the behavior is weird, and I'm not sure
what users, in what use cases, it could help. IOW,
why?
But the behavior has apparently always been thus.
(Prior to Emacs 24 there was no such read/print
syntax for uninterned symbols, so it was arguably
even weirder. If you used the result as a variable
value and did `C-h v' it would show you nothing!)
I ended up figuring that someone wanted this for
some good reason that I couldn't think of, and that
since it is documented this way (always returns a
symbol) and it is of long date we should just leave
it and make sure the doc string also helps.
But it sure is a gotcha. Why the default DEFAULT
behavior would be something so unexpected is a
good question. Hysterical accident? Intentional
design? Anyone know or have an idea what good this
is?
All I could think of is that code using it can be
sure to get a symbol. But it sure isn't sure to
get a command... I don't have the C sources, but
a priori (e.g. if I were writing `read-command'
from scratch in Lisp) it seems like it should
_require_ a commandp symbol, i.e., use
`completing-read' with non-nil REQUIRE arg.
Someone is sure to enlighten us. When that happens,
and if the decision is to continue the behavior,
hopefully people will agree even more strongly with
the need to provide clear doc about this odd default
case.
next prev parent reply other threads:[~2019-04-10 23:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-10 22:13 bug#35222: 26.1; `read-command' documentation Drew Adams
2019-04-10 22:24 ` Noam Postavsky
2019-04-10 23:32 ` Drew Adams [this message]
2019-04-11 18:55 ` Stefan Monnier
2019-04-12 0:11 ` Noam Postavsky
2019-04-11 14:02 ` Eli Zaretskii
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=e5e4e9d4-e34d-4628-a9c8-dfd2f9472ebf@default \
--to=drew.adams@oracle.com \
--cc=35222@debbugs.gnu.org \
--cc=npostavs@gmail.com \
/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.