From: Richard M. Stallman Date: Tue, 23 Apr 2002 03:14:48 +0000 (+0000) Subject: (dired-mouse-find-file-other-window): X-Git-Tag: ttn-vms-21-2-B4~15467 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2aaa7f0a1b34fb09d5673e851359b2c767d5049e;p=emacs.git (dired-mouse-find-file-other-window): Handle events that move out of the window. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9e5d4866787..8428ca452ef 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2002-04-22 Richard M. Stallman + + * dired.el (dired-mouse-find-file-other-window): + Handle events that move out of the window. + 2002-04-23 Martin Stjernholm * progmodes/cc-cmds.el (c-mask-comment): Fixed bug where point diff --git a/lisp/dired.el b/lisp/dired.el index 8bf10e0cef8..d147b66135c 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1364,13 +1364,16 @@ Creates a buffer if necessary." (defun dired-mouse-find-file-other-window (event) "In Dired, visit the file or directory name you click on." (interactive "e") - (let (file) + (let (window pos file) (save-excursion - (set-buffer (window-buffer (posn-window (event-end event)))) - (save-excursion - (goto-char (posn-point (event-end event))) - (setq file (dired-get-file-for-visit)))) - (select-window (posn-window (event-end event))) + (setq window (posn-window (event-end event)) + pos (posn-point (event-end event))) + (if (not (windowp window)) + (error "No file chosen")) + (set-buffer (window-buffer window)) + (goto-char pos) + (setq file (dired-get-file-for-visit))) + (select-window window) (find-file-other-window (file-name-sans-versions file t)))) (defcustom dired-view-command-alist @@ -3006,6 +3009,8 @@ true then the type of the file linked to by FILE is printed instead." t) (autoload 'dired-run-shell-command "dired-aux") + +(autoload 'dired-query "dired-aux") (if (eq system-type 'vax-vms) (load "dired-vms"))