1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-21 18:23:59 +00:00

(mac-ae-reopen-application): New function.

(mac-apple-event-map): Bind "reopen application" Apple event to it.
This commit is contained in:
YAMAMOTO Mitsuharu 2007-08-10 10:13:44 +00:00
parent ad3b3e0253
commit b16f162d31
2 changed files with 21 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2007-08-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* term/mac-win.el (mac-ae-reopen-application): New function.
(mac-apple-event-map): Bind "reopen application" Apple event to it.
2007-08-10 Stefan Monnier <monnier@iro.umontreal.ca>
* textmodes/tex-mode.el (tex-font-lock-unfontify-region): Fix to

View File

@ -1710,6 +1710,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")
@ -1766,9 +1779,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)