all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: wenbinye@gmail.com
Subject: Re: customize grep-find-command for each invocation
Date: 29 Aug 2006 19:00:52 -0700	[thread overview]
Message-ID: <1156903252.450557.24900@i3g2000cwc.googlegroups.com> (raw)
In-Reply-To: <1156881749.776533.238220@p79g2000cwp.googlegroups.com>

When you write elisp code, you should always check you call the
function with right
arguments. You can use C-h f to see the arguments needed, or turn on
eldoc-mode,
the arguments will echo automatically.

What is your root value? The local variable should use 'let' bind.
grep-find-command is a string, not a cons cell.

after set grep-find-command, you can use (call-interactively
'grep-find)
or (grep-find grep-find-command) to call grep-find

weiqingh@yahoo.com wrote:
> 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-30  2:00 UTC|newest]

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

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

  git send-email \
    --in-reply-to=1156903252.450557.24900@i3g2000cwc.googlegroups.com \
    --to=wenbinye@gmail.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.
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.