From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rusi Newsgroups: gmane.emacs.help Subject: Re: grep excludes Date: Thu, 7 Jul 2016 20:05:55 -0700 (PDT) Message-ID: References: <86d1mrjwl9.fsf@student.uu.se> <3e59d758-704a-4b17-875d-312c5b74d864@googlegroups.com> <87bn2b5hqe.fsf@ram.bvr.dp.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1467947445 25832 80.91.229.3 (8 Jul 2016 03:10:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Jul 2016 03:10:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 08 05:10:40 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bLMBb-0002hs-MA for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Jul 2016 05:10:39 +0200 Original-Received: from localhost ([::1]:43268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLMBa-000563-D4 for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Jul 2016 23:10:38 -0400 X-Received: by 10.66.194.102 with SMTP id hv6mr3146542pac.19.1467947155921; Thu, 07 Jul 2016 20:05:55 -0700 (PDT) X-Received: by 10.36.242.65 with SMTP id j62mr40478ith.8.1467947155881; Thu, 07 Jul 2016 20:05:55 -0700 (PDT) Original-Path: usenet.stanford.edu!jk6no13641264igb.0!news-out.google.com!o189ni5655ith.0!nntp.google.com!jk6no13641262igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=123.201.38.238; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 123.201.38.238 User-Agent: G2/1.0 Injection-Date: Fri, 08 Jul 2016 03:05:55 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:218409 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110718 Archived-At: On Thursday, July 7, 2016 at 11:46:02 AM UTC+5:30, B.V. Raghav wrote: > > > (defun my-grep(pattern file-name) > > "My own version of grep command" > > (interactive "sPattern: \nFFind %s in file(s): ") > > (let ((cmd "grep -e")) > > ;; ^^^^^^^^^ My Grep Command > > (grep (message "%s %s %s" cmd pattern file-name)))) > > > > If I understand correctly, you requires the change of command as > > mentioned here. > > > > HTH > > On second thoughts, the following set should be helpful: > > (defun my-grep-base(grep-cmd params) > (grep (format "%s %s %s" grep-cmd (car params) (cadr params)))) > > (defun my-grep-params(pattern file-name) > "My own version of grep command" > (interactive "sPattern: \nFFind %s in file(s): ") > (list pattern file-name)) > > (defun my-grep() > (interactive) > (my-grep-base "grep -e" (call-interactively #'my-grep-params))) > > (defun my-lgrep() > (interactive) > (my-grep-base "lgrep -e" (call-interactively #'my-grep-params))) > > (defun my-rgrep() > (interactive) > (my-grep-base "rgrep -e" (call-interactively #'my-grep-params))) > > and you can define lgrep and rgrep in your .bashrc (or .bash_aliases) as follows: > > alias lgrep='grep -n ' > alias rgrep='grep -nR ' Thanks for trying Raghav but as of now it does: -------------------------------- -*- mode: grep; default-directory: "~/vit-projects-common-wiki/" -*- Grep started at Fri Jul 8 08:32:13 lgrep -e emacs ~/vit-projects-common-wiki/ /dev/null /bin/bash: lgrep: command not found Grep exited abnormally with code 127 at Fri Jul 8 08:32:13 ------------------------------ Eli, I'll be glad to clarify any question(s) about the issue at hand