unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: weiqingh@yahoo.com
Subject: customize grep-find-command for each invocation
Date: 29 Aug 2006 13:02:29 -0700	[thread overview]
Message-ID: <1156881749.776533.238220@p79g2000cwp.googlegroups.com> (raw)

hi there,

i want to set the grep-find-command differently based on each file.
(basically i need to search from a certain directory based on where the
file is). what's the best way to do it? i tried to write a new function
like this:

(defun rails-search()
  (interactive)
  ;; set grep-find-command based on value of root
  (rails-core:with-root (root)
  (setq grep-find-command (cons (concat "find " root " -name \"*.rb\" |
xargs -exec grep -i -n -s ") (+ 34 (length root))))

  (grep-find)
 )
)

when trying to run the new function, it gave me "wrong number of
arguments". i guess i need to pass arguments to grep-find. but how? i
wanted to grep-find to take the input for search string... 

thanks.

             reply	other threads:[~2006-08-29 20:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-29 20:02 weiqingh [this message]
2006-08-30  2:00 ` customize grep-find-command for each invocation wenbinye
2006-08-30 20:55   ` weiqingh

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=1156881749.776533.238220@p79g2000cwp.googlegroups.com \
    --to=weiqingh@yahoo.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).