unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Drew Adams <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: Re: `read--expression' and `read-minibuffer'
Date: Tue, 06 Sep 2016 20:04:45 -0400	[thread overview]
Message-ID: <jwva8fkfuwr.fsf-monnier+Inbox@gnu.org> (raw)
In-Reply-To: <b93b69a2-f719-40de-8623-6b594027bdb4@default> (Drew Adams's message of "Tue, 6 Sep 2016 13:29:03 -0700 (PDT)")

> That's not a real problem, but that's the only place/case where I
> can see an argument for a "variant" behavior (completion against
> both function and variable names at that position too).

For S-exps in general, we can't provide much completion, and we
certainly shouldn't provide completion against function names and
variable names.

An S-exp is like an XML tree.  An Elisp expression is like a XHTML tree
(i.e. it's a particular kind of XML that is expected to follow
a particular schema).  Yes, it's also an XML tree, but if all you know
is that you're typing an XML tree, providing any completion based on
XHTML identifiers is just bogus.

> The non-"internal" function `read-minibuffer' is not very
> reasonable, and is essentially a vestige, at this point.

Ah, so that's your complaint.  Why don't you make a bug-report about
that one, pointing out exactly what are its shortcomings.  But do
remember: it's a function meant for S-exps, i.e. random data represented
in a form suitable for the Lisp reader, with no assumption like an
expectation that it be related to Elisp code.

> We can do better, and better is already available:
> `read--expression'.  Some such function should now be
> available non-"internally".

Now I'm confused.  If you want a function to read an Elisp expression,
indeed read--expression might be your solution.  Then make a bug report
asking for it to be renamed.

> If you want to (1) rename the current `read--expression' to
> `read-expression-for-eval' and (2) create a variant `read-expression'
> (which is for both eval and not), please go ahead.

I have no idea what a "read-expression not for eval" would mean or look like.

`read--expression' already couldn't care less whether you'll pass the
result to `eval' or not.  All it cares about is that it provides useful
behavior (eldoc, completion, indentation) under the assumption that the
user is typing something that is (more or less) valid Elisp code, rather
than random data.

> 1. That's not a good reason to make it "internal".

I already said that it's internal for no particular reason.  So at this
point I'll just PLONK


        Stefan



  reply	other threads:[~2016-09-07  0:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=jwva8fkfuwr.fsf-monnier+Inbox@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=drew.adams@oracle.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).