summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2001-09-21 16:41:58 +0000
committerEli Zaretskii <eliz@gnu.org>2001-09-21 16:41:58 +0000
commit3c13627aed4b3d758638e6a9b0e0afcb43a9ede0 (patch)
tree20836afc9e27068fc6e3d1d8029984a566fe1d75
parent59957f85f46ca1b35a88ca4e8b4c5fe6e0c3d0eb (diff)
downloademacs-3c13627aed4b3d758638e6a9b0e0afcb43a9ede0.tar.gz
(dired-build-subdir-alist): Accept optional arg SWITCHES.
-rw-r--r--lisp/dired.el25
1 files changed, 14 insertions, 11 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 7465eebb4c5..5361bdd22bf 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1788,21 +1788,24 @@ regardless of the language.")
nil ; return nil if not found
(error "%s directory" (if (> arg 0) "Last" "First"))))))
-(defun dired-build-subdir-alist ()
+(defun dired-build-subdir-alist (&optional switches)
"Build `dired-subdir-alist' by parsing the buffer.
-Returns the new value of the alist."
+Returns the new value of the alist.
+If optional arg SWITCHES is non-nil, use its value
+instead of `dired-actual-switches'."
(interactive)
(dired-clear-alist)
(save-excursion
- (let ((count 0)
- (buffer-read-only nil)
- new-dir-name
- (R-ftp-base-dir-regex
- ;; Used to expand subdirectory names correctly in recursive
- ;; ange-ftp listings.
- (and (string-match "R" dired-actual-switches)
- (string-match "\\`/.*:\\(/.*\\)" default-directory)
- (concat "\\`" (match-string 1 default-directory)))))
+ (let* ((count 0)
+ (buffer-read-only nil)
+ (switches (or switches dired-actual-switches))
+ new-dir-name
+ (R-ftp-base-dir-regex
+ ;; Used to expand subdirectory names correctly in recursive
+ ;; ange-ftp listings.
+ (and (string-match "R" switches)
+ (string-match "\\`/.*:\\(/.*\\)" default-directory)
+ (concat "\\`" (match-string 1 default-directory)))))
(goto-char (point-min))
(setq dired-subdir-alist nil)
(while (and (re-search-forward dired-subdir-regexp nil t)