bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compile.el, using grep-find when find-program is not "find"


From: Kevin Rodgers
Subject: Re: compile.el, using grep-find when find-program is not "find"
Date: Thu, 06 Nov 2003 10:59:00 -0700
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

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  <address@hidden>

        * 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]