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

From: Alex Branham <[email-masked]>
Date: Sat, 27 Mar 2021 08:06:45 -0400

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?

> Then maybe it should also set eldoc-documentation-strategy to
> something sensible. Eldoc-documentation-strategy is just the new name
> of eldoc-documentation-function. If you find an `ignore` there, you're
> safe to change it , buffer-locally, as you did before. Maybe you
> should even do it even if you _don't_ find an ignore there. The fact
> that it's now defcustom doesn't change much in my opinion, I don't see
> defcustom's as off-limits to major/minor modes, as long as the user is
> still given override power in the mode hooks.
>
> Alternatively, ess-mode should just use the old interface.
> It's still available and functional.
>
> But I think you should select a strategy that suits `ess-mode`'s
> functions.

So the recommended strategy to support 27.1+old eldoc, 27.1+new eldoc,
and 28.0+new eldoc is something like the below?

(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))