From 2aaa7f0a1b34fb09d5673e851359b2c767d5049e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 23 Apr 2002 03:14:48 +0000 Subject: [PATCH] (dired-mouse-find-file-other-window): Handle events that move out of the window. --- lisp/ChangeLog | 5 +++++ lisp/dired.el | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) 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")) -- 2.39.5