Mercurial > emacs
comparison lisp/term/mac-win.el @ 75831:906e93bebe5f
Change all uses of
mac-set-font-panel-visibility to mac-set-font-panel-visible-p.
(mac-ae-number): Return integer 0 if coerced result is float 0.0.
(mac-ae-get-url): Call select-frame-set-input-focus.
(mac-dnd-handle-drag-n-drop-event): Don't call
select-frame-set-input-focus.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Tue, 13 Feb 2007 08:27:47 +0000 |
parents | 2d3bcf670390 |
children | 5e0f43a8e936 07774e5c3ff5 52a7f3f50b89 |
comparison
equal
deleted
inserted
replaced
75830:de1ac66b39ff | 75831:906e93bebe5f |
---|---|
1583 (let ((type-data (mac-ae-parameter ae keyword)) | 1583 (let ((type-data (mac-ae-parameter ae keyword)) |
1584 str) | 1584 str) |
1585 (if (and type-data | 1585 (if (and type-data |
1586 (setq str (mac-coerce-ae-data (car type-data) | 1586 (setq str (mac-coerce-ae-data (car type-data) |
1587 (cdr type-data) "TEXT"))) | 1587 (cdr type-data) "TEXT"))) |
1588 (string-to-number str) | 1588 (let ((num (string-to-number str))) |
1589 ;; Mac OS Classic may return "0e+0" as the coerced value for | |
1590 ;; the type "magn" and the data "\000\000\000\000". | |
1591 (if (= num 0.0) 0 num)) | |
1589 nil))) | 1592 nil))) |
1590 | 1593 |
1591 (defun mac-bytes-to-integer (bytes &optional from to) | 1594 (defun mac-bytes-to-integer (bytes &optional from to) |
1592 (or from (setq from 0)) | 1595 (or from (setq from 0)) |
1593 (or to (setq to (length bytes))) | 1596 (or to (setq to (length bytes))) |
1748 Currently the `mailto' scheme is supported." | 1751 Currently the `mailto' scheme is supported." |
1749 (interactive "e") | 1752 (interactive "e") |
1750 (let* ((ae (mac-event-ae event)) | 1753 (let* ((ae (mac-event-ae event)) |
1751 (parsed-url (url-generic-parse-url (mac-ae-text ae)))) | 1754 (parsed-url (url-generic-parse-url (mac-ae-text ae)))) |
1752 (if (string= (url-type parsed-url) "mailto") | 1755 (if (string= (url-type parsed-url) "mailto") |
1753 (url-mailto parsed-url) | 1756 (progn |
1757 (url-mailto parsed-url) | |
1758 (select-frame-set-input-focus (selected-frame))) | |
1754 (mac-resume-apple-event ae t)))) | 1759 (mac-resume-apple-event ae t)))) |
1755 | 1760 |
1756 (setq mac-apple-event-map (make-sparse-keymap)) | 1761 (setq mac-apple-event-map (make-sparse-keymap)) |
1757 | 1762 |
1758 ;; Received when Emacs is launched without associated documents. | 1763 ;; Received when Emacs is launched without associated documents. |
1794 ;; kEventClassWindow/kEventWindowToolbarSwitchMode | 1799 ;; kEventClassWindow/kEventWindowToolbarSwitchMode |
1795 (define-key mac-apple-event-map [window toolbar-switch-mode] | 1800 (define-key mac-apple-event-map [window toolbar-switch-mode] |
1796 'mac-handle-toolbar-switch-mode) | 1801 'mac-handle-toolbar-switch-mode) |
1797 | 1802 |
1798 ;;; Font panel | 1803 ;;; Font panel |
1799 (when (fboundp 'mac-set-font-panel-visibility) | 1804 (when (fboundp 'mac-set-font-panel-visible-p) |
1800 | 1805 |
1801 (define-minor-mode mac-font-panel-mode | 1806 (define-minor-mode mac-font-panel-mode |
1802 "Toggle use of the font panel. | 1807 "Toggle use of the font panel. |
1803 With numeric ARG, display the font panel if and only if ARG is positive." | 1808 With numeric ARG, display the font panel if and only if ARG is positive." |
1804 :init-value nil | 1809 :init-value nil |
1805 :global t | 1810 :global t |
1806 :group 'mac | 1811 :group 'mac |
1807 (mac-set-font-panel-visibility mac-font-panel-mode)) | 1812 (mac-set-font-panel-visible-p mac-font-panel-mode)) |
1808 | 1813 |
1809 (defun mac-handle-font-panel-closed (event) | 1814 (defun mac-handle-font-panel-closed (event) |
1810 "Update internal status in response to font panel closed EVENT." | 1815 "Update internal status in response to font panel closed EVENT." |
1811 (interactive "e") | 1816 (interactive "e") |
1812 ;; Synchronize with the minor mode variable. | 1817 ;; Synchronize with the minor mode variable. |
1837 (menu-bar-make-mm-toggle mac-font-panel-mode | 1842 (menu-bar-make-mm-toggle mac-font-panel-mode |
1838 "Font Panel" | 1843 "Font Panel" |
1839 "Show the font panel as a floating dialog") | 1844 "Show the font panel as a floating dialog") |
1840 'showhide-speedbar) | 1845 'showhide-speedbar) |
1841 | 1846 |
1842 ) ;; (fboundp 'mac-set-font-panel-visibility) | 1847 ) ;; (fboundp 'mac-set-font-panel-visible-p) |
1843 | 1848 |
1844 ;;; Text Services | 1849 ;;; Text Services |
1845 (defvar mac-ts-active-input-buf "" | 1850 (defvar mac-ts-active-input-buf "" |
1846 "Byte sequence of the current Mac TSM active input area.") | 1851 "Byte sequence of the current Mac TSM active input area.") |
1847 (defvar mac-ts-update-active-input-area-seqno 0 | 1852 (defvar mac-ts-update-active-input-area-seqno 0 |
2271 (if (memq 'option (mac-ae-keyboard-modifiers ae)) | 2276 (if (memq 'option (mac-ae-keyboard-modifiers ae)) |
2272 (setq action 'copy)) | 2277 (setq action 'copy)) |
2273 (dolist (item (mac-ae-list ae)) | 2278 (dolist (item (mac-ae-list ae)) |
2274 (if (not (equal (car item) "null")) | 2279 (if (not (equal (car item) "null")) |
2275 (mac-dnd-drop-data event (selected-frame) window | 2280 (mac-dnd-drop-data event (selected-frame) window |
2276 (cdr item) (car item) action)))) | 2281 (cdr item) (car item) action))))) |
2277 (select-frame-set-input-focus (selected-frame))) | |
2278 | 2282 |
2279 ;;; Do the actual Windows setup here; the above code just defines | 2283 ;;; Do the actual Windows setup here; the above code just defines |
2280 ;;; functions and variables that we use now. | 2284 ;;; functions and variables that we use now. |
2281 | 2285 |
2282 (setq command-line-args (x-handle-args command-line-args)) | 2286 (setq command-line-args (x-handle-args command-line-args)) |