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

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

Re: igrep mode incovenient compilation of results


From: Kevin Rodgers
Subject: Re: igrep mode incovenient compilation of results
Date: Thu, 01 Aug 2013 21:11:29 -0600
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20

On 8/1/13 4:22 PM, Rami A wrote:
I am using igrep.el package and liking it. There is one thing that
bothers me though. In the igrep results page, the first and last lines
are highlighted as part of the compilation and so cycling through the
results using next-error will eventually hit these two lines with no
corresponding files of course.

These are the format of these first and last files:

Igrep started at Thu Aug  1 15:15:23

finished (matches found) at Thu Aug  1 15:15:27

Does `M-x grep' generate those lines in the *grep* buffer?  Are they highlighted
and do they impact `M-x next-error' in the same way?

(BTW, Kenneth Goldman reported the same problem back in 2010.  Perhaps he knows
a solution.)

I believe that this is the code responsible for these lines to show up
all together. How to disable these lines from showing in the grep
results or at least not having them highlighted as part of the
results:

This code simply attempts to emulate `M-x grep', on the Emacs versions that
were popular when igrep was actively maintained (by me).  That emulation
probably needs to be updated to account for developments in grep.el and
compile.el since then.

(if igrep-find
(setq command
       (igrep-format-find-command command files)))
(cond ((eq igrep-save-buffers t) (save-some-buffers t))
   (igrep-save-buffers (save-some-buffers)))
(if (fboundp 'compilation-start)    ; Emacs 22
     (let ((compilation-process-setup-function 'grep-process-setup))
       (or (fboundp 'igrep-mode)
           (define-derived-mode igrep-mode grep-mode "Igrep"))
       (compilation-start command
                          'igrep-mode
                          nil
                          (cond ((eq compilation-highlight-regexp t))
                                (compilation-highlight-regexp
                                 (if (eq program "fgrep")
                                     (regexp-quote regex)
                                   regex)))))
   (compile-internal command (format "No more %s matches" program)
                     "Igrep" nil grep-regexp-alist))))

--
Kevin Rodgers
Denver, Colorado, USA




reply via email to

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