diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-09-16 21:35:29 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-09-16 21:35:29 +0000 |
commit | 9df38cef14365ebc9e138b4939853601962f1ba0 (patch) | |
tree | f5d9f61df45119a8027b2cb4065dca649efc9453 /lisp/dired-aux.el | |
parent | 12c3828362ca719b68f6ae6df368276ca20b96db (diff) | |
download | emacs-9df38cef14365ebc9e138b4939853601962f1ba0.tar.gz |
(dired-fun-in-all-buffers): Expand dir at start.
(dired-rename-subdir, dired-rename-subdir-1, dired-kill-tree): Likewise.
Diffstat (limited to 'lisp/dired-aux.el')
-rw-r--r-- | lisp/dired-aux.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index e62ecb3c4c5..1e277040412 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -707,7 +707,7 @@ a prefix arg lets you edit the `ls' switches used for the new listing." (defun dired-fun-in-all-buffers (directory fun &rest args) ;; In all buffers dired'ing DIRECTORY, run FUN with ARGS. ;; Return list of buffers where FUN succeeded (i.e., returned non-nil). - (let ((buf-list (dired-buffers-for-dir directory)) + (let ((buf-list (dired-buffers-for-dir (expand-file-name directory))) (obuf (current-buffer)) buf success-list) (while buf-list @@ -891,12 +891,13 @@ Special value `always' suppresses confirmation.") (dired-fun-in-all-buffers from-dir (function dired-rename-subdir-1) from-dir to-dir) ;; Update visited file name of all affected buffers - (let ((blist (buffer-list))) + (let ((expanded-from-dir (expand-file-name from-dir)) + (blist (buffer-list))) (while blist (save-excursion - (set-buffer (car blist)) + (set-buffer (car blist)) (if (and buffer-file-name - (dired-in-this-tree buffer-file-name from-dir)) + (dired-in-this-tree buffer-file-name expanded-from-dir)) (let ((modflag (buffer-modified-p)) (to-file (dired-replace-in-string (concat "^" (regexp-quote from-dir)) @@ -909,12 +910,13 @@ Special value `always' suppresses confirmation.") (defun dired-rename-subdir-1 (dir to) ;; Rename DIR to TO in headerlines and dired-subdir-alist, if DIR or ;; one of its subdirectories is expanded in this buffer. - (let ((alist dired-subdir-alist) + (let ((expanded-dir (expand-file-name dir)) + (alist dired-subdir-alist) (elt nil)) (while alist (setq elt (car alist) alist (cdr alist)) - (if (dired-in-this-tree (car elt) dir) + (if (dired-in-this-tree (car elt) expanded-dir) ;; ELT's subdir is affected by the rename (dired-rename-subdir-2 elt dir to))) (if (equal dir default-directory) @@ -1530,6 +1532,7 @@ This function takes some pains to conform to `ls -lR' output." ;;"Kill all proper subdirs of DIRNAME, excluding DIRNAME itself. ;; With optional arg REMEMBER-MARKS, return an alist of marked files." (interactive "DKill tree below directory: ") + (setq dirname (expand-file-name dirname)) (let ((s-alist dired-subdir-alist) dir m-alist) (while s-alist (setq dir (car (car s-alist)) |