unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* compile.el, using grep-find when find-program is not "find"
@ 2003-11-05 22:21 Marcus Picasso
  0 siblings, 0 replies; 2+ messages in thread
From: Marcus Picasso @ 2003-11-05 22:21 UTC (permalink / raw)


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))))))))

Best regards,
-Marcus.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: compile.el, using grep-find when find-program is not "find"
       [not found] <mailman.3276.1068070939.21628.bug-gnu-emacs@gnu.org>
@ 2003-11-06 17:59 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2003-11-06 17:59 UTC (permalink / raw)


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  <ihs_4664@yahoo.com>

	* 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-11-06 17:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-05 22:21 compile.el, using grep-find when find-program is not "find" Marcus Picasso
     [not found] <mailman.3276.1068070939.21628.bug-gnu-emacs@gnu.org>
2003-11-06 17:59 ` Kevin Rodgers

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).