summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2006-12-25 08:18:09 +0000
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2006-12-25 08:18:09 +0000
commitd3f4ab736a79aa886c6f744fcbe79b04edbec01f (patch)
tree499cdeabf7d71f4c97fdc54abb507cb2c57a6bb9 /lisp
parent92ad3e9f498c5c2adcc11503f46b09adf312227d (diff)
downloademacs-d3f4ab736a79aa886c6f744fcbe79b04edbec01f.tar.gz
emacs-d3f4ab736a79aa886c6f744fcbe79b04edbec01f.tar.bz2
emacs-d3f4ab736a79aa886c6f744fcbe79b04edbec01f.zip
(fancy-splash-last-input-event): New variable.
(fancy-splash-special-event-action): New function. (fancy-splash-screens): Temporarily bind special events to it. Execute command for saved special event before exiting from recursive editing.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/startup.el35
1 files changed, 33 insertions, 2 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index 8d1c254d7a1..1efbea5666e 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1205,6 +1205,7 @@ Values less than twice `fancy-splash-delay' are ignored."
(defvar fancy-splash-help-echo nil)
(defvar fancy-splash-stop-time nil)
(defvar fancy-splash-outer-buffer nil)
+(defvar fancy-splash-last-input-event nil)
(defun fancy-splash-insert (&rest args)
"Insert text into the current buffer, with faces.
@@ -1359,6 +1360,14 @@ mouse."
(push last-command-event unread-command-events))
(throw 'exit nil))
+(defun fancy-splash-special-event-action ()
+ "Save the last event and stop displaying the splash screen buffer.
+This is an internal function used to turn off the splash screen after
+the user caused an input event that is bound in `special-event-map'"
+ (interactive)
+ (setq fancy-splash-last-input-event last-input-event)
+ (throw 'exit nil))
+
(defun fancy-splash-screens (&optional hide-on-input)
"Display fancy splash screens when Emacs starts."
@@ -1368,6 +1377,7 @@ mouse."
splash-buffer
(old-minor-mode-map-alist minor-mode-map-alist)
(old-emulation-mode-map-alists emulation-mode-map-alists)
+ (old-special-event-map special-event-map)
(frame (fancy-splash-frame))
timer)
(save-selected-window
@@ -1383,6 +1393,20 @@ mouse."
(define-key map [t] 'fancy-splash-default-action)
(define-key map [mouse-movement] 'ignore)
(define-key map [mode-line t] 'ignore)
+ ;; Temporarily bind special events to
+ ;; fancy-splash-special-event-action so as to stop
+ ;; displaying splash screens with such events.
+ ;; Otherwise, drag-n-drop into splash screens may
+ ;; leave us in recursive editing with invisible
+ ;; cursors for a while.
+ (setq special-event-map (make-sparse-keymap))
+ (map-keymap
+ (lambda (key def)
+ (define-key special-event-map (vector key)
+ (if (eq def 'ignore)
+ 'ignore
+ 'fancy-splash-special-event-action)))
+ old-special-event-map)
(setq display-hourglass nil
minor-mode-map-alist nil
emulation-mode-map-alists nil
@@ -1399,8 +1423,15 @@ mouse."
(cancel-timer timer)
(setq display-hourglass old-hourglass
minor-mode-map-alist old-minor-mode-map-alist
- emulation-mode-map-alists old-emulation-mode-map-alists)
- (kill-buffer splash-buffer)))))
+ emulation-mode-map-alists old-emulation-mode-map-alists
+ special-event-map old-special-event-map)
+ (kill-buffer splash-buffer)
+ (when fancy-splash-last-input-event
+ (setq last-input-event fancy-splash-last-input-event
+ fancy-splash-last-input-event nil)
+ (command-execute (lookup-key special-event-map
+ (vector last-input-event))
+ nil (vector last-input-event) t))))))
;; If hide-on-input is nil, don't hide the buffer on input.
(if (or (window-minibuffer-p)
(window-dedicated-p (selected-window)))