Mercurial > emacs
comparison lisp/dired.el @ 7918:4561618ebf64
(dired-build-subdir-alist): Avoid mistaking a file name
ending in a colon for a subdir header line.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 15 Jun 1994 22:39:01 +0000 |
parents | 23f5b77e3773 |
children | db1785b91d03 |
comparison
equal
deleted
inserted
replaced
7917:7967c371644f | 7918:4561618ebf64 |
---|---|
183 (concat dired-re-maybe-mark dired-re-inode-size x))) | 183 (concat dired-re-maybe-mark dired-re-inode-size x))) |
184 '("-[-r][-w][xs][-r][-w].[-r][-w]." | 184 '("-[-r][-w][xs][-r][-w].[-r][-w]." |
185 "-[-r][-w].[-r][-w][xs][-r][-w]." | 185 "-[-r][-w].[-r][-w][xs][-r][-w]." |
186 "-[-r][-w].[-r][-w].[-r][-w][xst]") | 186 "-[-r][-w].[-r][-w].[-r][-w][xst]") |
187 "\\|")) | 187 "\\|")) |
188 (defvar dired-re-perms "-[-r][-w].[-r][-w].[-r][-w].") | |
188 (defvar dired-re-dot "^.* \\.\\.?$") | 189 (defvar dired-re-dot "^.* \\.\\.?$") |
189 | 190 |
190 (defvar dired-subdir-alist nil | 191 (defvar dired-subdir-alist nil |
191 "Association list of subdirectories and their buffer positions. | 192 "Association list of subdirectories and their buffer positions. |
192 Each subdirectory has an element: (DIRNAME . STARTMARKER). | 193 Each subdirectory has an element: (DIRNAME . STARTMARKER). |
1358 (let ((count 0) | 1359 (let ((count 0) |
1359 (buffer-read-only nil) | 1360 (buffer-read-only nil) |
1360 new-dir-name) | 1361 new-dir-name) |
1361 (goto-char (point-min)) | 1362 (goto-char (point-min)) |
1362 (setq dired-subdir-alist nil) | 1363 (setq dired-subdir-alist nil) |
1363 (while (re-search-forward dired-subdir-regexp nil t) | 1364 (while (and (re-search-forward dired-subdir-regexp nil t) |
1365 ;; Avoid taking a file name ending in a colon | |
1366 ;; as a subdir name. | |
1367 (not (save-excursion | |
1368 (goto-char (match-beginning 0)) | |
1369 (beginning-of-line) | |
1370 (forward-char 2) | |
1371 (looking-at dired-re-perms)))) | |
1364 (save-excursion | 1372 (save-excursion |
1365 (goto-char (match-beginning 1)) | 1373 (goto-char (match-beginning 1)) |
1366 (setq new-dir-name | 1374 (setq new-dir-name |
1367 (expand-file-name (buffer-substring (point) (match-end 1)))) | 1375 (expand-file-name (buffer-substring (point) (match-end 1)))) |
1368 (delete-region (point) (match-end 1)) | 1376 (delete-region (point) (match-end 1)) |