From: Eli Zaretskii Date: Wed, 8 Apr 2009 13:51:48 +0000 (+0000) Subject: (msdos-last-help-message): New defvar. X-Git-Tag: emacs-pretest-23.0.93~197 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9993f59a8583c0934913c76618b39429dbbca285;p=emacs.git (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). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d4cdf2257c8..33b315367ba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2009-04-08 Eli Zaretskii + * term/pc-win.el (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). + * mail/rmail.el (rmail-simplified-subject): Normalize whitespace in subject. This resurrects a feature, lost in transition to mbox, whereby Subject is matched even if it's broken into several diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el index b0e62b1596c..6fb714c1412 100644 --- a/lisp/term/pc-win.el +++ b/lisp/term/pc-win.el @@ -248,23 +248,30 @@ support other types of selections." (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)