GNU bug report logs - #41781
27.0.91; [PATCH] Eldoc describes the wrong function when reading an expression from the minibuffer

Previous Next

Package: emacs;

Reported by: Daniel Koning <dk <at> danielkoning.com>

Date: Wed, 10 Jun 2020 02:57:02 UTC

Severity: minor

Tags: patch

Found in version 27.0.91

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 41781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Daniel Koning <dk <at> danielkoning.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 41781 <at> debbugs.gnu.org
Subject: Re: 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
>> 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





This bug report was last modified 4 years and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.