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

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

Re: using find-grep in emacs


From: Andreas Röhler
Subject: Re: using find-grep in emacs
Date: Wed, 15 May 2013 20:51:57 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

Am 15.05.2013 20:25, schrieb Rami A:
Thank you all for your feedback.
I am actually using 2 emacs binaries "24.3.1" and "23.3.1".

I am trying to bind all this command that also defaults to search only [*.shc] 
files.
How can I do that?

Basically I want to be able to hit for example F1 and simply type the pattern I 
am looking for without continuously adding the [*.shc].

Also I would like emacs to ask the default folder to look for the pattern 
underneath only once.

Was not able to find a way to achieve all of that.


M-x customize-variable RET grep-find-command RET

If that's not enough, for example as I like to change switch some parameters 
quite often, write your own commands.

The command below uses -maxdepth 9, while another aliased gf1 uses -maxdepth 1 
etc.

(defalias 'gf9 'neun-grep-find)
(defun neun-grep-find ()
  (interactive)
  (grep-apply-setting 'grep-find-command "find . -maxdepth 9 -type f -name \"*.el\" 
-print0 | xargs -0 -e grep -nH -e ")
  (grep-find (car (progn
                    (grep-compute-defaults)
                        (list (read-shell-command "Run find (like this): "
                                                  grep-find-command 
'grep-find-history))))))




reply via email to

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