GNU bug report logs - #34621
[PATCH] lisp/progmodes/grep.el (grep-read-files): Add file-directory-p check

Previous Next

Package: emacs;

Reported by: Christopher Thorne <c.thorne <at> reckondigital.com>

Date: Fri, 22 Feb 2019 21:16:01 UTC

Severity: normal

Tags: patch

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #38 received at 34621 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Christopher Thorne <c.thorne <at> reckondigital.com>
Cc: 34621 <at> debbugs.gnu.org
Subject: Re: bug#34621: [PATCH] Fix rgrep in dired taking default search file
 pattern from directory name (e.g. *.11 for django-1.11)
Date: Mon, 08 Apr 2019 22:44:20 +0300
> I've updated the patch following input from Drew and Juri.
> This now adds 'grep-default-file-pattern-function' which major modes
> can implement.
> Dired implements this to take the extension of the file at point, with
> a default of 'all',
> thus solving the issue I was having with the django-1.11 directory
> mentioned earlier in the thread.
> Behaviour for major modes that don't implement
> 'grep-default-file-pattern-function' will remain as before.

Thanks, this is better than previous versions.

Even more, you don't need any changes in dired.el.  Just use in grep.el

  (run-hook-with-args-until-success 'file-name-at-point-functions)

because 'file-name-at-point-functions' already has the right value in Dired.

You can call it at the very beginning of grep-read-files in the same 'or'
before buffer-file-name, so the existing code will take care about getting
its file extension.




This bug report was last modified 6 years and 36 days ago.

Previous Next


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