Mercurial > emacs
comparison lisp/subr.el @ 108675:e3df298f4131
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:11:18 -0400 |
parents | 0706b3de1aa0 |
children | b36e6aac8cf2 |
comparison
equal
deleted
inserted
replaced
108674:11d22db7246f | 108675:e3df298f4131 |
---|---|
2205 ;; If the string end is off screen, recenter now. | 2205 ;; If the string end is off screen, recenter now. |
2206 (if (<= (window-end nil t) pos) | 2206 (if (<= (window-end nil t) pos) |
2207 (recenter (/ (window-height) 2)))) | 2207 (recenter (/ (window-height) 2)))) |
2208 (message (or message "Type %s to continue editing.") | 2208 (message (or message "Type %s to continue editing.") |
2209 (single-key-description exit-char)) | 2209 (single-key-description exit-char)) |
2210 (let (char) | 2210 (let ((event (read-event))) |
2211 (if (integerp exit-char) | 2211 ;; `exit-char' can be an event, or an event description list. |
2212 (condition-case nil | 2212 (or (eq event exit-char) |
2213 (progn | 2213 (eq event (event-convert-list exit-char)) |
2214 (setq char (read-char)) | 2214 (setq unread-command-events (list event))))) |
2215 (or (eq char exit-char) | |
2216 (setq unread-command-events (list char)))) | |
2217 (error | |
2218 ;; `exit-char' is a character, hence it differs | |
2219 ;; from char, which is an event. | |
2220 (setq unread-command-events (list char)))) | |
2221 ;; `exit-char' can be an event, or an event description list. | |
2222 (setq char (read-event)) | |
2223 (or (eq char exit-char) | |
2224 (eq char (event-convert-list exit-char)) | |
2225 (setq unread-command-events (list char)))))) | |
2226 (delete-overlay ol)))) | 2215 (delete-overlay ol)))) |
2227 | 2216 |
2228 | 2217 |
2229 ;;;; Overlay operations | 2218 ;;;; Overlay operations |
2230 | 2219 |