aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-09-24 20:37:13 +0000
committerRichard M. Stallman2006-09-24 20:37:13 +0000
commita3d76960eae4a9daff00967e4dc7936d7bb13e84 (patch)
tree9aa7276a354f12e8763a0728700c56e6d777142b
parent2f680b2069bbf215e2bfcf7d7070a8b9b2c70338 (diff)
downloademacs-a3d76960eae4a9daff00967e4dc7936d7bb13e84.tar.gz
emacs-a3d76960eae4a9daff00967e4dc7936d7bb13e84.zip
(dired-build-subdir-alist): When file ends in colon,
don't exit the loop, just disregard that file.
-rw-r--r--lisp/dired.el62
1 files changed, 31 insertions, 31 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 2974b386d0b..dd7cdcdb522 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2204,40 +2204,40 @@ instead of `dired-actual-switches'."
2204 (concat "\\`" (match-string 1 default-directory))))) 2204 (concat "\\`" (match-string 1 default-directory)))))
2205 (goto-char (point-min)) 2205 (goto-char (point-min))
2206 (setq dired-subdir-alist nil) 2206 (setq dired-subdir-alist nil)
2207 (while (and (re-search-forward dired-subdir-regexp nil t) 2207 (while (re-search-forward dired-subdir-regexp nil t)
2208 ;; Avoid taking a file name ending in a colon 2208 ;; Avoid taking a file name ending in a colon
2209 ;; as a subdir name. 2209 ;; as a subdir name.
2210 (not (save-excursion 2210 (unless (save-excursion
2211 (goto-char (match-beginning 0)) 2211 (goto-char (match-beginning 0))
2212 (beginning-of-line) 2212 (beginning-of-line)
2213 (forward-char 2) 2213 (forward-char 2)
2214 (save-match-data (looking-at dired-re-perms))))) 2214 (save-match-data (looking-at dired-re-perms)))
2215 (save-excursion 2215 (save-excursion
2216 (goto-char (match-beginning 1)) 2216 (goto-char (match-beginning 1))
2217 (setq new-dir-name 2217 (setq new-dir-name
2218 (buffer-substring-no-properties (point) (match-end 1)) 2218 (buffer-substring-no-properties (point) (match-end 1))
2219 new-dir-name 2219 new-dir-name
2220 (save-match-data 2220 (save-match-data
2221 (if (and R-ftp-base-dir-regex 2221 (if (and R-ftp-base-dir-regex
2222 (not (string= new-dir-name default-directory)) 2222 (not (string= new-dir-name default-directory))
2223 (string-match R-ftp-base-dir-regex new-dir-name)) 2223 (string-match R-ftp-base-dir-regex new-dir-name))
2224 (concat default-directory 2224 (concat default-directory
2225 (substring new-dir-name (match-end 0))) 2225 (substring new-dir-name (match-end 0)))
2226 (expand-file-name new-dir-name)))) 2226 (expand-file-name new-dir-name))))
2227 (delete-region (point) (match-end 1)) 2227 (delete-region (point) (match-end 1))
2228 (insert new-dir-name)) 2228 (insert new-dir-name)))
2229 (setq count (1+ count)) 2229 (setq count (1+ count))
2230 (dired-alist-add-1 new-dir-name 2230 (dired-alist-add-1 new-dir-name
2231 ;; Place a sub directory boundary between lines. 2231 ;; Place a sub directory boundary between lines.
2232 (save-excursion 2232 (save-excursion
2233 (goto-char (match-beginning 0)) 2233 (goto-char (match-beginning 0))
2234 (beginning-of-line) 2234 (beginning-of-line)
2235 (point-marker)))) 2235 (point-marker))))
2236 (if (and (> count 1) (interactive-p)) 2236 (if (and (> count 1) (interactive-p))
2237 (message "Buffer includes %d directories" count)) 2237 (message "Buffer includes %d directories" count)))
2238 ;; We don't need to sort it because it is in buffer order per 2238 ;; We don't need to sort it because it is in buffer order per
2239 ;; constructionem. Return new alist: 2239 ;; constructionem. Return new alist:
2240 dired-subdir-alist))) 2240 dired-subdir-alist))
2241 2241
2242(defun dired-alist-add-1 (dir new-marker) 2242(defun dired-alist-add-1 (dir new-marker)
2243 ;; Add new DIR at NEW-MARKER. Don't sort. 2243 ;; Add new DIR at NEW-MARKER. Don't sort.