aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/dired.el25
1 files changed, 16 insertions, 9 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index df9c87a88af..8b592c3d915 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -928,7 +928,7 @@ Keybindings:
928 (dired-advertise) ; default-directory is already set 928 (dired-advertise) ; default-directory is already set
929 (setq major-mode 'dired-mode 929 (setq major-mode 'dired-mode
930 mode-name "Dired" 930 mode-name "Dired"
931 case-fold-search nil 931;; case-fold-search nil
932 buffer-read-only t 932 buffer-read-only t
933 selective-display t ; for subdirectory hiding 933 selective-display t ; for subdirectory hiding
934 mode-line-buffer-identification '("Dired: %17b")) 934 mode-line-buffer-identification '("Dired: %17b"))
@@ -1325,18 +1325,25 @@ Returns the new value of the alist."
1325 (interactive) 1325 (interactive)
1326 (dired-clear-alist) 1326 (dired-clear-alist)
1327 (save-excursion 1327 (save-excursion
1328 (let ((count 0)) 1328 (let ((count 0)
1329 (buffer-read-only nil)
1330 new-dir-name)
1329 (goto-char (point-min)) 1331 (goto-char (point-min))
1330 (setq dired-subdir-alist nil) 1332 (setq dired-subdir-alist nil)
1331 (while (re-search-forward dired-subdir-regexp nil t) 1333 (while (re-search-forward dired-subdir-regexp nil t)
1334 (save-excursion
1335 (goto-char (match-beginning 1))
1336 (setq new-dir-name
1337 (expand-file-name (buffer-substring (point) (match-end 1))))
1338 (delete-region (point) (match-end 1))
1339 (insert new-dir-name))
1332 (setq count (1+ count)) 1340 (setq count (1+ count))
1333 (dired-alist-add-1 (buffer-substring (match-beginning 1) 1341 (dired-alist-add-1 new-dir-name
1334 (match-end 1)) 1342 ;; Place a sub directory boundary between lines.
1335 ;; Put subdir boundary between lines: 1343 (save-excursion
1336 (save-excursion 1344 (goto-char (match-beginning 0))
1337 (goto-char (match-beginning 0)) 1345 (beginning-of-line)
1338 (beginning-of-line) 1346 (point-marker))))
1339 (point-marker))))
1340 (if (> count 1) 1347 (if (> count 1)
1341 (message "Buffer includes %d directories" count)) 1348 (message "Buffer includes %d directories" count))
1342 ;; We don't need to sort it because it is in buffer order per 1349 ;; We don't need to sort it because it is in buffer order per