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.
_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug