changeset 49584:57fdeb6dcb72

(find-alternate-file): Handle dired-directory like buffer-file-name.
author Richard M. Stallman <rms@gnu.org>
date Tue, 04 Feb 2003 10:40:14 +0000
parents ffebff40964c
children 8b39a07c5213
files lisp/files.el
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Tue Feb 04 10:39:35 2003 +0000
+++ b/lisp/files.el	Tue Feb 04 10:40:14 2003 +0000
@@ -940,6 +940,7 @@
   (let ((obuf (current-buffer))
 	(ofile buffer-file-name)
 	(onum buffer-file-number)
+	(odir dired-directory)
 	(otrue buffer-file-truename)
 	(oname (buffer-name)))
     (if (get-buffer " **lose**")
@@ -948,9 +949,13 @@
     (unwind-protect
 	(progn
 	  (unlock-buffer)
+	  ;; This prevents us from finding the same buffer
+	  ;; if we specified the same file again.
 	  (setq buffer-file-name nil)
 	  (setq buffer-file-number nil)
 	  (setq buffer-file-truename nil)
+	  ;; Likewise for dired buffers.
+	  (setq dired-directory nil)
 	  (find-file filename))
       (when (eq obuf (current-buffer))
 	;; This executes if find-file gets an error
@@ -960,6 +965,7 @@
 	(setq buffer-file-name ofile)
 	(setq buffer-file-number onum)
 	(setq buffer-file-truename otrue)
+	(setq dired-directory odir)
 	(lock-buffer)
 	(rename-buffer oname)))
     (unless (eq (current-buffer) obuf)