diff options
| author | Stefan Monnier | 2020-02-26 22:47:32 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2020-02-26 22:47:32 -0500 |
| commit | 125da00b149f8f384ff288880cdd1b2e776c9444 (patch) | |
| tree | ce177648b49a7a091f207ba842168ae757943687 | |
| parent | 07da629926daf849aab248175c88cf53a5e21558 (diff) | |
| download | emacs-125da00b149f8f384ff288880cdd1b2e776c9444.tar.gz emacs-125da00b149f8f384ff288880cdd1b2e776c9444.zip | |
* lisp/emacs-lisp/eldoc.el (eldoc-documentation-function): No nil value
(eldoc--supported-p): Move after the vars it uses. Simplify.
(eldoc-print-current-symbol-info): Revert to previous code which
assumed a non-nil value of eldoc-documentation-function.
| -rw-r--r-- | lisp/emacs-lisp/eldoc.el | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 456a650828c..6e35018b100 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el | |||
| @@ -233,14 +233,6 @@ See `eldoc-documentation-function' for more detail." | |||
| 233 | (when (eldoc--supported-p) | 233 | (when (eldoc--supported-p) |
| 234 | (eldoc-mode 1))) | 234 | (eldoc-mode 1))) |
| 235 | 235 | ||
| 236 | (defun eldoc--supported-p () | ||
| 237 | "Non-nil if an ElDoc function is set for this buffer." | ||
| 238 | (let ((hook 'eldoc-documentation-functions)) | ||
| 239 | (and (not (memq eldoc-documentation-function '(nil ignore))) | ||
| 240 | (or (and (local-variable-p hook) | ||
| 241 | (buffer-local-value hook (current-buffer))) | ||
| 242 | (default-value hook))))) | ||
| 243 | |||
| 244 | 236 | ||
| 245 | (defun eldoc-schedule-timer () | 237 | (defun eldoc-schedule-timer () |
| 246 | "Ensure `eldoc-timer' is running. | 238 | "Ensure `eldoc-timer' is running. |
| @@ -405,11 +397,15 @@ effect." | |||
| 405 | :link '(info-link "(emacs) Lisp Doc") | 397 | :link '(info-link "(emacs) Lisp Doc") |
| 406 | :type '(radio (function-item eldoc-documentation-default) | 398 | :type '(radio (function-item eldoc-documentation-default) |
| 407 | (function-item eldoc-documentation-compose) | 399 | (function-item eldoc-documentation-compose) |
| 408 | (function :tag "Other function") | 400 | (function :tag "Other function")) |
| 409 | (const :tag "None" nil)) | ||
| 410 | :version "28.1" | 401 | :version "28.1" |
| 411 | :group 'eldoc) | 402 | :group 'eldoc) |
| 412 | 403 | ||
| 404 | (defun eldoc--supported-p () | ||
| 405 | "Non-nil if an ElDoc function is set for this buffer." | ||
| 406 | (and (not (memq eldoc-documentation-function '(nil ignore))) | ||
| 407 | eldoc-documentation-functions)) | ||
| 408 | |||
| 413 | (defun eldoc-print-current-symbol-info () | 409 | (defun eldoc-print-current-symbol-info () |
| 414 | "Print the text produced by `eldoc-documentation-function'." | 410 | "Print the text produced by `eldoc-documentation-function'." |
| 415 | ;; This is run from post-command-hook or some idle timer thing, | 411 | ;; This is run from post-command-hook or some idle timer thing, |
| @@ -423,8 +419,7 @@ effect." | |||
| 423 | ;; Only keep looking for the info as long as the user hasn't | 419 | ;; Only keep looking for the info as long as the user hasn't |
| 424 | ;; requested our attention. This also locally disables inhibit-quit. | 420 | ;; requested our attention. This also locally disables inhibit-quit. |
| 425 | (while-no-input | 421 | (while-no-input |
| 426 | (let ((fun eldoc-documentation-function)) | 422 | (eldoc-message (funcall eldoc-documentation-function))))))) |
| 427 | (when fun (eldoc-message (funcall fun))))))))) | ||
| 428 | 423 | ||
| 429 | ;; If the entire line cannot fit in the echo area, the symbol name may be | 424 | ;; If the entire line cannot fit in the echo area, the symbol name may be |
| 430 | ;; truncated or eliminated entirely from the output to make room for the | 425 | ;; truncated or eliminated entirely from the output to make room for the |