[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#5670: Bug in `momentary-string-display'

From: Štěpán Němec
Subject: bug#5670: Bug in `momentary-string-display'
Date: Tue, 2 Mar 2010 00:52:23 +0100
User-agent: Mutt/1.5.20 (2009-08-27)

Let binding of `message' inside the function shadows one of the
arguments, leading to the momentarily inserted string (instead of the
message) being displayed in the echo area.

The patch below fixes that.

--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2196,15 +2196,15 @@ Display MESSAGE (optional fourth arg) in the echo area.
 If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there."
   (or exit-char (setq exit-char ?\s))
   (let ((ol (make-overlay pos pos))
-        (message (copy-sequence string)))
+        (str (copy-sequence string)))
-            (overlay-put ol 'after-string message)
+            (overlay-put ol 'after-string str)
             (goto-char pos)
             ;; To avoid trouble with out-of-bounds position
             (setq pos (point))
-            ;; If the message end is off screen, recenter now.
+            ;; If the string end is off screen, recenter now.
             (if (<= (window-end nil t) pos)
                 (recenter (/ (window-height) 2))))
           (message (or message "Type %s to continue editing.")

reply via email to

[Prev in Thread] Current Thread [Next in Thread]