Changeset 4091 for trunk/lisp/term/mac-win.el
- Timestamp:
- 2006年05月27日 10時35分24秒 (2 years ago)
- Files:
-
- trunk/lisp/term/mac-win.el (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/term/mac-win.el
r4079 r4091 1586 1586 result))) 1587 1587 1588 (defun mac-bytes-to-digits (bytes &optional from to)1589 (or from (setq from 0))1590 (or to (setq to (length bytes)))1591 (let ((len (- to from))1592 (val 0.0))1593 (dotimes (i len)1594 (setq val (+ (* val 256.0)1595 (aref bytes (+ from (if (eq (byteorder) ?B) i1596 (- len i 1)))))))1597 (format "%.0f" val)))1598 1599 1588 (defun mac-ae-selection-range (ae) 1600 1589 ;; #pragma options align=mac68k … … 1628 1617 (dolist (file-name (mac-ae-list ae nil 'undecoded-file-name)) 1629 1618 (if file-name 1630 (dnd-open-local-file (concat "file:" file-name) nil))) 1619 (dnd-open-local-file 1620 (concat "file://" 1621 (mapconcat 'url-hexify-string 1622 (split-string file-name "/") "/")) nil))) 1631 1623 (let ((selection-range (mac-ae-selection-range ae)) 1632 1624 (search-text (mac-ae-text-for-search ae))) … … 1658 1650 (if (string= (url-type parsed-url) "mailto") 1659 1651 (url-mailto parsed-url) 1660 ( error "Unsupported URL scheme: %s" (url-type parsed-url)))))1652 (mac-resume-apple-event ae t)))) 1661 1653 1662 1654 (setq mac-apple-event-map (make-sparse-keymap)) … … 1694 1686 ;; Globally toggle tool-bar-mode if some modifier key is pressed. 1695 1687 (tool-bar-mode) 1696 (let ((window-id (mac-bytes-to-digits (cdr (mac-ae-parameter ae)))) 1688 (let ((window-id 1689 (mac-coerce-ae-data "long" (cdr (mac-ae-parameter ae)) "TEXT")) 1697 1690 (rest (frame-list)) 1698 1691 frame) … … 1808 1801 (interactive "e") 1809 1802 (let* ((binding (lookup-key mac-apple-event-map (mac-event-spec event))) 1810 ( service-message1811 (and (keymapp binding)1812 (cdr (mac-ae-parameter (mac-event-ae event)"svmg")))))1803 (ae (mac-event-ae event)) 1804 (service-message (and (keymapp binding) 1805 (cdr (mac-ae-parameter ae "svmg"))))) 1813 1806 (when service-message 1814 1807 (setq service-message … … 1818 1811 ;; returns it. 1819 1812 (setcar (cdr event) (list (selected-window) (point) '(0 . 0) 0)) 1820 (call-interactively binding))) 1813 (if (null (mac-ae-parameter ae 'emacs-suspension-id)) 1814 (call-interactively binding) 1815 (condition-case err 1816 (progn 1817 (call-interactively binding) 1818 (mac-resume-apple-event ae)) 1819 (error 1820 (mac-ae-set-reply-parameter ae "errs" 1821 (cons "TEXT" (error-message-string err))) 1822 (mac-resume-apple-event ae -10000)))))) ; errAEEventFailed 1821 1823 1822 1824 (global-set-key [mac-apple-event] 'mac-dispatch-apple-event) … … 1827 1829 ;; the files should be opened. 1828 1830 (add-hook 'after-init-hook 'mac-process-deferred-apple-events) 1831 1832 (run-with-idle-timer 5 t 'mac-cleanup-expired-apple-events) 1829 1833 1830 1834
