unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Daniel Koning <dk@danielkoning.com>
Cc: 41781@debbugs.gnu.org
Subject: bug#41781: 27.0.91; [PATCH] Eldoc describes the wrong function when reading an expression from the minibuffer
Date: Tue, 23 Jun 2020 00:17:27 -0400	[thread overview]
Message-ID: <jwvh7v28lqb.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m2o8pazlra.fsf@danielkoning.com> (Daniel Koning's message of "Mon, 22 Jun 2020 19:08:57 -0500")

>> Looks like a bug in the corresponding function (`read-expression` or nearby).
> OK, I've attached another patch for that function.

Looks good to me, thanks.

> If you change `read--expression', I don't know whether you'll think it
> makes sense to add the extra overhead to `elisp--current-symbol'.

I'm not worried about the overhead, but I don't like the potential
syntax-ppss interaction, so if it's not needed, I'd rather not go there.

> I can confirm that it suffers from the fairly significant drawback of
> not working at all.  Since the major replaces the minibuffer-specific
> keymap, nothing ends up bound to `exit-minibuffer', so you can't even
> enter an expression (or do anything else, like history paging).

Fun!  Thanks for trying ;-)

> You could bind `overriding-local-map' at the top of the function, but
> with that and the syntax table you're getting close to implementing
> a de facto new mode inside the de jure old one. At that point it might
> as well be a real custom major mode, as you suggested.

Right.  It's probably worth doing something here in the longer run, tho.
E.g. the `minibuffer-local-map` and friends should really be major mode
maps (and the inheritance between the maps should probably be reflected as
inheritance between corresponding modes).  Then you'd create an
`emacs-lisp-minibuffer-mode` by deriving from some "normal" `minibuffer-local-mode`.

> And then there's the possibility that some people's
> `emacs-lisp-mode-hook' might contain code that assumes it's in a real
> buffer and misbehaves in the minibuffer.

Indeed.

> On the other hand, you could do what eshell does for `eshell-command'
> and turn on its major mode in the minibuffer while selectively binding
> C-j, C-m, M-p, etc., inside the setup hook.  I don't like this design at
> all: if I were to make changes to my `minibuffer-local-map' bindings,
> eshell would silently ignore them.  Any custom mode for minibuffer input
> should inherit an existing minibuffer keymap, in my book at least.

Agreed.


        Stefan






  reply	other threads:[~2020-06-23  4:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10  2:56 bug#41781: 27.0.91; [PATCH] Eldoc describes the wrong function when reading an expression from the minibuffer Daniel Koning
2020-06-20  7:49 ` Eli Zaretskii
2020-06-20 16:51   ` Stefan Monnier
2020-06-23  0:08     ` Daniel Koning
2020-06-23  4:17       ` Stefan Monnier [this message]
2020-06-23 13:58         ` Daniel Koning
2020-06-23 14:09           ` Stefan Monnier
2020-06-23 16:42             ` Daniel Koning
2020-06-23 18:37               ` Stefan Monnier
2020-07-04  7:57       ` Eli Zaretskii
2020-08-05 15:59         ` Lars Ingebrigtsen
2020-08-08  8:09           ` 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

  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=jwvh7v28lqb.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=41781@debbugs.gnu.org \
    --cc=dk@danielkoning.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 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).