emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/eldoc-async 55b3df4 5/5: Use or recommend eldoc-documentaiton-fu


From: João Távora
Subject: scratch/eldoc-async 55b3df4 5/5: Use or recommend eldoc-documentaiton-functions in more places
Date: Sun, 14 Jun 2020 09:09:14 -0400 (EDT)

branch: scratch/eldoc-async
commit 55b3df4b2b9a92a794224a35dac905acace291a5
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Use or recommend eldoc-documentaiton-functions in more places
    
    The only other places where the obsolete eldoc-documentation-function
    is still used is in libraries which are presumably still compatible
    with previous Emacs versions.
    
    * lisp/descr-text.el (describe-char-eldoc): Recommend
    eldoc-documentation-functions.
    
    * lisp/progmodes/cfengine.el (cfengine3-documentation-function):
    Recommend eldoc-documentation-functions
    
    * lisp/progmodes/octave.el (inferior-octave-mode): Use
    eldoc-documentation-functions.
---
 lisp/descr-text.el         | 6 ++++--
 lisp/progmodes/cfengine.el | 4 ++--
 lisp/progmodes/octave.el   | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 1dbbd42..22cfccb 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -929,10 +929,12 @@ Otherwise return a description formatted by
 of `eldoc-echo-area-use-multiline-p' variable and width of
 minibuffer window for width limit.
 
-This function is meant to be used as a value of
-`eldoc-documentation-function' variable."
+This function can be used as a value of
+`eldoc-documentation-functions' variable."
   (let ((ch (following-char)))
     (when (and (not (zerop ch)) (or (< ch 32) (> ch 127)))
+      ;; TODO: investigate if the new `eldoc-documentation-functions'
+      ;; API could significantly improve this.
       (describe-char-eldoc--format
        ch
        (unless (eq eldoc-echo-area-use-multiline-p t)
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index 9a6d81c..acf70a5 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -1296,8 +1296,8 @@ Calls `cfengine-cf-promises' with \"-s json\"."
 
 (defun cfengine3-documentation-function (&rest _ignored)
   "Document CFengine 3 functions around point.
-Intended as the value of `eldoc-documentation-function', which see.
-Use it by enabling `eldoc-mode'."
+Intended as the value of `eldoc-documentation-functions', which
+see.  Use it by enabling `eldoc-mode'."
   (let ((fdef (cfengine3--current-function)))
     (when fdef
       (cfengine3-format-function-docstring fdef))))
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index 2cf305c..e07f818 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -755,7 +755,7 @@ Key bindings:
   (setq font-lock-defaults '(inferior-octave-font-lock-keywords nil nil))
 
   (setq-local info-lookup-mode 'octave-mode)
-  (setq-local eldoc-documentation-function 'octave-eldoc-function)
+  (add-hook 'eldoc-documentation-functions 'octave-eldoc-function nil t)
 
   (setq-local comint-input-ring-file-name
               (or (getenv "OCTAVE_HISTFILE") "~/.octave_hist"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]