aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorMark Oteiza2020-02-25 17:53:04 -0500
committerMark Oteiza2020-02-25 18:15:12 -0500
commitc0fcbd2c119b8418855f0931aceefbef717c5e53 (patch)
treee082296f7c739d7e4420ddd7210a0f022174640b /lisp/progmodes
parent03c07c88d90b5747456b9d286bace2dd4a713aac (diff)
downloademacs-c0fcbd2c119b8418855f0931aceefbef717c5e53.tar.gz
emacs-c0fcbd2c119b8418855f0931aceefbef717c5e53.zip
Expose ElDoc functions in a hook (Bug#28257)
* lisp/emacs-lisp/eldoc.el: Update commentary. (eldoc--eval-expression-setup): Use new hook. (eldoc--supported-p): Accomodate new hook. (eldoc-documentation-functions): New hook. (eldoc-documentation-default, eldoc-documentation-compose): New functions. (eldoc-documentation-function): Use 'eldoc-documentation-default' as new default value. Update documentation and custom attributes. (eldoc-print-current-symbol-info): Accomodate possible null value for 'eldoc-documentation-function'. * etc/NEWS: Mention them. * doc/emacs/programs.texi (Emacs Lisp Documentation Lookup): Mention new hook and changes to 'eldoc-documentation-function'. * lisp/hexl.el (hexl-mode, hexl-revert-buffer-function): * lisp/ielm.el (inferior-emacs-lisp-mode): * lisp/progmodes/cfengine.el (cfengine3-mode): * lisp/progmodes/elisp-mode.el (emacs-lisp-mode): * lisp/progmodes/octave.el (octave-mode): * lisp/progmodes/python.el (python-mode): Use new hook.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/cfengine.el15
-rw-r--r--lisp/progmodes/elisp-mode.el4
-rw-r--r--lisp/progmodes/octave.el3
-rw-r--r--lisp/progmodes/python.el6
4 files changed, 16 insertions, 12 deletions
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index 18df372f2c6..f25b3cb9e2b 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -1390,12 +1390,15 @@ to the action header."
1390 (when buffer-file-name 1390 (when buffer-file-name
1391 (shell-quote-argument buffer-file-name))))) 1391 (shell-quote-argument buffer-file-name)))))
1392 1392
1393 ;; For emacs < 25.1 where `eldoc-documentation-function' defaults to 1393 (if (boundp 'eldoc-documentation-functions)
1394 ;; nil. 1394 (add-hook 'eldoc-documentation-functions
1395 (or eldoc-documentation-function 1395 #'cfengine3-documentation-function nil t)
1396 (setq-local eldoc-documentation-function #'ignore)) 1396 ;; For emacs < 25.1 where `eldoc-documentation-function' defaults
1397 (add-function :before-until (local 'eldoc-documentation-function) 1397 ;; to nil.
1398 #'cfengine3-documentation-function) 1398 (or eldoc-documentation-function
1399 (setq-local eldoc-documentation-function #'ignore))
1400 (add-function :before-until (local 'eldoc-documentation-function)
1401 #'cfengine3-documentation-function))
1399 1402
1400 (add-hook 'completion-at-point-functions 1403 (add-hook 'completion-at-point-functions
1401 #'cfengine3-completion-function nil t) 1404 #'cfengine3-completion-function nil t)
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 2617a6e4cce..813b628bc35 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -250,8 +250,8 @@ Blank lines separate paragraphs. Semicolons start comments.
250 (add-hook 'electric-pair-mode-hook #'emacs-lisp-set-electric-text-pairs)) 250 (add-hook 'electric-pair-mode-hook #'emacs-lisp-set-electric-text-pairs))
251 (setq-local electric-quote-string t) 251 (setq-local electric-quote-string t)
252 (setq imenu-case-fold-search nil) 252 (setq imenu-case-fold-search nil)
253 (add-function :before-until (local 'eldoc-documentation-function) 253 (add-hook 'eldoc-documentation-functions
254 #'elisp-eldoc-documentation-function) 254 #'elisp-eldoc-documentation-function nil t)
255 (add-hook 'xref-backend-functions #'elisp--xref-backend nil t) 255 (add-hook 'xref-backend-functions #'elisp--xref-backend nil t)
256 (setq-local project-vc-external-roots-function #'elisp-load-path-roots) 256 (setq-local project-vc-external-roots-function #'elisp-load-path-roots)
257 (add-hook 'completion-at-point-functions 257 (add-hook 'completion-at-point-functions
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 9e039562549..352c1810d1f 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -619,8 +619,7 @@ Key bindings:
619 (add-hook 'before-save-hook 'octave-sync-function-file-names nil t) 619 (add-hook 'before-save-hook 'octave-sync-function-file-names nil t)
620 (setq-local beginning-of-defun-function 'octave-beginning-of-defun) 620 (setq-local beginning-of-defun-function 'octave-beginning-of-defun)
621 (and octave-font-lock-texinfo-comment (octave-font-lock-texinfo-comment)) 621 (and octave-font-lock-texinfo-comment (octave-font-lock-texinfo-comment))
622 (add-function :before-until (local 'eldoc-documentation-function) 622 (add-hook 'eldoc-documentation-functions 'octave-eldoc-function nil t)
623 'octave-eldoc-function)
624 623
625 (easy-menu-add octave-mode-menu)) 624 (easy-menu-add octave-mode-menu))
626 625
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index a2d85d0bef8..67383b34154 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -5544,8 +5544,10 @@ REPORT-FN is Flymake's callback function."
5544 ;; Emacs<25 5544 ;; Emacs<25
5545 (set (make-local-variable 'eldoc-documentation-function) 5545 (set (make-local-variable 'eldoc-documentation-function)
5546 #'python-eldoc-function) 5546 #'python-eldoc-function)
5547 (add-function :before-until (local 'eldoc-documentation-function) 5547 (if (boundp 'eldoc-documentation-functions)
5548 #'python-eldoc-function)) 5548 (add-hook 'eldoc-documentation-functions #'python-eldoc-function nil t)
5549 (add-function :before-until (local 'eldoc-documentation-function)
5550 #'python-eldoc-function)))
5549 5551
5550 (add-to-list 5552 (add-to-list
5551 'hs-special-modes-alist 5553 'hs-special-modes-alist