/[emacs]/emacs/lisp/term/mac-win.el
ViewVC logotype

Diff of /emacs/lisp/term/mac-win.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.29 by tamm, Wed Dec 29 17:25:02 2004 UTC revision 1.30 by tamm, Thu Dec 30 02:04:31 2004 UTC
# Line 1567  ascii:-*-Monaco-*-*-*-*-12-*-*-*-*-*-mac Line 1567  ascii:-*-Monaco-*-*-*-*-12-*-*-*-*-*-mac
1567    "Edit the files listed in the drag-n-drop EVENT.    "Edit the files listed in the drag-n-drop EVENT.
1568  Switch to a buffer editing the last file dropped."  Switch to a buffer editing the last file dropped."
1569    (interactive "e")    (interactive "e")
1570    (save-excursion    ;; Make sure the drop target has positive co-ords
1571      ;; Make sure the drop target has positive co-ords    ;; before setting the selected frame - otherwise it
1572      ;; before setting the selected frame - otherwise it    ;; won't work.  <skx@tardis.ed.ac.uk>
1573      ;; won't work.  <skx@tardis.ed.ac.uk>    (let* ((window (posn-window (event-start event)))
1574      (let* ((window (posn-window (event-start event)))           (coords (posn-x-y (event-start event)))
1575             (coords (posn-x-y (event-start event)))           (x (car coords))
1576             (x (car coords))           (y (cdr coords)))
1577             (y (cdr coords)))      (if (and (> x 0) (> y 0))
1578        (if (and (> x 0) (> y 0))          (set-frame-selected-window nil window))
1579            (set-frame-selected-window nil window))      (mapcar (lambda (file-name)
1580        (mapcar (lambda (file-name)                (if (listp file-name)
1581                  (x-dnd-handle-one-url window 'private                    (let ((line (car file-name))
1582                                        (concat "file:" file-name)))                          (start (car (cdr file-name)))
1583                (car (cdr (cdr event)))))                          (end (car (cdr (cdr file-name)))))
1584      (raise-frame)))                      (if (> line 0)
1585                            (goto-line line)
1586                          (if (and (> start 0) (> end 0))
1587                              (progn (set-mark start)
1588                                     (goto-char end)))))
1589                    (x-dnd-handle-one-url window 'private
1590                                          (concat "file:" file-name))))
1591                (car (cdr (cdr event)))))
1592      (raise-frame))
1593    
1594  (global-set-key [drag-n-drop] 'mac-drag-n-drop)  (global-set-key [drag-n-drop] 'mac-drag-n-drop)
1595    

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26