Show
Ignore:
Timestamp:
05/27/06 09:57:08 (3 years ago)
Author:
miyoshi
Message:

Load emacs-to-svn into vendor/emacs-CVS_HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • vendor/emacs-CVS_HEAD/lisp/term/mac-win.el

    r4077 r4089  
    15861586      result))) 
    15871587 
    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) i 
    1596                                          (- len i 1))))))) 
    1597     (format "%.0f" val))) 
    1598  
    15991588(defun mac-ae-selection-range (ae) 
    16001589;; #pragma options align=mac68k 
     
    16281617    (dolist (file-name (mac-ae-list ae nil 'undecoded-file-name)) 
    16291618      (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))) 
    16311623    (let ((selection-range (mac-ae-selection-range ae)) 
    16321624          (search-text (mac-ae-text-for-search ae))) 
     
    16581650    (if (string= (url-type parsed-url) "mailto") 
    16591651        (url-mailto parsed-url) 
    1660       (error "Unsupported URL scheme: %s" (url-type parsed-url))))) 
     1652      (mac-resume-apple-event ae t)))) 
    16611653 
    16621654(setq mac-apple-event-map (make-sparse-keymap)) 
     
    16941686        ;; Globally toggle tool-bar-mode if some modifier key is pressed. 
    16951687        (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")) 
    16971690            (rest (frame-list)) 
    16981691            frame) 
     
    18081801  (interactive "e") 
    18091802  (let* ((binding (lookup-key mac-apple-event-map (mac-event-spec event))) 
    1810          (service-message 
    1811           (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"))))) 
    18131806    (when service-message 
    18141807      (setq service-message 
     
    18181811    ;; returns it. 
    18191812    (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 
    18211823 
    18221824(global-set-key [mac-apple-event] 'mac-dispatch-apple-event) 
     
    18271829;; the files should be opened. 
    18281830(add-hook 'after-init-hook 'mac-process-deferred-apple-events) 
     1831 
     1832(run-with-idle-timer 5 t 'mac-cleanup-expired-apple-events) 
    18291833 
    18301834