Subject: bug#36886: 26.2; (global-eldoc-mode -1) should disable eldoc completely

From: Noam Postavsky <[email-masked]>
Date: Sun, 04 Aug 2019 10:34:38 -0400

"Basil L. Contovounesios" <[email-masked]> writes:

> The problem is that minibuffer-setup-hook, which sets
> eldoc-documentation-function, has not yet run at this stage, so the
> minibuffer is not yet considered suitable for enabling eldoc-mode.

Ah, tricky, we should probably put this in a comment somewhere.

>> Subject: [PATCH] Respect global-eldoc-mode in minibuffers (Bug#36886)

> Should this log entry mention bug#27202 as well?

Sure, can't hurt.

> shouldn't this call to eldoc-mode be bundled in the same hook function
> with...

>> @@ -1583,7 +1583,6 @@ read--expression
>>            ;; FIXME: call emacs-lisp-mode?
>>            (add-function :before-until (local 'eldoc-documentation-function)
>>                          #'elisp-eldoc-documentation-function)
>
> ...this advice?

Oh yeah, that would make sense.

Štěpán Němec <[email-masked]> writes:

> On Sun, 04 Aug 2019 10:51:08 +0300
> Basil L. Contovounesios wrote:
>
>> This looks fine to me (the only alternative I can think of is creating a
>> new major mode specifically for read--expression) [...]
>
> ...which actually sounds like it could be a real improvement in other
> respects, too: many users seem to be trying to make M-: more convenient
> (better completion, possibly syntax highlighting, paredit etc.); this
> looks like a good way to make that easier or even unnecessary by default
> (deriving from emacs-lisp-mode).

I tried calling emacs-lisp-mode as the FIXME suggests, but it results in
a minibuffer that can't be C-g'd out of.  I guess it destroys or misses
some minibuffer-specific setup?  So if someone can figure out how to do
that properly it does sound like a good solution.