aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-07-30 11:49:11 +0000
committerGerd Moellmann2000-07-30 11:49:11 +0000
commitb4c017767fe919e58f655729d8609749fede4d8a (patch)
tree706294f9e9dd5313e291c404fac5017ff2c5e028
parentc0178a99f85693dcb617d6beec629c99170f2e3e (diff)
downloademacs-b4c017767fe919e58f655729d8609749fede4d8a.tar.gz
emacs-b4c017767fe919e58f655729d8609749fede4d8a.zip
(dired-build-subdir-alist): Expand subdirectory names
correctly in recursive ange-ftp listings.
-rw-r--r--lisp/dired.el18
1 files changed, 16 insertions, 2 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index e7dedadd7e1..393635452a1 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1764,7 +1764,13 @@ Returns the new value of the alist."
1764 (save-excursion 1764 (save-excursion
1765 (let ((count 0) 1765 (let ((count 0)
1766 (buffer-read-only nil) 1766 (buffer-read-only nil)
1767 new-dir-name) 1767 new-dir-name
1768 (R-ftp-base-dir-regex
1769 ;; Used to expand subdirectory names correctly in recursive
1770 ;; ange-ftp listings.
1771 (and (string-match "R" dired-actual-switches)
1772 (string-match "\\`/.*:\\(/.*\\)" default-directory)
1773 (concat "\\`" (match-string 1 default-directory)))))
1768 (goto-char (point-min)) 1774 (goto-char (point-min))
1769 (setq dired-subdir-alist nil) 1775 (setq dired-subdir-alist nil)
1770 (while (and (re-search-forward dired-subdir-regexp nil t) 1776 (while (and (re-search-forward dired-subdir-regexp nil t)
@@ -1778,7 +1784,15 @@ Returns the new value of the alist."
1778 (save-excursion 1784 (save-excursion
1779 (goto-char (match-beginning 1)) 1785 (goto-char (match-beginning 1))
1780 (setq new-dir-name 1786 (setq new-dir-name
1781 (expand-file-name (buffer-substring (point) (match-end 1)))) 1787 (buffer-substring-no-properties (point) (match-end 1))
1788 new-dir-name
1789 (save-match-data
1790 (if (and R-ftp-base-dir-regex
1791 (not (string= new-dir-name default-directory))
1792 (string-match R-ftp-base-dir-regex new-dir-name))
1793 (concat default-directory
1794 (substring new-dir-name (match-end 0)))
1795 (expand-file-name new-dir-name))))
1782 (delete-region (point) (match-end 1)) 1796 (delete-region (point) (match-end 1))
1783 (insert new-dir-name)) 1797 (insert new-dir-name))
1784 (setq count (1+ count)) 1798 (setq count (1+ count))