diff options
| author | Stefan Monnier | 2014-01-21 08:09:55 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2014-01-21 08:09:55 -0500 |
| commit | dd9d2e9d1ee663f5c068715923a2a84fbb55c08e (patch) | |
| tree | 7dd53cdcfe09a37c96a8aa93aafb051a3da9da13 | |
| parent | 38942b9cf566116227bec6f41aa0aece5de6e2c9 (diff) | |
| download | emacs-dd9d2e9d1ee663f5c068715923a2a84fbb55c08e.tar.gz emacs-dd9d2e9d1ee663f5c068715923a2a84fbb55c08e.zip | |
* lisp/emacs-lisp/eldoc.el: Properly remove message in minibuffer case.
(eldoc--message-command-p): New function.
(eldoc-display-message-p): Use it.
(eldoc-pre-command-refresh-echo-area): In the minibuffer case, the
message is not automatically erased for us.
(eldoc-print-current-symbol-info): Erase previous message, if any.
| -rw-r--r-- | lisp/ChangeLog | 17 | ||||
| -rw-r--r-- | lisp/emacs-lisp/eldoc.el | 30 |
2 files changed, 31 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e7d584b153d..ead5b0d6741 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,10 +1,19 @@ | |||
| 1 | 2014-01-21 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/eldoc.el: Properly remove message in minibuffer case. | ||
| 4 | (eldoc--message-command-p): New function. | ||
| 5 | (eldoc-display-message-p): Use it. | ||
| 6 | (eldoc-pre-command-refresh-echo-area): In the minibuffer case, the | ||
| 7 | message is not automatically erased for us. | ||
| 8 | (eldoc-print-current-symbol-info): Erase previous message, if any. | ||
| 9 | |||
| 1 | 2014-01-21 Tassilo Horn <tsdh@gnu.org> | 10 | 2014-01-21 Tassilo Horn <tsdh@gnu.org> |
| 2 | 11 | ||
| 3 | * textmodes/reftex.el (reftex-create-bibtex-file): Fix autoload to | 12 | * textmodes/reftex.el (reftex-create-bibtex-file): Fix autoload to |
| 4 | specify it's an interactive function. | 13 | specify it's an interactive function. |
| 5 | 14 | ||
| 6 | * textmodes/reftex-cite.el (reftex-all-used-citation-keys): Fix | 15 | * textmodes/reftex-cite.el (reftex-all-used-citation-keys): |
| 7 | regex used for scanning for citation keys which failed for | 16 | Fix regex used for scanning for citation keys which failed for |
| 8 | citations with optional arguments. | 17 | citations with optional arguments. |
| 9 | 18 | ||
| 10 | 2014-01-21 Leo Liu <sdl.web@gmail.com> | 19 | 2014-01-21 Leo Liu <sdl.web@gmail.com> |
| @@ -89,8 +98,8 @@ | |||
| 89 | 2014-01-17 Dmitry Gutov <dgutov@yandex.ru> | 98 | 2014-01-17 Dmitry Gutov <dgutov@yandex.ru> |
| 90 | 99 | ||
| 91 | * progmodes/ruby-mode.el (ruby-alignable-keywords): New constant. | 100 | * progmodes/ruby-mode.el (ruby-alignable-keywords): New constant. |
| 92 | (ruby-align-to-stmt-keywords): Change the default value. Use | 101 | (ruby-align-to-stmt-keywords): Change the default value. |
| 93 | `ruby-alignable-keywords' to generate the possible customization | 102 | Use `ruby-alignable-keywords' to generate the possible customization |
| 94 | choices. | 103 | choices. |
| 95 | (ruby-smie-rules): Instead of using a hardcoded list of alignable | 104 | (ruby-smie-rules): Instead of using a hardcoded list of alignable |
| 96 | keywords, check against the value of `ruby-alignable-keywords' | 105 | keywords, check against the value of `ruby-alignable-keywords' |
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index fa1574b0a88..51a4f5491b1 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el | |||
| @@ -152,7 +152,7 @@ directly. Instead, use `eldoc-add-command' and `eldoc-remove-command'.") | |||
| 152 | "Idle time delay currently in use by timer. | 152 | "Idle time delay currently in use by timer. |
| 153 | This is used to determine if `eldoc-idle-delay' is changed by the user.") | 153 | This is used to determine if `eldoc-idle-delay' is changed by the user.") |
| 154 | 154 | ||
| 155 | (defvar eldoc-message-function 'eldoc-minibuffer-message | 155 | (defvar eldoc-message-function #'eldoc-minibuffer-message |
| 156 | "The function used by `eldoc-message' to display messages. | 156 | "The function used by `eldoc-message' to display messages. |
| 157 | It should receive the same arguments as `message'.") | 157 | It should receive the same arguments as `message'.") |
| 158 | 158 | ||
| @@ -193,10 +193,7 @@ expression point is on." | |||
| 193 | (remove-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area t))) | 193 | (remove-hook 'pre-command-hook 'eldoc-pre-command-refresh-echo-area t))) |
| 194 | 194 | ||
| 195 | ;;;###autoload | 195 | ;;;###autoload |
| 196 | (defun turn-on-eldoc-mode () | 196 | (define-obsolete-function-alias 'turn-on-eldoc-mode 'eldoc-mode "24.4") |
| 197 | "Unequivocally turn on ElDoc mode (see command `eldoc-mode')." | ||
| 198 | (interactive) | ||
| 199 | (eldoc-mode 1)) | ||
| 200 | 197 | ||
| 201 | 198 | ||
| 202 | (defun eldoc-schedule-timer () | 199 | (defun eldoc-schedule-timer () |
| @@ -260,6 +257,10 @@ Otherwise work like `message'." | |||
| 260 | (omessage (funcall eldoc-message-function nil))))) | 257 | (omessage (funcall eldoc-message-function nil))))) |
| 261 | eldoc-last-message) | 258 | eldoc-last-message) |
| 262 | 259 | ||
| 260 | (defun eldoc--message-command-p (command) | ||
| 261 | (and (symbolp command) | ||
| 262 | (intern-soft (symbol-name command) eldoc-message-commands))) | ||
| 263 | |||
| 263 | ;; This function goes on pre-command-hook for XEmacs or when using idle | 264 | ;; This function goes on pre-command-hook for XEmacs or when using idle |
| 264 | ;; timers in Emacs. Motion commands clear the echo area for some reason, | 265 | ;; timers in Emacs. Motion commands clear the echo area for some reason, |
| 265 | ;; which make eldoc messages flicker or disappear just before motion | 266 | ;; which make eldoc messages flicker or disappear just before motion |
| @@ -268,10 +269,12 @@ Otherwise work like `message'." | |||
| 268 | ;; This doesn't seem to be required for Emacs 19.28 and earlier. | 269 | ;; This doesn't seem to be required for Emacs 19.28 and earlier. |
| 269 | (defun eldoc-pre-command-refresh-echo-area () | 270 | (defun eldoc-pre-command-refresh-echo-area () |
| 270 | (and eldoc-last-message | 271 | (and eldoc-last-message |
| 272 | (not (minibufferp)) ;We don't use the echo area when in minibuffer. | ||
| 271 | (if (and (eldoc-display-message-no-interference-p) | 273 | (if (and (eldoc-display-message-no-interference-p) |
| 272 | (symbolp this-command) | 274 | (eldoc--message-command-p this-command)) |
| 273 | (intern-soft (symbol-name this-command) eldoc-message-commands)) | ||
| 274 | (eldoc-message eldoc-last-message) | 275 | (eldoc-message eldoc-last-message) |
| 276 | ;; No need to call eldoc-message since the echo area will be cleared | ||
| 277 | ;; for us, but do note that the last-message will be gone. | ||
| 275 | (setq eldoc-last-message nil)))) | 278 | (setq eldoc-last-message nil)))) |
| 276 | 279 | ||
| 277 | ;; Decide whether now is a good time to display a message. | 280 | ;; Decide whether now is a good time to display a message. |
| @@ -281,10 +284,9 @@ Otherwise work like `message'." | |||
| 281 | ;; timer, we're still in the middle of executing a command, | 284 | ;; timer, we're still in the middle of executing a command, |
| 282 | ;; e.g. a query-replace where it would be annoying to | 285 | ;; e.g. a query-replace where it would be annoying to |
| 283 | ;; overwrite the echo area. | 286 | ;; overwrite the echo area. |
| 284 | (and (not this-command) | 287 | (not this-command) |
| 285 | (symbolp last-command) | 288 | (eldoc--message-command-p last-command))) |
| 286 | (intern-soft (symbol-name last-command) | 289 | |
| 287 | eldoc-message-commands)))) | ||
| 288 | 290 | ||
| 289 | ;; Check various conditions about the current environment that might make | 291 | ;; Check various conditions about the current environment that might make |
| 290 | ;; it undesirable to print eldoc messages right this instant. | 292 | ;; it undesirable to print eldoc messages right this instant. |
| @@ -313,7 +315,11 @@ Emacs Lisp mode) that support ElDoc.") | |||
| 313 | ;; This is run from post-command-hook or some idle timer thing, | 315 | ;; This is run from post-command-hook or some idle timer thing, |
| 314 | ;; so we need to be careful that errors aren't ignored. | 316 | ;; so we need to be careful that errors aren't ignored. |
| 315 | (with-demoted-errors "eldoc error: %s" | 317 | (with-demoted-errors "eldoc error: %s" |
| 316 | (and (eldoc-display-message-p) | 318 | (and (or (eldoc-display-message-p) |
| 319 | ;; Erase the last message if we won't display a new one. | ||
| 320 | (when eldoc-last-message | ||
| 321 | (eldoc-message nil) | ||
| 322 | nil)) | ||
| 317 | (if eldoc-documentation-function | 323 | (if eldoc-documentation-function |
| 318 | (eldoc-message (funcall eldoc-documentation-function)) | 324 | (eldoc-message (funcall eldoc-documentation-function)) |
| 319 | (let* ((current-symbol (eldoc-current-symbol)) | 325 | (let* ((current-symbol (eldoc-current-symbol)) |