Windows 10, Emacs 26.1 dired+
I want in dired mode find files by
- Approach#1 - use external tools. What tools you can suggest?
- Approach#2 - use only built-in Emacs function on external lib - What you can suggest?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
I think you're asking how to find files by matching both their file names and the file contents. Is that it?
If so, Icicles does this for you, in all of its file-finding commands.
The commands use multi-completion: The input you type can be two-part: (1) a pattern that matches the file name, (2) a pattern that matches the file content.
You can use only one of the two possible patterns if you like. For example, you will most often just type a file-name pattern. In that case, the behavior is like
find-file (but a very enhanced
When you type input for the command, if you use
C-M-j that separates the two patterns. The file-name pattern is first, then
C-M-j, then the file-content pattern.
In Icicles during completion your input patterns can use regexp matching (which Icicles calls apropos completion).
You ask also about Dired.
In a Dired buffer, there are related content-matching commands you can use to visit the marked files and subdirectories whose content matches a regexp.
icicle-visit-marked-file-of-content, bound to
icicle-visit-marked-file-of-content-recursive, bound to
The latter visits not only the files that are marked in the current directory, but also those marked in any marked subdirectories, and sub-subdirectories etc., recursively. (For these recursively descending searches you need Dired+.)