Mercurial > emacs
diff lisp/dired.el @ 44764:2e019a1ff633
(dired-mouse-find-file-other-window):
Handle events that move out of the window.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 23 Apr 2002 03:14:41 +0000 |
parents | 9cab12e7e72a |
children | 578cda58219f |
line wrap: on
line diff
--- a/lisp/dired.el Mon Apr 22 22:56:19 2002 +0000 +++ b/lisp/dired.el Tue Apr 23 03:14:41 2002 +0000 @@ -1364,13 +1364,16 @@ (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 @@ t) (autoload 'dired-run-shell-command "dired-aux") + +(autoload 'dired-query "dired-aux") (if (eq system-type 'vax-vms) (load "dired-vms"))