From: Xah <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: custom rgrep with multi dirs
Date: Mon, 16 Jun 2008 08:26:20 -0700 (PDT) [thread overview]
Message-ID: <60b54c04-6aa9-4efe-8406-8566dfa07843@u12g2000prd.googlegroups.com> (raw)
In-Reply-To: 1956fb53-9dc8-48fc-8a83-4b1104165661@a32g2000prf.googlegroups.com
I have this function:
(defun xah-find-word-usage (myword)
"Grep a dir for a word's usage."
(interactive "sWord to search: ")
;;(require 'grep)
(rgrep myword "*\\.html" "~/web/p")
)
However, if i call if for the first time, i get
“grep-expand-template: Wrong type argument: stringp, nil”.
But if i have used rgrep before in this session, then it works.
I guess i need the (require 'grep) but that didn't help. Any hints?
Thanks.
Xah
∑ http://xahlee.org/
☄
On Jun 14, 2:31 am, Xah <xah...@gmail.com> wrote:
> i'd like to write a custome rgrep command so that it greps several
> predefined dirs at once.
>
> for example, here's what i like the actualy command to run:
>
> find ~/dir1 ~/dir2 ~/dir3 -name "*html" -exec grep -i -nH -e myStr {} /
> dev/null \;
>
> all i want the my-rgrep to ask me is about the myStr. And of course i
> want the output in nice usual rgrep output with word highlighted and
> file linked.
>
> Any suggestion on how to do that?
>
> ... for extra... where would i start to learn about how to get unix
> shell output into the format rgrep uses? i.e. hotlink file names and
> highlight words. Is there a general api/function or does it involve
> detailed programing of text properties etc myself?
>
> Thanks.
>
> Xah
> ∑http://xahlee.org/
>
> ☄
next prev parent reply other threads:[~2008-06-16 15:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-14 9:31 custom rgrep with multi dirs Xah
2008-06-16 15:26 ` Xah [this message]
2008-06-17 5:26 ` Kevin Rodgers
[not found] ` <mailman.13435.1213680387.18990.help-gnu-emacs@gnu.org>
2008-06-17 6:50 ` Xah
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=60b54c04-6aa9-4efe-8406-8566dfa07843@u12g2000prd.googlegroups.com \
--to=xahlee@gmail.com \
--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.