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

From: Alex Branham <[email-masked]>
Date: Fri, 26 Mar 2021 15:08:59 -0400

On Fri 26 Mar 2021 at 18:50, João Távora <[email-masked]> wrote:

> Alex, exactly under what circunstances do you see that "There is no
> ElDoc support in this buffer"?  In what buffer, doing what?  I
> appreciate that you have investigated the implementation, but I need to
> be able to understand -- and potentially reproduce -- the problem
> exactly as it happened to you, so please provide as clear a recipe as
> possible, perhaps starting with "downloaded Emacs 27.1, then cleared my
> ELPA directory, ..., installed Eglot from xyz, ..., ".

Sure thing (though note I'm not the person who originally ran into the
bug, just was able to reproduce). From a clean install of 27.1 (no init
file, no packages), you should be able to reproduce by:

1. Add MELPA to package-archives
2. Install ESS
3. Update eldoc (potentially by installing eglot)
4. Restart Emacs
5. (require 'eglot)
6. Open an R file (eg ~/test.R)
7. At this point, eldoc-documentation-function will be #'ignore so eg
   M-x eldoc-mode will show "There is no ElDoc support in this buffer".

That's because ESS sets up eldoc in R buffers like so:

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

so we don't touch eldoc-documentation-function in newer eldoc versions
where it is supposed to be a user-facing customization.

> Meanwhile (but not excluding the earlier valuable exercise), can you
> show the output of:
>
>   C-h v eldoc-documentation-function RET
>   C-h v eldoc-documentation-strategy RET

Unfortunately I can't at the moment but from memory
eldoc-documentation-strategy was an obsolete alias for
eldoc-documentation-function and the value was the function ignore.

Hope that helps.