comparison lisp/dired.el @ 30521:78337ade0189

(dired-build-subdir-alist): Expand subdirectory names correctly in recursive ange-ftp listings.
author Gerd Moellmann <gerd@gnu.org>
date Sun, 30 Jul 2000 11:49:11 +0000
parents a8e324dcc228
children 2eb77e04a185
comparison
equal deleted inserted replaced
30520:01e227128435 30521:78337ade0189
1762 (interactive) 1762 (interactive)
1763 (dired-clear-alist) 1763 (dired-clear-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)
1771 ;; Avoid taking a file name ending in a colon 1777 ;; Avoid taking a file name ending in a colon
1772 ;; as a subdir name. 1778 ;; as a subdir name.
1776 (forward-char 2) 1782 (forward-char 2)
1777 (save-match-data (looking-at dired-re-perms))))) 1783 (save-match-data (looking-at dired-re-perms)))))
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))
1785 (dired-alist-add-1 new-dir-name 1799 (dired-alist-add-1 new-dir-name
1786 ;; Place a sub directory boundary between lines. 1800 ;; Place a sub directory boundary between lines.