unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* `read--expression' and `read-minibuffer'
@ 2016-09-03 18:20 Drew Adams
  2016-09-04  4:40 ` Stefan Monnier
  0 siblings, 1 reply; 24+ messages in thread
From: Drew Adams @ 2016-09-03 18:20 UTC (permalink / raw)
  To: emacs-devel

Function `read--expression' was added in Emacs 24.4.

Can someone please explain why this is an "internal" function
(two hyphens in the name)?  Why wouldn't users want to use
this to read a Lisp expression from the minibuffer?

It seems like `read--expression' should now be the usual way
to read and return a Lisp expression, and that it should NOT
be considered "internal".  No?

On the other hand, we still also have the longstanding
(non-internal) function `read-minibuffer' for reading and
returning a Lisp "object".

It's not clear to me how a Lisp object differs from a Lisp
sexp.  (And the doc of `interactive' even calls what "x"
reads a "Lisp expression", not a "Lisp object".)

Well, sure, there are Lisp objects (e.g. byte-compiled
functions) that are not readable expressions.  But those are
not readable anyway, AFAIK.  `read-minibuffer', like
`read--expression', just reads expressions, AFAICT.

The difference between `read-minibuffer' and `read--expression'
is this: The former uses `minibuffer-local-map', so it has no
special handling of Lisp expressions and no completion.  The
latter uses `read-expression-map', and it provides Lisp-sexp
completion.

Why isn't `read--expression' treated as a user function, like
`read-minibuffer', instead of being considered "internal"?

And `read-minibuffer' is still used for `interactive' with
spec "x".  Why isn't `read--expression' used for that now?

How about promoting `read--expression' to `read-expression'
and using it for `(interactive "x")'?  Nothing wrong with
also keeping `read-minibuffer' (though it's name is not great),
but why continue to use it in preference to `read--expression'?

`read-minibuffer' is still used in several places, but I
don't see why those places wouldn't benefit from using
`read--expression' instead.

Am I missing something?  I ask because I read Lisp sexps
from the minibuffer, and I don't (yet) see any reason to
use `read-minibuffer' instead of "internal" function
`read--expression'.  I'd like to learn which to use and why.
Thx.



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2016-09-09 21:41 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-03 18:20 `read--expression' and `read-minibuffer' Drew Adams
2016-09-04  4:40 ` Stefan Monnier
2016-09-04  5:53   ` Drew Adams
2016-09-04  6:27     ` Stefan Monnier
2016-09-04 15:39       ` Drew Adams
2016-09-05  2:36         ` Stefan Monnier
2016-09-06 19:02         ` Davis Herring
2016-09-06 20:29           ` Drew Adams
2016-09-07  0:04             ` Stefan Monnier
2016-09-07  3:01               ` Drew Adams
2016-09-07  3:46                 ` Stefan Monnier
2016-09-07  5:54                   ` Drew Adams
2016-09-07 12:12                     ` Stefan Monnier
2016-09-09 21:41                       ` Drew Adams
2016-09-07 13:25                     ` Herring, Davis
2016-09-07 16:02                       ` Drew Adams
2016-09-07 17:01                         ` Davis Herring
2016-09-07 21:01                           ` Drew Adams
2016-09-07 22:17               ` Michael Heerdegen
2016-09-07 22:30                 ` Stefan Monnier
2016-09-07 22:50                   ` Michael Heerdegen
2016-09-08  0:19                     ` Stefan Monnier
2016-09-06 21:05           ` Stefan Monnier
2016-09-06 21:35             ` Drew Adams

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).