aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2007-01-15 08:10:22 +0000
committerYAMAMOTO Mitsuharu2007-01-15 08:10:22 +0000
commit025a24b5bcc2c70a28ed208b45cdb7bfc1d6d7a1 (patch)
tree736f6855562f95a18737c465ee371a154663ace4
parent00d972ebb6253b3f32732cd7b5d202252100b9bf (diff)
downloademacs-025a24b5bcc2c70a28ed208b45cdb7bfc1d6d7a1.tar.gz
emacs-025a24b5bcc2c70a28ed208b45cdb7bfc1d6d7a1.zip
(mac-ae-quit-application): New function.
(mac-apple-event-map): Bind "quit application" Apple event to it.
-rw-r--r--lisp/term/mac-win.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 3ba38680989..db07315fe84 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1714,6 +1714,15 @@ in `selection-converter-alist', which see."
1714 nil t))))) 1714 nil t)))))
1715 (select-frame-set-input-focus (selected-frame))) 1715 (select-frame-set-input-focus (selected-frame)))
1716 1716
1717(defun mac-ae-quit-application (event)
1718 "Quit the application Emacs with the Apple event EVENT."
1719 (interactive "e")
1720 (let ((ae (mac-event-ae event)))
1721 (unwind-protect
1722 (save-buffers-kill-emacs)
1723 ;; Reaches here if the user has canceled the quit.
1724 (mac-resume-apple-event ae -128)))) ; userCanceledErr
1725
1717(defun mac-ae-get-url (event) 1726(defun mac-ae-get-url (event)
1718 "Open the URL specified by the Apple event EVENT. 1727 "Open the URL specified by the Apple event EVENT.
1719Currently the `mailto' scheme is supported." 1728Currently the `mailto' scheme is supported."
@@ -1740,7 +1749,7 @@ Currently the `mailto' scheme is supported."
1740 'mac-ae-open-documents) 1749 'mac-ae-open-documents)
1741(define-key mac-apple-event-map [core-event show-preferences] 'customize) 1750(define-key mac-apple-event-map [core-event show-preferences] 'customize)
1742(define-key mac-apple-event-map [core-event quit-application] 1751(define-key mac-apple-event-map [core-event quit-application]
1743 'save-buffers-kill-emacs) 1752 'mac-ae-quit-application)
1744 1753
1745(define-key mac-apple-event-map [internet-event get-url] 'mac-ae-get-url) 1754(define-key mac-apple-event-map [internet-event get-url] 'mac-ae-get-url)
1746 1755