diff options
| author | YAMAMOTO Mitsuharu | 2008-03-29 00:48:57 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2008-03-29 00:48:57 +0000 |
| commit | d497bce3e76a5cd503908c967bc3bf42b622c0cc (patch) | |
| tree | e798aa38272544f11c69139d1cfe4e9d8330bdb7 | |
| parent | f3aa14f9b6cd9c808010ed3b952ce1997e675b43 (diff) | |
| download | emacs-d497bce3e76a5cd503908c967bc3bf42b622c0cc.tar.gz emacs-d497bce3e76a5cd503908c967bc3bf42b622c0cc.zip | |
(mac-ae-reopen-application): New function.
(mac-apple-event-map): Bind "reopen application" Apple event to it.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/term/mac-win.el | 19 |
2 files changed, 21 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 271a491e791..f105ab3a968 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-03-29 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 | |||
| 1 | 2008-03-29 Juanma Barranquero <lekktu@gmail.com> | 6 | 2008-03-29 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 7 | ||
| 3 | * term/mac-win.el (mac-dnd-drop-data): Remove redundant check. | 8 | * term/mac-win.el (mac-dnd-drop-data): Remove redundant check. |
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index d76af52f15f..c9c13c7814e 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el | |||
| @@ -1709,6 +1709,19 @@ in `selection-converter-alist', which see." | |||
| 1709 | (setq modifiers (cons (car modifier-mask) modifiers))))) | 1709 | (setq modifiers (cons (car modifier-mask) modifiers))))) |
| 1710 | modifiers)) | 1710 | modifiers)) |
| 1711 | 1711 | ||
| 1712 | (defun mac-ae-reopen-application (event) | ||
| 1713 | "Show some frame in response to the Apple event EVENT. | ||
| 1714 | The frame to be shown is chosen from visible or iconified frames | ||
| 1715 | if possible. If there's no such frame, a new frame is created." | ||
| 1716 | (interactive "e") | ||
| 1717 | (unless (frame-visible-p (selected-frame)) | ||
| 1718 | (let ((frame (or (car (visible-frame-list)) | ||
| 1719 | (car (filtered-frame-list 'frame-visible-p))))) | ||
| 1720 | (if frame | ||
| 1721 | (select-frame frame) | ||
| 1722 | (switch-to-buffer-other-frame "*scratch*")))) | ||
| 1723 | (select-frame-set-input-focus (selected-frame))) | ||
| 1724 | |||
| 1712 | (defun mac-ae-open-documents (event) | 1725 | (defun mac-ae-open-documents (event) |
| 1713 | "Open the documents specified by the Apple event EVENT." | 1726 | "Open the documents specified by the Apple event EVENT." |
| 1714 | (interactive "e") | 1727 | (interactive "e") |
| @@ -1765,9 +1778,9 @@ Currently the `mailto' scheme is supported." | |||
| 1765 | (define-key mac-apple-event-map [core-event open-application] 0) | 1778 | (define-key mac-apple-event-map [core-event open-application] 0) |
| 1766 | 1779 | ||
| 1767 | ;; Received when a dock or application icon is clicked and Emacs is | 1780 | ;; Received when a dock or application icon is clicked and Emacs is |
| 1768 | ;; already running. Simply ignored. Another idea is to make a new | 1781 | ;; already running. |
| 1769 | ;; frame if all frames are invisible. | 1782 | (define-key mac-apple-event-map [core-event reopen-application] |
| 1770 | (define-key mac-apple-event-map [core-event reopen-application] 'ignore) | 1783 | 'mac-ae-reopen-application) |
| 1771 | 1784 | ||
| 1772 | (define-key mac-apple-event-map [core-event open-documents] | 1785 | (define-key mac-apple-event-map [core-event open-documents] |
| 1773 | 'mac-ae-open-documents) | 1786 | 'mac-ae-open-documents) |