eldoc: modify eldoc-documentation-function' using add-function'

* lisp/emacs-lisp/eldoc.el (eldoc-documentation-function): Describe how
major modes should use `add-function' to alter value of the variable.

* lisp/hexl.el (hexl-mode): Set `eldoc-documentation-function' using
`add-function' so the default value is always used.
* lisp/ielm.el (inferior-emacs-lisp-mode): Set
`eldoc-documentation-function' using `add-function' so the default
value is always used.
* lisp/progmodes/cfengine.el (cfengine3-mode): Set
`eldoc-documentation-function' using `add-function' so the default
value is always used.
* lisp/progmodes/elisp-mode (emacs-lisp-mode): Set
`eldoc-documentation-function' using `add-function' so the default
value is always used.
* lisp/progmodes/octave.el (octave-mode): Set
`eldoc-documentation-function' using `add-function' so the default
value is always used.
* lisp/progmodes/python.el (python-mode): Set
`eldoc-documentation-function' using `add-function' so the default
value is always used.
* lisp/simple.el (read--expression): Set `eldoc-documentation-function'
using `add-function' so the default value is always used.
This commit is contained in:
Michal Nazarewicz 2014-12-05 19:34:42 +01:00
parent 81681ed9a1
commit fd020a2931
9 changed files with 44 additions and 14 deletions

View file

@ -336,7 +336,12 @@ 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
effect.
This variable is expected to be set buffer-locally by modes that support ElDoc.")
Major modes should modify this variable using `add-function', for example:
(add-function :before-until (local 'eldoc-documentation-function)
#'foo-mode-eldoc-function)
so that the global documentation function (i.e. the default value of the
variable) is taken into account if the major mode specific function does not
return any documentation.")
(defun eldoc-print-current-symbol-info ()
;; This is run from post-command-hook or some idle timer thing,