Mercurial > emacs
comparison lisp/subr.el @ 108835:2f74da21b147
Fix for momentary-string-display (Bug#6238).
* lisp/subr.el (momentary-string-display): Just use read-event to read
the exit event (Bug#6238).
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Mon, 31 May 2010 10:13:41 -0400 |
parents | 8aaae2681a62 |
children | c2ac5cece5ea |
comparison
equal
deleted
inserted
replaced
108834:91c7e7b1d29a | 108835:2f74da21b147 |
---|---|
2202 ;; If the string end is off screen, recenter now. | 2202 ;; If the string end is off screen, recenter now. |
2203 (if (<= (window-end nil t) pos) | 2203 (if (<= (window-end nil t) pos) |
2204 (recenter (/ (window-height) 2)))) | 2204 (recenter (/ (window-height) 2)))) |
2205 (message (or message "Type %s to continue editing.") | 2205 (message (or message "Type %s to continue editing.") |
2206 (single-key-description exit-char)) | 2206 (single-key-description exit-char)) |
2207 (let (char) | 2207 (let ((event (read-event))) |
2208 (if (integerp exit-char) | 2208 ;; `exit-char' can be an event, or an event description list. |
2209 (condition-case nil | 2209 (or (eq event exit-char) |
2210 (progn | 2210 (eq event (event-convert-list exit-char)) |
2211 (setq char (read-char)) | 2211 (setq unread-command-events (list event))))) |
2212 (or (eq char exit-char) | |
2213 (setq unread-command-events (list char)))) | |
2214 (error | |
2215 ;; `exit-char' is a character, hence it differs | |
2216 ;; from char, which is an event. | |
2217 (setq unread-command-events (list char)))) | |
2218 ;; `exit-char' can be an event, or an event description list. | |
2219 (setq char (read-event)) | |
2220 (or (eq char exit-char) | |
2221 (eq char (event-convert-list exit-char)) | |
2222 (setq unread-command-events (list char)))))) | |
2223 (delete-overlay ol)))) | 2212 (delete-overlay ol)))) |
2224 | 2213 |
2225 | 2214 |
2226 ;;;; Overlay operations | 2215 ;;;; Overlay operations |
2227 | 2216 |