summaryrefslogtreecommitdiff
path: root/lisp/term/mac-win.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-08-13 13:48:35 +0000
committerMiles Bader <miles@gnu.org>2007-08-13 13:48:35 +0000
commitb2e6b10fe2d40020a75ab0025af98a4abf339cd2 (patch)
treedb265e5ea93cdc13f8e3b54ed5c7ad2869d50ec9 /lisp/term/mac-win.el
parent905350bef3ebc514a418658dd155c1d062664b56 (diff)
parent37cc095b6a175fb5a2fb18fa029eaf3aa3b3fa53 (diff)
downloademacs-b2e6b10fe2d40020a75ab0025af98a4abf339cd2.tar.gz
emacs-b2e6b10fe2d40020a75ab0025af98a4abf339cd2.tar.bz2
emacs-b2e6b10fe2d40020a75ab0025af98a4abf339cd2.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 846-851) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 88-92) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 242-244) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-246
Diffstat (limited to 'lisp/term/mac-win.el')
-rw-r--r--lisp/term/mac-win.el19
1 files changed, 16 insertions, 3 deletions
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index af4c7e29525..6d3d4de11e3 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1760,6 +1760,19 @@ in `selection-converter-alist', which see."
(setq modifiers (cons (car modifier-mask) modifiers)))))
modifiers))
+(defun mac-ae-reopen-application (event)
+ "Show some frame in response to the Apple event EVENT.
+The frame to be shown is chosen from visible or iconified frames
+if possible. If there's no such frame, a new frame is created."
+ (interactive "e")
+ (unless (frame-visible-p (selected-frame))
+ (let ((frame (or (car (visible-frame-list))
+ (car (filtered-frame-list 'frame-visible-p)))))
+ (if frame
+ (select-frame frame)
+ (switch-to-buffer-other-frame "*scratch*"))))
+ (select-frame-set-input-focus (selected-frame)))
+
(defun mac-ae-open-documents (event)
"Open the documents specified by the Apple event EVENT."
(interactive "e")
@@ -1816,9 +1829,9 @@ Currently the `mailto' scheme is supported."
(define-key mac-apple-event-map [core-event open-application] 0)
;; Received when a dock or application icon is clicked and Emacs is
-;; already running. Simply ignored. Another idea is to make a new
-;; frame if all frames are invisible.
-(define-key mac-apple-event-map [core-event reopen-application] 'ignore)
+;; already running.
+(define-key mac-apple-event-map [core-event reopen-application]
+ 'mac-ae-reopen-application)
(define-key mac-apple-event-map [core-event open-documents]
'mac-ae-open-documents)