GNU bug report logs -
#34621
[PATCH] lisp/progmodes/grep.el (grep-read-files): Add file-directory-p check
Previous Next
Full log
View this message in rfc822 format
Thanks for the input, Drew.
> It's not obvious what a reasonable or smart default
> filename pattern is in most cases. Just because
> your current buffer is visiting a file does not at
> all imply that you want to search files with the
> same extension.
>
> I think you need to (for yourself) specify just
> what relation (if any) you want between the current
> buffer and the default filename pattern.
Personally I think the current behaviour of searching files with the
same extension works quite well in most cases. There is also some
flexibility with aliases which means that if you're in a "*.c" file the
default pattern becomes "*.[ch]".
However, I like the idea of providing more flexibility like
`grepp-default-regexp-fn`. This would mean a buffer in c-mode could
always suggest *.[ch] regardless of its buffer/file name. More
importantly, dired could implement this so that no default patterns are
suggested for dired buffers.
I will consider both (1) using only buffer-file-name instead of
buffer-name (2) enabling rgrep to delegate extension suggestions to
major modes. (1) would fix the case I'm personally encountering with
dired, but (2) may be better in the long term and could cover more cases
that I'm currently imagining.
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.