GNU bug report logs - #18859
24.3; ibuffer-mark-by-file-name-regexp does not match displayed name

Previous Next

Package: emacs;

Reported by: Reuben Thomas <rrt <at> sc3d.org>

Date: Mon, 27 Oct 2014 21:21:02 UTC

Severity: minor

Tags: fixed, patch

Found in version 24.3

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> mouse.gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Reuben Thomas <rrt <at> sc3d.org>
Cc: 18859 <at> debbugs.gnu.org
Subject: bug#18859: 24.3; ibuffer-mark-by-file-name-regexp does not match displayed name
Date: Sat, 03 Aug 2019 18:54:07 +0200
Reuben Thomas <rrt <at> sc3d.org> writes:

> In the *IBuffer*, files in my home directory are displayed with names
> starting with ā€˜~’, but when I type % f ~ RET I get no matches. If I type
> instead % f /home/MYUSER RET then all files in my home directory are
> matched.
>
> I’m not convinced that the matches should be made in the second case,
> even; but certainly they _should_ be made in the first.

The following patch fixes this by matching on the abbreviated file name
(which is what ibuffer uses to create the displayed file name).

But I guess this could be a controversial change -- does anybody have an
objection to making this change?  

diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 1b69574a39..06a2248d40 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -1846,7 +1846,8 @@ ibuffer-mark-by-file-name-regexp
 			  (stringp dired-directory)
 			  dired-directory)))))
 	 (when name
-	   (string-match regexp name))))))
+           ;; Match on the displayed file name (which is abbreviated).
+	   (string-match regexp (abbreviate-file-name name)))))))
 
 ;;;###autoload
 (defun ibuffer-mark-by-content-regexp (regexp &optional all-buffers)


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 4 years and 206 days ago.

Previous Next


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