bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#34621: [PATCH] Fix rgrep in dired taking default search file pattern


From: Juri Linkov
Subject: 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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

> 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.





reply via email to

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