From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: compile.el, using grep-find when find-program is not "find" Date: Thu, 06 Nov 2003 10:59:00 -0700 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3FAA8BE4.9090805@yahoo.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1068141609 1266 80.91.224.253 (6 Nov 2003 18:00:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Nov 2003 18:00:09 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 06 19:00:07 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AHoQR-0005N5-00 for ; Thu, 06 Nov 2003 19:00:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AHoQ5-0006zU-HS for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Nov 2003 12:59:45 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AHoPv-0006yY-Mq for bug-gnu-emacs@prep.ai.mit.edu; Thu, 06 Nov 2003 12:59:35 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AHoPP-0006Mk-1a for bug-gnu-emacs@prep.ai.mit.edu; Thu, 06 Nov 2003 12:59:34 -0500 Original-Received: from [216.168.1.22] (helo=trinity.supernews.net) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AHoPN-0006GA-SA for bug-gnu-emacs@prep.ai.mit.edu; Thu, 06 Nov 2003 12:59:01 -0500 Original-Received: from mail.fu-berlin.de ([160.45.11.165]:43599 ident=root) by trinity.supernews.net with esmtp (Exim 4.20) id 1AHoPL-0008jQ-0A for gnu-emacs-bug@moderators.isc.org; Thu, 06 Nov 2003 17:58:59 +0000 Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Thu, 6 Nov 2003 18:58:57 +0100 (MET) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Thu, 6 Nov 2003 18:58:57 +0100 (MET) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 60 X-Orig-NNTP-Posting-Host: 170.207.51.80 X-Orig-X-Trace: news.uni-berlin.de 1068141537 43669576 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:6104 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:6104 Marcus Picasso wrote: > In GNU Emacs 21.3.1 (i386-msvc-nt5.0.2195) of 2003-03-28 on buffy: > > Changing the lisp variable "find-program" to something else than "find" > makes compile.el position the point at wrong place, when doing "M-x > grep-find". > > Hint: > > Compile.el has in "grep-compute-defaults" a line which I think takes care of > point-positioning, and it handles different lenghts of grep-command right, > but not find-command. The line is: > > (+ 22 (length grep-command)))))))) 22 is the position of grep-command in grep-find-command if find-program has its default value of "find" (and grep-find-use-args is null). Here's a patch: 2003-11-06 Kevin Rodgers * progmodes/compile.el (grep-compute-defaults): Don't guess the position of grep-command by assuming find-program has its default value. *** emacs-21.3/lisp/progmodes/compile.el.orig Fri Jan 17 06:45:11 2003 --- emacs-21.3/lisp/progmodes/compile.el Thu Nov 6 10:54:56 2003 *************** *** 94,103 **** (grep-find-use-xargs (format "%s . -type f -print | xargs %s" find-program grep-command)) ! (t (cons (format "%s . -type f -exec %s {} %s \\;" ! find-program grep-command null-device) ! (+ 22 (length grep-command)))))))) (defcustom grep-command nil "The default grep command for \\[grep]. The default value of this variable is set up by `grep-compute-defaults'; --- 94,107 ---- (grep-find-use-xargs (format "%s . -type f -print | xargs %s" find-program grep-command)) ! (t (let ((command ! (format "%s . -type f -exec %s {} %s \\;" ! find-program grep-command null-device))) + (cons command + (1+ (string-match (regexp-quote grep-command) + command))))))))) + (defcustom grep-command nil "The default grep command for \\[grep]. The default value of this variable is set up by `grep-compute-defaults'; -- Kevin Rodgers