changeset 102888:377ae1928153

(msdos-last-help-message): New defvar. (msdos-show-help): Use it to avoid saving the last message if it was also a help message (Bug#2895).
author Eli Zaretskii <eliz@gnu.org>
date Wed, 08 Apr 2009 13:49:53 +0000
parents 16fb33cc1bdb
children dccc80becf9d
files lisp/term/pc-win.el
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/pc-win.el	Wed Apr 08 12:43:40 2009 +0000
+++ b/lisp/term/pc-win.el	Wed Apr 08 13:49:53 2009 +0000
@@ -248,23 +248,30 @@
 (fset 'set-cursor-color 'ignore)	; Hardware determined by char under.
 (fset 'set-border-color 'ignore)	; Not useful.
 
+(defvar msdos-last-help-message nil
+  "The last help message received via `show-help-function'.
+This is used by `msdos-show-help'.")
+
 (defvar msdos-previous-message nil
   "The content of the echo area before help echo was displayed.")
 
 (defun msdos-show-help (help)
   "Function installed as `show-help-function' on MS-DOS frames."
   (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.
     (cond
      ((stringp help)
-      (unless msdos-previous-message
+      (setq help (replace-regexp-in-string "\n" ", " help))
+      (unless (or msdos-previous-message
+		  (string-equal help (current-message))
+		  (and (stringp msdos-last-help-message)
+		       (string-equal msdos-last-help-message
+				     (current-message))))
         (setq msdos-previous-message (current-message)))
+      (setq msdos-last-help-message help)
       (let ((message-truncate-lines nil)
             (message-log-max nil))
-        (message "%s" (replace-regexp-in-string "\n" ", " help))))
+        (message "%s" help)))
      ((stringp msdos-previous-message)
       (let ((message-log-max nil))
         (message "%s" msdos-previous-message)