From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Peter Lee Newsgroups: gmane.emacs.help Subject: macro to invoke shell command Date: Fri, 10 Jan 2003 17:55:11 GMT Organization: Prodigy Internet http://www.prodigy.com Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1042221632 17054 80.91.224.249 (10 Jan 2003 18:00:32 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 10 Jan 2003 18:00:32 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18X3SC-0004QK-00 for ; Fri, 10 Jan 2003 19:00:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18X3SP-000665-01 for gnu-help-gnu-emacs@m.gmane.org; Fri, 10 Jan 2003 13:00:37 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!207.115.63.142!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr11.news.prodigy.com.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 Original-NNTP-Posting-Host: 216.62.199.3 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: newssvr11.news.prodigy.com 1042221311 ST000 216.62.199.3 (Fri, 10 Jan 2003 12:55:11 EST) Original-NNTP-Posting-Date: Fri, 10 Jan 2003 12:55:11 EST X-UserInfo1: TSU[@I_AO@RYB\\YQCHN_TTDFRYB@GXLN@GZ_GYO^JWTEPIB_NVUAH_[BL[\IRKIANGGJBFNJF_DOLSCENSY^U@FRFUEXR@KFXYDBPWBCDQJA@X_DCBHXR[C@\EOKCJLED_SZ@RMWYXYWE_P@\\GOIW^@SYFFSWHFIXMADO@^[ADPRPETLBJ]RDGENSKQQZN Original-Xref: shelby.stanford.edu gnu.emacs.help:108805 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:5334 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5334 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 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.