aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2007-08-10 10:13:44 +0000
committerYAMAMOTO Mitsuharu2007-08-10 10:13:44 +0000
commitb16f162d31dec941cdfcee16a189c07f3688dc6a (patch)
tree09e774d188030349991956087a10237b2a4aaeb5 /lisp
parentad3b3e025329160e992fba7e805c2339f581e19e (diff)
downloademacs-b16f162d31dec941cdfcee16a189c07f3688dc6a.tar.gz
emacs-b16f162d31dec941cdfcee16a189c07f3688dc6a.zip
(mac-ae-reopen-application): New function.
(mac-apple-event-map): Bind "reopen application" Apple event to it.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/term/mac-win.el19
2 files changed, 21 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 35f5480f480..44a4ff3a88e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12007-08-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * term/mac-win.el (mac-ae-reopen-application): New function.
4 (mac-apple-event-map): Bind "reopen application" Apple event to it.
5
12007-08-10 Stefan Monnier <monnier@iro.umontreal.ca> 62007-08-10 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * textmodes/tex-mode.el (tex-font-lock-unfontify-region): Fix to 8 * textmodes/tex-mode.el (tex-font-lock-unfontify-region): Fix to
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 3fb07dd004a..44f8f70a252 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1710,6 +1710,19 @@ in `selection-converter-alist', which see."
1710 (setq modifiers (cons (car modifier-mask) modifiers))))) 1710 (setq modifiers (cons (car modifier-mask) modifiers)))))
1711 modifiers)) 1711 modifiers))
1712 1712
1713(defun mac-ae-reopen-application (event)
1714 "Show some frame in response to the Apple event EVENT.
1715The frame to be shown is chosen from visible or iconified frames
1716if possible. If there's no such frame, a new frame is created."
1717 (interactive "e")
1718 (unless (frame-visible-p (selected-frame))
1719 (let ((frame (or (car (visible-frame-list))
1720 (car (filtered-frame-list 'frame-visible-p)))))
1721 (if frame
1722 (select-frame frame)
1723 (switch-to-buffer-other-frame "*scratch*"))))
1724 (select-frame-set-input-focus (selected-frame)))
1725
1713(defun mac-ae-open-documents (event) 1726(defun mac-ae-open-documents (event)
1714 "Open the documents specified by the Apple event EVENT." 1727 "Open the documents specified by the Apple event EVENT."
1715 (interactive "e") 1728 (interactive "e")
@@ -1766,9 +1779,9 @@ Currently the `mailto' scheme is supported."
1766(define-key mac-apple-event-map [core-event open-application] 0) 1779(define-key mac-apple-event-map [core-event open-application] 0)
1767 1780
1768;; Received when a dock or application icon is clicked and Emacs is 1781;; Received when a dock or application icon is clicked and Emacs is
1769;; already running. Simply ignored. Another idea is to make a new 1782;; already running.
1770;; frame if all frames are invisible. 1783(define-key mac-apple-event-map [core-event reopen-application]
1771(define-key mac-apple-event-map [core-event reopen-application] 'ignore) 1784 'mac-ae-reopen-application)
1772 1785
1773(define-key mac-apple-event-map [core-event open-documents] 1786(define-key mac-apple-event-map [core-event open-documents]
1774 'mac-ae-open-documents) 1787 'mac-ae-open-documents)