unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Reuben Thomas <rrt@sc3d.org>
Cc: 18859@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	[thread overview]
Message-ID: <878ssagpg0.fsf@mouse.gnus.org> (raw)
In-Reply-To: <87bnox9pn8.fsf@sc3d.org> (Reuben Thomas's message of "Mon, 27 Oct 2014 21:19:39 +0000")

Reuben Thomas <rrt@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





  reply	other threads:[~2019-08-03 16:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27 21:19 bug#18859: 24.3; ibuffer-mark-by-file-name-regexp does not match displayed name Reuben Thomas
2019-08-03 16:54 ` Lars Ingebrigtsen [this message]
2019-08-23  0:53   ` Lars Ingebrigtsen
2021-01-17 16:06   ` Basil L. Contovounesios
2021-01-17 16:32     ` Basil L. Contovounesios
2021-01-18 16:39       ` Lars Ingebrigtsen
2021-01-18 18:05         ` Basil L. Contovounesios

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878ssagpg0.fsf@mouse.gnus.org \
    --to=larsi@gnus.org \
    --cc=18859@debbugs.gnu.org \
    --cc=rrt@sc3d.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).