comparison lisp/subr.el @ 107329:4e1ca27d938e

Close bug#5670 with patch from ?t?pn N?mec <stepnem at gmail.com>. * subr.el (momentary-string-display): Don't overwrite the MESSAGE argument with a local variable. (Bug#5670)
author Glenn Morris <rgm@gnu.org>
date Tue, 02 Mar 2010 19:58:26 -0800
parents 79d3f11c8368
children 954352cc49bd 1d43618b7e72
comparison
equal deleted inserted replaced
107328:11f018190d5c 107329:4e1ca27d938e
2194 input (as a command if nothing else). 2194 input (as a command if nothing else).
2195 Display MESSAGE (optional fourth arg) in the echo area. 2195 Display MESSAGE (optional fourth arg) in the echo area.
2196 If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." 2196 If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there."
2197 (or exit-char (setq exit-char ?\s)) 2197 (or exit-char (setq exit-char ?\s))
2198 (let ((ol (make-overlay pos pos)) 2198 (let ((ol (make-overlay pos pos))
2199 (message (copy-sequence string))) 2199 (str (copy-sequence string)))
2200 (unwind-protect 2200 (unwind-protect
2201 (progn 2201 (progn
2202 (save-excursion 2202 (save-excursion
2203 (overlay-put ol 'after-string message) 2203 (overlay-put ol 'after-string str)
2204 (goto-char pos) 2204 (goto-char pos)
2205 ;; To avoid trouble with out-of-bounds position 2205 ;; To avoid trouble with out-of-bounds position
2206 (setq pos (point)) 2206 (setq pos (point))
2207 ;; If the message end is off screen, recenter now. 2207 ;; If the string end is off screen, recenter now.
2208 (if (<= (window-end nil t) pos) 2208 (if (<= (window-end nil t) pos)
2209 (recenter (/ (window-height) 2)))) 2209 (recenter (/ (window-height) 2))))
2210 (message (or message "Type %s to continue editing.") 2210 (message (or message "Type %s to continue editing.")
2211 (single-key-description exit-char)) 2211 (single-key-description exit-char))
2212 (let (char) 2212 (let (char)