summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2020-07-09 13:12:34 +0100
committerJoão Távora <joaotavora@gmail.com>2020-07-09 18:07:22 +0100
commit59f563680daa3e25db7c85c07bee020ac48b5fa5 (patch)
tree418091e6dcd4a332ca93ec3989335e504c5a3d1c /lisp/emacs-lisp
parentffb99d84900e47697c9f20a914e86d39e9bcd8b4 (diff)
downloademacs-59f563680daa3e25db7c85c07bee020ac48b5fa5.tar.gz
emacs-59f563680daa3e25db7c85c07bee020ac48b5fa5.tar.bz2
emacs-59f563680daa3e25db7c85c07bee020ac48b5fa5.zip
Unbreak M-x eldoc
The command should always invoke Eldoc when called interactively, instead of going through the usual checks, which are performed to avoid interference with other commands. * lisp/emacs-lisp/eldoc.el (eldoc-print-current-symbol-info): Rework. (Version): Bump to 1.2.0
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/eldoc.el29
1 files changed, 16 insertions, 13 deletions
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 24b6ceca48a..7c8e0e71175 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -5,7 +5,7 @@
;; Author: Noah Friedman <friedman@splode.com>
;; Keywords: extensions
;; Created: 1995-10-06
-;; Version: 1.1.0
+;; Version: 1.2.0
;; Package-Requires: ((emacs "26.3"))
;; This is a GNU ELPA :core package. Avoid functionality that is not
@@ -712,19 +712,22 @@ endeavour to display the docstrings given to them."
(;; New protocol: trust callback will be called;
t))))))
-(defun eldoc-print-current-symbol-info ()
+(defun eldoc-print-current-symbol-info (&optional interactive)
"Document thing at point."
- (interactive)
- (if (not (eldoc-display-message-p))
- ;; Erase the last message if we won't display a new one.
- (when eldoc-last-message
- (eldoc--message nil))
- (let ((non-essential t))
- ;; Only keep looking for the info as long as the user hasn't
- ;; requested our attention. This also locally disables
- ;; inhibit-quit.
- (while-no-input
- (eldoc--invoke-strategy)))))
+ (interactive '(t))
+ (cond (interactive
+ (eldoc--invoke-strategy))
+ (t
+ (if (not (eldoc-display-message-p))
+ ;; Erase the last message if we won't display a new one.
+ (when eldoc-last-message
+ (eldoc--message nil))
+ (let ((non-essential t))
+ ;; Only keep looking for the info as long as the user hasn't
+ ;; requested our attention. This also locally disables
+ ;; inhibit-quit.
+ (while-no-input
+ (eldoc--invoke-strategy)))))))
;; When point is in a sexp, the function args are not reprinted in the echo
;; area after every possible interactive command because some of them print