[Top][All Lists]
[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: |
Sat, 23 Sep 2006 04:10:39 +0200 |
On Fri, 2006-09-22 at 13:01 -0400, Richard Stallman wrote:
> 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():
>
> The reason for the call to `save-match-data' is so that
>
> (save-excursion
> (goto-char (match-beginning 1))
>
> will get what was matched by the previous search.
> In fact, I am surprised it works at all once you delete that
> call to `save-match-data'.
If the (looking-at dired-re-perms) succeeds, then we're looking at a
file ending with a colon. The unless will fail, and so the loop will go
on to the next iteration, and the
(save-excursion
(goto-char (match-beginning 1))
won't be used on this iteration, so there's no need to save the match data.
The function works with or without the save-match-data call, since the match
data is never used.
The match data which the (match-beginning 1) refers to is that which was saved
by the
(re-search-forward dired-subdir-regexp nil t)
not by the looking-at, and so the save-match-data call is really not needed.
Do you agree?
Chris.
- directory names ending with a colon confuse dired, Chris Moore, 2006/09/21
- Re: directory names ending with a colon confuse dired, Chris Moore, 2006/09/21
- Re: directory names ending with a colon confuse dired, Chris Moore, 2006/09/21
- Re: directory names ending with a colon confuse dired, Chris Moore, 2006/09/21
- Re: directory names ending with a colon confuse dired, Richard Stallman, 2006/09/22
- Re: directory names ending with a colon confuse dired,
Chris Moore <=
- Re: directory names ending with a colon confuse dired, Johan Bockgård, 2006/09/23
- Re: directory names ending with a colon confuse dired, Richard Stallman, 2006/09/23
- Re: directory names ending with a colon confuse dired, Chris Moore, 2006/09/25