eldoc-documentation-function is a variable defined in `eldoc.el'.
Its value is

  • This variable may be risky if used as a file-local variable.

Function to call to return doc string.
The function of no args should return a one-line string for displaying
doc about a function etc. appropriate to the context around point.
It should return nil if there's no doc appropriate for the context.
Typically doc is returned if point is on a function-like name or in its
arg list.

The result is used as is, so the function must explicitly handle
the variables `eldoc-argument-case' and `eldoc-echo-area-use-multiline-p',
and the face `eldoc-highlight-function-argument', if they are to have any

This variable is expected to be set buffer-locally by modes that support ElDoc.