]> git.eshelyaron.com Git - emacs.git/commitdiff
* tooltip.el (tooltip-show-help-non-mode): Don't save the last
authorChong Yidong <cyd@stupidchicken.com>
Mon, 6 Apr 2009 23:52:41 +0000 (23:52 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Mon, 6 Apr 2009 23:52:41 +0000 (23:52 +0000)
message if it was also a help message (Bug#2895).

lisp/ChangeLog
lisp/tooltip.el

index 7639ed724bde2749dcc719af4cae22f48716f65a..37e9a9284cfeb26aac79a3df90ce589fc8a8878d 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-06  Chong Yidong  <cyd@stupidchicken.com>
+
+       * tooltip.el (tooltip-show-help-non-mode): Don't save the last
+       message if it was also a help message (Bug#2895).
+
 2009-04-06  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
 
        * textmodes/bibtex.el (bibtex-format-entry)
index b7883a02049811452a6cc66787cb70312fab5a9d..918c955dfafcc500ddc87486fdaaa52c83a8b57c 100644 (file)
@@ -319,7 +319,9 @@ the buffer of PROCESS."
 ;;; Tooltip help.
 
 (defvar tooltip-help-message nil
-  "The last help message received via `tooltip-show-help'.")
+  "The last help message received via `show-help-function'.
+This is used by `tooltip-show-help' and
+`tooltip-show-help-non-mode'.")
 
 (defvar tooltip-previous-message nil
   "The previous content of the echo area.")
@@ -327,16 +329,17 @@ the buffer of PROCESS."
 (defun tooltip-show-help-non-mode (help)
   "Function installed as `show-help-function' when tooltip is off."
   (when (and (not (window-minibuffer-p)) ;Don't overwrite minibuffer contents.
-             ;; Don't know how to reproduce it in Elisp:
-             ;; Don't overwrite a keystroke echo.
-             ;; (NILP (echo_message_buffer) || ok_to_overwrite_keystroke_echo)
-             (not cursor-in-echo-area)) ;Don't overwrite a prompt.
+             (not cursor-in-echo-area))  ;Don't overwrite a prompt.
     (cond
      ((stringp help)
       (setq help (replace-regexp-in-string "\n" ", " help))
       (unless (or tooltip-previous-message
-                 (string-equal help (current-message)))
+                 (string-equal help (current-message))
+                 (and (stringp tooltip-help-message)
+                      (string-equal tooltip-help-message
+                                    (current-message))))
         (setq tooltip-previous-message (current-message)))
+      (setq tooltip-help-message help)
       (let ((message-truncate-lines t)
             (message-log-max nil))
         (message "%s" help)))