unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Bug in font-lock/grep interaction
@ 2010-10-14 13:02 Lars Magne Ingebrigtsen
  2010-10-14 16:02 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-14 13:02 UTC (permalink / raw)
  To: emacs-devel

If you have

(setq font-lock-global-modes nil)

then grep won't work:

grep -nH -e stream *.el
comint.el:701:a TCP connection to be opened via `open-network-^[[01;31mstream^[[m'.  If there is already
comint.el:727:a TCP connection to be opened via `open-network-^[[01;31mstream^[[m'.  If there is already
comint.el:761:	       (open-network-^[[01;31mstream^[[m name buffer (car command) (cdr command))

(That is, the text is unreadable and `C-x `' won't jump to the lines.)

The following seems to fix the problem, but is probably the wrong solution:


=== modified file 'lisp/progmodes/grep.el'
*** lisp/progmodes/grep.el	2010-05-21 20:43:04 +0000
--- lisp/progmodes/grep.el	2010-10-14 13:01:41 +0000
***************
*** 456,463 ****
  Set up `compilation-exit-message-function' and run `grep-setup-hook'."
    (when (eq grep-highlight-matches 'auto-detect)
      (grep-compute-defaults))
!   (unless (or (eq grep-highlight-matches 'auto-detect)
! 	      (null grep-highlight-matches))
      ;; `setenv' modifies `process-environment' let-bound in `compilation-start'
      ;; Any TERM except "dumb" allows GNU grep to use `--color=auto'
      (setenv "TERM" "emacs-grep")
--- 456,464 ----
  Set up `compilation-exit-message-function' and run `grep-setup-hook'."
    (when (eq grep-highlight-matches 'auto-detect)
      (grep-compute-defaults))
!   (when (and (not (or (eq grep-highlight-matches 'auto-detect)
! 		      (null grep-highlight-matches)))
! 	     font-lock-global-modes)
      ;; `setenv' modifies `process-environment' let-bound in `compilation-start'
      ;; Any TERM except "dumb" allows GNU grep to use `--color=auto'
      (setenv "TERM" "emacs-grep")




-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: Bug in font-lock/grep interaction
  2010-10-14 13:02 Bug in font-lock/grep interaction Lars Magne Ingebrigtsen
@ 2010-10-14 16:02 ` Glenn Morris
  2010-10-14 16:28   ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2010-10-14 16:02 UTC (permalink / raw)
  To: emacs-devel


Lars Magne Ingebrigtsen wrote:

> If you have
>
> (setq font-lock-global-modes nil)

Why would you do that, as opposed to

(global-font-lock-mode -1)

> then grep won't work:

I think grep requires font-lock to be on to work, so it should
probably override/ignore font-lock-global-modes. See

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=801
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2134

PS: It is better to report bugs to the bug list.



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

* Re: Bug in font-lock/grep interaction
  2010-10-14 16:02 ` Glenn Morris
@ 2010-10-14 16:28   ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-14 16:28 UTC (permalink / raw)
  To: emacs-devel

Glenn Morris <rgm@gnu.org> writes:

> Lars Magne Ingebrigtsen wrote:
>
>> If you have
>>
>> (setq font-lock-global-modes nil)
>
> Why would you do that, as opposed to
>
> (global-font-lock-mode -1)

Does it make a difference?

>> then grep won't work:
>
> I think grep requires font-lock to be on to work, so it should
> probably override/ignore font-lock-global-modes. See
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=801
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2134

grep doesn't seem to require font-lock to work?  It works fine if you
disable the colouring crap in grep-setup if font-lock is off.  I think.

But there may be use cases I haven't tested.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

end of thread, other threads:[~2010-10-14 16:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-14 13:02 Bug in font-lock/grep interaction Lars Magne Ingebrigtsen
2010-10-14 16:02 ` Glenn Morris
2010-10-14 16:28   ` Lars Magne Ingebrigtsen

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