Mercurial > emacs
comparison lisp/term/mac-win.el @ 70559:a1af34eacdb3
(mac-font-panel-mode): Doc fix.
(mac-service-selection, mac-service-open-file)
(mac-service-open-selection, mac-service-mail-selection)
(mac-service-mail-to, mac-service-insert-text): Rename from
mac-services-*. All uses changed.
(mac-apple-event-map): Rename event symbol `services' to `service'.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Wed, 10 May 2006 08:22:39 +0000 |
parents | 1ceca94285a6 |
children | 3cbb04c6169f b6689e223e2f 146cd8369025 |
comparison
equal
deleted
inserted
replaced
70558:9551c95334c7 | 70559:a1af34eacdb3 |
---|---|
77 (require 'fontset) | 77 (require 'fontset) |
78 (require 'dnd) | 78 (require 'dnd) |
79 (eval-when-compile (require 'url)) | 79 (eval-when-compile (require 'url)) |
80 | 80 |
81 (defvar mac-charset-info-alist) | 81 (defvar mac-charset-info-alist) |
82 (defvar mac-services-selection) | 82 (defvar mac-service-selection) |
83 (defvar mac-system-script-code) | 83 (defvar mac-system-script-code) |
84 (defvar mac-apple-event-map) | 84 (defvar mac-apple-event-map) |
85 (defvar mac-atsu-font-table) | 85 (defvar mac-atsu-font-table) |
86 (defvar mac-font-panel-mode) | 86 (defvar mac-font-panel-mode) |
87 (defvar x-invocation-args) | 87 (defvar x-invocation-args) |
1711 ;;; Font panel | 1711 ;;; Font panel |
1712 (when (fboundp 'mac-set-font-panel-visibility) | 1712 (when (fboundp 'mac-set-font-panel-visibility) |
1713 | 1713 |
1714 (define-minor-mode mac-font-panel-mode | 1714 (define-minor-mode mac-font-panel-mode |
1715 "Toggle use of the font panel. | 1715 "Toggle use of the font panel. |
1716 With numeric ARG, display the panel bar if and only if ARG is positive." | 1716 With numeric ARG, display the font panel if and only if ARG is positive." |
1717 :init-value nil | 1717 :init-value nil |
1718 :global t | 1718 :global t |
1719 :group 'mac | 1719 :group 'mac |
1720 (mac-set-font-panel-visibility mac-font-panel-mode)) | 1720 (mac-set-font-panel-visibility mac-font-panel-mode)) |
1721 | 1721 |
1751 'showhide-speedbar) | 1751 'showhide-speedbar) |
1752 | 1752 |
1753 ) ;; (fboundp 'mac-set-font-panel-visibility) | 1753 ) ;; (fboundp 'mac-set-font-panel-visibility) |
1754 | 1754 |
1755 ;;; Services | 1755 ;;; Services |
1756 (defun mac-services-open-file () | 1756 (defun mac-service-open-file () |
1757 "Open the file specified by the selection value for Services." | 1757 "Open the file specified by the selection value for Services." |
1758 (interactive) | 1758 (interactive) |
1759 (find-file-existing (x-selection-value mac-services-selection))) | 1759 (find-file-existing (x-selection-value mac-service-selection))) |
1760 | 1760 |
1761 (defun mac-services-open-selection () | 1761 (defun mac-service-open-selection () |
1762 "Create a new buffer containing the selection value for Services." | 1762 "Create a new buffer containing the selection value for Services." |
1763 (interactive) | 1763 (interactive) |
1764 (switch-to-buffer (generate-new-buffer "*untitled*")) | 1764 (switch-to-buffer (generate-new-buffer "*untitled*")) |
1765 (insert (x-selection-value mac-services-selection)) | 1765 (insert (x-selection-value mac-service-selection)) |
1766 (sit-for 0) | 1766 (sit-for 0) |
1767 (save-buffer) ; It pops up the save dialog. | 1767 (save-buffer) ; It pops up the save dialog. |
1768 ) | 1768 ) |
1769 | 1769 |
1770 (defun mac-services-mail-selection () | 1770 (defun mac-service-mail-selection () |
1771 "Prepare a mail buffer containing the selection value for Services." | 1771 "Prepare a mail buffer containing the selection value for Services." |
1772 (interactive) | 1772 (interactive) |
1773 (compose-mail) | 1773 (compose-mail) |
1774 (rfc822-goto-eoh) | 1774 (rfc822-goto-eoh) |
1775 (forward-line 1) | 1775 (forward-line 1) |
1776 (insert (x-selection-value mac-services-selection) "\n")) | 1776 (insert (x-selection-value mac-service-selection) "\n")) |
1777 | 1777 |
1778 (defun mac-services-mail-to () | 1778 (defun mac-service-mail-to () |
1779 "Prepare a mail buffer to be sent to the selection value for Services." | 1779 "Prepare a mail buffer to be sent to the selection value for Services." |
1780 (interactive) | 1780 (interactive) |
1781 (compose-mail (x-selection-value mac-services-selection))) | 1781 (compose-mail (x-selection-value mac-service-selection))) |
1782 | 1782 |
1783 (defun mac-services-insert-text () | 1783 (defun mac-service-insert-text () |
1784 "Insert the selection value for Services." | 1784 "Insert the selection value for Services." |
1785 (interactive) | 1785 (interactive) |
1786 (let ((text (x-selection-value mac-services-selection))) | 1786 (let ((text (x-selection-value mac-service-selection))) |
1787 (if (not buffer-read-only) | 1787 (if (not buffer-read-only) |
1788 (insert text) | 1788 (insert text) |
1789 (kill-new text) | 1789 (kill-new text) |
1790 (message | 1790 (message |
1791 (substitute-command-keys | 1791 (substitute-command-keys |
1792 "The text from the Services menu can be accessed with \\[yank]"))))) | 1792 "The text from the Services menu can be accessed with \\[yank]"))))) |
1793 | 1793 |
1794 (define-key mac-apple-event-map [services paste] 'mac-services-insert-text) | 1794 ;; kEventClassService/kEventServicePaste |
1795 (define-key mac-apple-event-map [services perform open-file] | 1795 (define-key mac-apple-event-map [service paste] 'mac-service-insert-text) |
1796 'mac-services-open-file) | 1796 ;; kEventClassService/kEventServicePerform |
1797 (define-key mac-apple-event-map [services perform open-selection] | 1797 (define-key mac-apple-event-map [service perform open-file] |
1798 'mac-services-open-selection) | 1798 'mac-service-open-file) |
1799 (define-key mac-apple-event-map [services perform mail-selection] | 1799 (define-key mac-apple-event-map [service perform open-selection] |
1800 'mac-services-mail-selection) | 1800 'mac-service-open-selection) |
1801 (define-key mac-apple-event-map [services perform mail-to] | 1801 (define-key mac-apple-event-map [service perform mail-selection] |
1802 'mac-services-mail-to) | 1802 'mac-service-mail-selection) |
1803 (define-key mac-apple-event-map [service perform mail-to] | |
1804 'mac-service-mail-to) | |
1803 | 1805 |
1804 (defun mac-dispatch-apple-event (event) | 1806 (defun mac-dispatch-apple-event (event) |
1805 "Dispatch EVENT according to the keymap `mac-apple-event-map'." | 1807 "Dispatch EVENT according to the keymap `mac-apple-event-map'." |
1806 (interactive "e") | 1808 (interactive "e") |
1807 (let* ((binding (lookup-key mac-apple-event-map (mac-event-spec event))) | 1809 (let* ((binding (lookup-key mac-apple-event-map (mac-event-spec event))) |