GNU bug report logs - #68637
30.0.50; image-dired-mark-tagged-files and ls -F

Previous Next

Package: emacs;

Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Date: Sun, 21 Jan 2024 13:32:01 UTC

Severity: wishlist

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: 68637 <at> debbugs.gnu.org
Cc: contovob <at> tcd.ie, stefankangas <at> gmail.com
Subject: bug#68637: 30.0.50; image-dired-mark-tagged-files and ls -F
Date: Sun, 21 Jan 2024 22:44:28 +0100
"Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army
knife of text editors" <bug-gnu-emacs <at> gnu.org> writes:

[...]

> At first glance it looks like the
>
>   (search-forward-regexp (format "\\s %s$" curr-file) nil t)
>
> in image-dired-mark-tagged-files doesn't take into account any of the
> indicators that 'ls -F' may append to file names.

Thanks for this insight.  The following patch seems to do the trick.  I
think we can limit ourselves to executable and symlink since I can't see
how directories, pipes, sockets or doors(?) could be regular image
files.

diff --git a/lisp/image/image-dired-dired.el b/lisp/image/image-dired-dired.el
index f4778d8e121..7219a106ca8 100644
--- a/lisp/image/image-dired-dired.el
+++ b/lisp/image/image-dired-dired.el
@@ -383,7 +383,7 @@ image-dired-mark-tagged-files
                       (file-name-directory curr-file)))
         (setq curr-file (file-name-nondirectory curr-file))
         (goto-char (point-min))
-        (when (search-forward-regexp (format "\\s %s$" curr-file) nil t)
+        (when (search-forward-regexp (format "\\s %s[*@]?$" curr-file) nil t)
           (setq hits (+ hits 1))
           (dired-mark 1))))
     (message "%d files with matching tag marked" hits)))

> The commentary suggests using dired-mark-files-regexp would be too slow.
> I wonder if that's still the case, or if there are any faster
> alternatives without loss of generality?

I did not try this alternative.
-- 
Manuel Giraud




This bug report was last modified 1 year and 174 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.