diff options
author | Gerd Moellmann <gerd@gnu.org> | 1999-11-24 14:37:53 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 1999-11-24 14:37:53 +0000 |
commit | 35a8911d3950448a8c199eec2030e2e2c066132f (patch) | |
tree | 0fcb3559db376451df99d6456c4d18c2a2d98d3a /lisp/term | |
parent | 5562b47fcd2826daac93a2c256d430a21aa1287a (diff) | |
download | emacs-35a8911d3950448a8c199eec2030e2e2c066132f.tar.gz |
(w32-drag-n-drop): Load files in current window, if
drop coords aren't over a specific window.
Diffstat (limited to 'lisp/term')
-rw-r--r-- | lisp/term/w32-win.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 5067b46d15b..a46f2334e9e 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -156,9 +156,17 @@ Switch to a buffer editing the last file dropped." (interactive "e") (save-excursion - (set-frame-selected-window nil (posn-window (event-start event))) - (mapcar 'find-file (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. <skx@tardis.ed.ac.uk> + (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 'find-file (car (cdr (cdr event))))) + (raise-frame))) (defun w32-drag-n-drop-other-frame (event) "Edit the files listed in the drag-n-drop event, in other frames. |