Subject: Re: bug#43103: 28.0.50; Default ElDoc composition strategy in Elisp mode (eldoc-documentation-strategy)

From: Dmitry Gutov <[email-masked]>
Date: Mon, 31 Aug 2020 23:03:37 +0300

On 31.08.2020 11:38, João Távora wrote:

>> It's true, but the curious reality is that AFAIK the built-in eldoc
>> functions (foremost, the Elisp one) have always used the one-line
>> display, even when they could show more.
>>
>> These is definite wisdom in that.
> 
> I see only signs of rudimentary intial design which predates
> eldoc-...-multiline-p, composition, Flymake...

That doesn't mean the initial design didn't get something right.

If it didn't, this aspect would have likely changed by now.

>> Change the default in eldoc.el. Why emacs-lisp-mode?
> 
> See subject line.

Having a major mode exhibit a different behavior WRT eldoc strategy is 
bound to be confusing. E.g., why Elisp and not Python? Why not the rest?

>> One would probably prefer to see the description of the compilation
>> error rather than the function signature, if they had to choose.
> 
> Maybe you would, you can adjust it.  I'd rather not change more defaults
> than the one suggested in the subject line.

If it's for emacs-lisp-mode only, it's already not "changing the default".

>>> - even if eldoc-echo-area-use-multiline-p is set to nil, users can still
>>> get to all the info collecte by ElDoc with the new
>>> `eldoc-documentation-compose` strategy by pressing M-x eldoc-doc-buffer
>>
>> Is that the only benefit?
> 
> No.

Any others?

>> This command is pretty odd in its design. But if its main purpose was
>> to show multiple eldoc results together
> 
> It's similar to `help-buffer`, but also switches to the buffer when
> called interactively.  I don't see anything odd in that, in Emacs terms.

It's odd to use basically the same presentation for the buffer as the 
one for the echo area. The echo area is smaller in size, and has 
undesirable side-effects when its contents change height. A buffer 
doesn't have these kind of constraints.

And if we were to differentiate the buffer's presentation (for instance, 
by binding eldoc-echo-area-use-multiline-p to t inside 
eldoc-print-current-symbol-info's interactive clause), we might as well 
use a different strategy for it, too.

> The command pops a window to *eldoc ...*, a less restricted view into
> the continuously composed results of ElDoc collection, the echo area
> being a much more restricted outlet.  In the future, there could/should
> be an arbitrary number of such outlets: windows, frames, tooltips, some
> more restrictive, some less, some more interactive, some less.

Some of these have different constraints, too.

> This is beyond the scope of this bug, though.

You brought it up.