[Top][All Lists]

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

Re: dired: don't mark summary line

From: Miles Bader
Subject: Re: dired: don't mark summary line
Date: 01 Dec 2003 16:49:41 +0900

Stefan Monnier <address@hidden> writes:

> >> Would this patch help?
> >> -  (or (looking-at "^$\\|^. *$\\|^. total\\|^. wildcard\\|^. used\\|^. 
> >> find")
> >> +  (or (looking-at "^$\\|^. *$\\|^. total\\|^. wildcard\\|^. used\\|^. 
> >> find\\|^. insgesamt")
> > Note that the same problem occurs for _every_ locale (e.g., I've seen it 
> > with
> > LANG set to ja_JP); it might be better to ignore any lines with less than
> > some number of spaces in them, or something like that.
> Why not just check that the line has the drwxrwxrwx thingy ?
> We already have a fine regexp for it,

Indeed, and the comment in `dired-between-files' suggests using
(save-excursion (not (dired-move-to-filename))) which basically just
ends up using dired-permission-flags-regexp as you suggest (that regexp
can't be used directly with looking-at, because it doesn't match from
the beginning of a line).

The following patch seems to do the right thing in a non-english locale,
without any message dependencies; despite the comment it's not
perceptibly slow for me:

diff -up /usr/local/src/emacs-tiling/lisp/dired.el /tmp/dired.el
--- /usr/local/src/emacs-tiling/lisp/dired.el   2003-11-18 18:19:34.000000000 
+++ /tmp/dired.el       2003-12-01 16:43:23.000000000 +0900
@@ -2383,9 +2383,5 @@ FILES is the list of marked files."
   ;; Point must be at beginning of line
-  ;; Should be equivalent to (save-excursion (not (dired-move-to-filename)))
-  ;; but is about 1.5..2.0 times as fast. (Actually that's not worth it)
-  (or (looking-at "^$\\|^. *$\\|^. total\\|^. wildcard\\|^. used\\|^. find")
-      (and (looking-at dired-subdir-regexp)
-          (save-excursion (not (dired-move-to-filename))))))
+  (save-excursion (not (dired-move-to-filename))))
 (defun dired-next-marked-file (arg &optional wrap opoint)
   "Move to the next marked file, wrapping around the end of the buffer."

"I distrust a research person who is always obviously busy on a task."
   --Robert Frosch, VP, GM Research

reply via email to

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