aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/term/mac-win.el
diff options
context:
space:
mode:
authorSteven Tamm <[email protected]>2004-12-30 02:04:31 +0000
committerSteven Tamm <[email protected]>2004-12-30 02:04:31 +0000
commit456e761becb3d7dc0b7a707079b4f1259e9da598 (patch)
tree454fbf8751a183ab52de718af3abc65f0e739c96 /lisp/term/mac-win.el
parentc4cb00d05e5e3a227681de41a4aef0067bce106a (diff)
* macterm.c (SelectionRange): Add Xcode position apple event struct.
(do_ae_open_documents): Handle Xcode-style file position open events. * term/mac-win.el (mac-drag-n-drop): Handle drag-n-drop events that include line numbers.
Diffstat (limited to 'lisp/term/mac-win.el')
-rw-r--r--lisp/term/mac-win.el38
1 files changed, 23 insertions, 15 deletions
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 19d2528844..4b3c7531e5 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1567,21 +1567,29 @@ ascii:-*-Monaco-*-*-*-*-12-*-*-*-*-*-mac-roman")
"Edit the files listed in the drag-n-drop EVENT.
Switch to a buffer editing the last file dropped."
(interactive "e")
- (save-excursion
- ;; Make sure the drop target has positive co-ords
- ;; before setting the selected frame - otherwise it
- ;; won't work. <[email protected]>
- (let* ((window (posn-window (event-start event)))
- (coords (posn-x-y (event-start event)))
- (x (car coords))
- (y (cdr coords)))
- (if (and (> x 0) (> y 0))
- (set-frame-selected-window nil window))
- (mapcar (lambda (file-name)
- (x-dnd-handle-one-url window 'private
- (concat "file:" file-name)))
- (car (cdr (cdr event)))))
- (raise-frame)))
+ ;; Make sure the drop target has positive co-ords
+ ;; before setting the selected frame - otherwise it
+ ;; won't work. <[email protected]>
+ (let* ((window (posn-window (event-start event)))
+ (coords (posn-x-y (event-start event)))
+ (x (car coords))
+ (y (cdr coords)))
+ (if (and (> x 0) (> y 0))
+ (set-frame-selected-window nil window))
+ (mapcar (lambda (file-name)
+ (if (listp file-name)
+ (let ((line (car file-name))
+ (start (car (cdr file-name)))
+ (end (car (cdr (cdr file-name)))))
+ (if (> line 0)
+ (goto-line line)
+ (if (and (> start 0) (> end 0))
+ (progn (set-mark start)
+ (goto-char end)))))
+ (x-dnd-handle-one-url window 'private
+ (concat "file:" file-name))))
+ (car (cdr (cdr event)))))
+ (raise-frame))
(global-set-key [drag-n-drop] 'mac-drag-n-drop)