all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: using find-grep in emacs
Date: Wed, 15 May 2013 20:51:57 +0200	[thread overview]
Message-ID: <5193D94D.7080007@easy-emacs.de> (raw)
In-Reply-To: <0aa2bea2-27b8-4486-9440-f76e22fea2b1@googlegroups.com>

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




  parent reply	other threads:[~2013-05-15 18:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-13 23:47 using find-grep in emacs Rami A
2013-05-14  0:45 ` Dan Espen
2013-05-14  2:36   ` Barry Margolin
2013-05-14 13:31     ` Ludwig, Mark
2013-05-14  4:45   ` Bob Proulx
2013-05-14 11:48     ` Andreas Röhler
2013-05-14 15:27       ` Peter Dyballa
2013-05-14 15:42         ` Bob Proulx
2013-05-14 17:19           ` Andreas Röhler
     [not found]         ` <mailman.25743.1368546134.855.help-gnu-emacs@gnu.org>
2013-05-14 19:41           ` Barry Margolin
2013-05-15 18:25 ` Rami A
2013-05-15 18:49   ` Dan Espen
2013-05-15 18:51   ` Andreas Röhler [this message]
     [not found]   ` <mailman.25858.1368643771.855.help-gnu-emacs@gnu.org>
2013-05-15 19:11     ` Rami A
2013-05-15 19:46       ` Andreas Röhler
2013-05-15 21:23         ` Peter Dyballa
2013-05-16  5:10           ` Andreas Röhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5193D94D.7080007@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.