Subject: bug#47388: 27.1; eldoc-documentation-function is ignore in updated eldoc

From: João Távora <[email-masked]>
Date: Sat, 27 Mar 2021 12:53:13 +0000

On Sat, Mar 27, 2021 at 12:06 PM Alex Branham <[email-masked]>
wrote:

> On Fri 26 Mar 2021 at 20:34, João Távora <[email-masked]> wrote:
>
> > Ah, I get it, so ess-mode does something different.
>
> I'm not sure I understand - different from what?
>

It does different things depending on the situation it thinks
it finds itself in.

(if (function-equal #'ignore eldoc-documentation-function)
>     (add-hook 'eldoc-documentation-functions #'ess-r-eldoc-function nil t)
>   (add-function :before-until (local 'eldoc-documentation-function)
>                 #'ess-r-eldoc-function))
>

I'm not sure you're improving much here.  My idea is that,
if you find eldoc-documentation-functions (plural) to be bound you
may need to check that eldoc-documentation-strategy (or
eldoc-documentation-function (singular)) ISN'T #ignore and
buffer-locally adjust it accordingly to something of your preference
or your users' preference.

Alternatively, you can just keep using the old technique which is a lot
of parts of Emacs do (like elisp-mode in Emacs 27.1, for example), i.e.
use the else branch in your if, and only that.  You don't seem to be using a
ny of the new ElDoc features like multiple documentation functions anyway.
That should also work for your Eglot-less rss-mode.

When using Eglot-ified rss-mode Eglot will do the right thing regardless
of the approach you take above.

All this said, I think this issue should be kept open nonetheless. If indeed
the new package's defcustom could clobber the global value of
eldoc-documentation-function if it finds it to be #'ignore I think it
should
be fine.

CC-ing Stefan Monnier for an opinion on this last part.

João Távora