emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: directory names ending with a colon confuse dired


From: Chris Moore
Subject: Re: directory names ending with a colon confuse dired
Date: Fri, 22 Sep 2006 01:40:13 +0200

On Fri, 2006-09-22 at 01:18 +0200, Chris Moore wrote:
> The following patch makes things better for me

I've found a better patch.  There's a bug in dired-build-subdir-alist().
It loops through the buffer looking for lines which match
dired-subdir-regexp, but the loop breaks when the first filename ending
with ':' is found.

What needs to happen is that the filename ending in ':' is ignored, and
the loop continues.

Here's a patch.  I've left the indendation as it was to make the patch
shorter, but the function will need reindenting.  I removed a seemingly
unneeded call to save-match-data():

----------
--- Backup/dired.el.~1~ 2006-09-22 01:14:35.000000000 +0200
+++ dired.el    2006-09-22 01:36:15.000000000 +0200
@@ -2204,14 +2204,14 @@
                 (concat "\\`" (match-string 1 default-directory)))))
       (goto-char (point-min))
       (setq dired-subdir-alist nil)
-      (while (and (re-search-forward dired-subdir-regexp nil t)
+      (while (re-search-forward dired-subdir-regexp nil t)
                  ;; Avoid taking a file name ending in a colon
                  ;; as a subdir name.
-                 (not (save-excursion
+                 (unless (save-excursion
                         (goto-char (match-beginning 0))
                         (beginning-of-line)
                         (forward-char 2)
-                        (save-match-data (looking-at dired-re-perms)))))
+                        (looking-at dired-re-perms))
        (save-excursion
          (goto-char (match-beginning 1))
          (setq new-dir-name
@@ -2233,6 +2233,7 @@
                             (goto-char (match-beginning 0))
                             (beginning-of-line)
                             (point-marker))))
+                            )
       (if (and (> count 1) (interactive-p))
          (message "Buffer includes %d directories" count))
       ;; We don't need to sort it because it is in buffer order per
----------

Chris.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]