unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Peter Lee <spam@nospam.org>
Subject: macro to invoke shell command
Date: Fri, 10 Jan 2003 17:55:11 GMT	[thread overview]
Message-ID: <uwulczy80.fsf@nospam.org> (raw)

I'm having trouble writing a macro to perform a grep-find
command. Basically I just want to grep the current word in the
buffer. I would like to be use grep-find for this.

This doesnt work.

(defun grep-cur-word (&optional arg)
  "grep-find on the current word"
  (interactive "p")
  (grep-find (current-word)))

The defaults for my grep-find are:
find . -iregex ".*\.cpp\|.*\.c\|.*\.h\|.*\.idl\|.*\.rc\|.*\.tl[ih]"
-print0 | xargs -0 -e grep -n -i -e 

So normally I would M-x grep-find <ret>
and it would display:
find . -iregex ".*\.cpp\|.*\.c\|.*\.h\|.*\.idl\|.*\.rc\|.*\.tl[ih]"
-print0 | xargs -0 -e grep -n -i -e 

Then I just fill in the word at the end enclosed in quotes:
find . -iregex ".*\.cpp\|.*\.c\|.*\.h\|.*\.idl\|.*\.rc\|.*\.tl[ih]"
-print0 | xargs -0 -e grep -n -i -e "m_dwTicks"

My lisp is very weak and would appreciate any help. I just want to be
able to put cursor on word and hit a key to make the above happen.

Any ideas?

Thanks.

             reply	other threads:[~2003-01-10 17:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <usmw0zwfz.fsf@nospam.org>
2003-01-10 17:55 ` Peter Lee [this message]
2003-01-10 22:26   ` macro help Jesper Harder
2003-01-15 11:08   ` macro to invoke shell command martin

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=uwulczy80.fsf@nospam.org \
    --to=spam@nospam.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.
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).