unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* can't turn off font-lock
@ 2007-08-11 21:24 Karl Berry
  2007-08-12  3:22 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Karl Berry @ 2007-08-11 21:24 UTC (permalink / raw)
  To: bug-emacs

The Emacs 22.1 manual, Font Lock node, says:

       If you do not wish Font Lock mode to be turned on by default,
    customize the variable `global-font-lock-mode' using the Customize
    interface (*note Easy Customization::), or use the function
    `global-font-lock-mode' in your `.emacs' file, like this:

         (global-font-lock-mode 0)

Ok, so I start Emacs like this:
emacs-22.1 -q --no-site

And invoke:
M-x eval-expression RET (global-font-lock-mode 0) RET

And now I try a few commands:
C-h a font-lock RET             (a *Help* buffer)
M-x grep RET e /etc/issue RET   (grep to get a couple matches)
M-x shell RET pwd RET

In all cases, I observe that fontification is happening.  Argh!
E.g., the "pwd" is highlighted, the grep matches and filenames are
highlighted, the *Help* buffer is fancily formatted.

I also tried (setq font-lock-maximum-size 0).  Also no visible
de-fontifying.

I also tried with -nw, for Emacs in an xterm.  Same fontified results,
now in the usual xterm-ish ways (underlines and emboldening).

It seems either the manual or the behavior should be fixed.

(Also, if anyone has any details about how I can really turn font-lock
off, that would be great.)

Thanks,
Karl

P.S. I also tried customize-group on font-lock-faces, as suggested a
little further in the node, and the interface completely defeated me.  I
could not tell how to turn anything off completely, only how to select
various attributes.

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

* Re: can't turn off font-lock
  2007-08-11 21:24 can't turn off font-lock Karl Berry
@ 2007-08-12  3:22 ` Eli Zaretskii
  2007-08-12 17:56   ` Richard Stallman
                     ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Eli Zaretskii @ 2007-08-12  3:22 UTC (permalink / raw)
  To: Karl Berry; +Cc: bug-emacs

> Date: Sat, 11 Aug 2007 16:24:42 -0500
> From: karl@freefriends.org (Karl Berry)
> Cc: 
> 
> emacs-22.1 -q --no-site
> 
> And invoke:
> M-x eval-expression RET (global-font-lock-mode 0) RET
> 
> And now I try a few commands:
> C-h a font-lock RET             (a *Help* buffer)
> M-x grep RET e /etc/issue RET   (grep to get a couple matches)
> M-x shell RET pwd RET
> 
> In all cases, I observe that fontification is happening.  Argh!

That's not fontification, those are faces set by other features.  If
you place the cursor on one of the characters you think are fontified,
and type "C-u C-x =", Emacs will show you the face's name: you will
see that those are not font-lock faces.

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

* Re: can't turn off font-lock
  2007-08-12  3:22 ` Eli Zaretskii
@ 2007-08-12 17:56   ` Richard Stallman
  2007-08-12 22:54   ` Karl Berry
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2007-08-12 17:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: bug-emacs, karl

    That's not fontification, those are faces set by other features.  If
    you place the cursor on one of the characters you think are fontified,
    and type "C-u C-x =", Emacs will show you the face's name: you will
    see that those are not font-lock faces.

When modes set up faces manually, they are supposed to set a
`font-lock-face' property rather than `face'.  That way, Font Lock
mode controls whether those faces actually appear on the screen.

If one of these modes fails to do that, we should change it.

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

* Re: can't turn off font-lock
  2007-08-12  3:22 ` Eli Zaretskii
  2007-08-12 17:56   ` Richard Stallman
@ 2007-08-12 22:54   ` Karl Berry
  2007-08-12 23:41   ` Michaël Cadilhac
  2007-08-13  0:10   ` Michaël Cadilhac
  3 siblings, 0 replies; 10+ messages in thread
From: Karl Berry @ 2007-08-12 22:54 UTC (permalink / raw)
  To: eliz; +Cc: bug-emacs

    That's not fontification, those are faces set by other features.  

I'm sorry for being unclear; this distinction was unknown to me.  I was
using "fontification" as a generic term, meaning "appearing some fancy
kind of output", whether colors, a different font, bold, underlined,
whatever; using a "face", I guess.

I don't remember coming across any technical definition of
"fontification" in the manual, although I could easily have missed it.

karl

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

* Re: can't turn off font-lock
  2007-08-12  3:22 ` Eli Zaretskii
  2007-08-12 17:56   ` Richard Stallman
  2007-08-12 22:54   ` Karl Berry
@ 2007-08-12 23:41   ` Michaël Cadilhac
  2007-08-13  2:39     ` Eli Zaretskii
  2007-08-13  0:10   ` Michaël Cadilhac
  3 siblings, 1 reply; 10+ messages in thread
From: Michaël Cadilhac @ 2007-08-12 23:41 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: bug-emacs, Karl Berry


[-- Attachment #1.1: Type: text/plain, Size: 1203 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Sat, 11 Aug 2007 16:24:42 -0500
>> From: karl@freefriends.org (Karl Berry)
>> Cc: 
>> 
>> emacs-22.1 -q --no-site
>> 
>> And invoke:
>> M-x eval-expression RET (global-font-lock-mode 0) RET
>> 
>> And now I try a few commands:
>> C-h a font-lock RET             (a *Help* buffer)
>> M-x grep RET e /etc/issue RET   (grep to get a couple matches)
>> M-x shell RET pwd RET
>> 
>> In all cases, I observe that fontification is happening.  Argh!
>
> That's not fontification, those are faces set by other features.  If
> you place the cursor on one of the characters you think are fontified,
> and type "C-u C-x =", Emacs will show you the face's name: you will
> see that those are not font-lock faces.

I must disagree, I'm quite sure that it's plain font-locking.  I'll see
what's wrong in a few minutes.

-- 
 |   Michaël `Micha' Cadilhac       |  All your base are belong to us.       |
 |   http://michael.cadilhac.name   |    You have no chance to survive       |
 |   JID/MSN:                       |       make your time, hahaha.          |
 `----  michael.cadilhac@gmail.com  |       -- Zero Wings               -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

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

* Re: can't turn off font-lock
  2007-08-12  3:22 ` Eli Zaretskii
                     ` (2 preceding siblings ...)
  2007-08-12 23:41   ` Michaël Cadilhac
@ 2007-08-13  0:10   ` Michaël Cadilhac
  2007-08-13  0:23     ` Karl Berry
                       ` (2 more replies)
  3 siblings, 3 replies; 10+ messages in thread
From: Michaël Cadilhac @ 2007-08-13  0:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: bug-emacs, Karl Berry


[-- Attachment #1.1.1: Type: text/plain, Size: 865 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Sat, 11 Aug 2007 16:24:42 -0500
>> From: karl@freefriends.org (Karl Berry)
>> Cc: 
>> 
>> emacs-22.1 -q --no-site
>> 
>> And invoke:
>> M-x eval-expression RET (global-font-lock-mode 0) RET
>> 
>> And now I try a few commands:
>> C-h a font-lock RET             (a *Help* buffer)
>> M-x grep RET e /etc/issue RET   (grep to get a couple matches)
>> M-x shell RET pwd RET
>> 
>> In all cases, I observe that fontification is happening.  Argh!
>
> That's not fontification, those are faces set by other features.  If
> you place the cursor on one of the characters you think are fontified,
> and type "C-u C-x =", Emacs will show you the face's name: you will
> see that those are not font-lock faces.

So the bug was in compile.el, mainly. Here's a fix (which I believe is
correct) for that:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: font-lock-bug.patch --]
[-- Type: text/x-patch, Size: 1529 bytes --]

Index: progmodes/compile.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.439
diff -u -B -w -r1.439 compile.el
--- progmodes/compile.el	7 Aug 2007 20:10:14 -0000	1.439
+++ progmodes/compile.el	13 Aug 2007 00:08:38 -0000
@@ -1405,7 +1405,8 @@
 	  (turn-on-font-lock)))
     (setq font-lock-defaults '(compilation-mode-font-lock-keywords t))
     ;; maybe defer font-lock till after derived mode is set up
-    (run-mode-hooks 'compilation-turn-on-font-lock)))
+    (when font-lock-mode
+      (run-mode-hooks 'compilation-turn-on-font-lock))))
 
 ;;;###autoload
 (define-minor-mode compilation-shell-minor-mode
Index: progmodes/grep.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/grep.el,v
retrieving revision 1.76
diff -u -B -w -r1.76 grep.el
--- progmodes/grep.el	26 Jul 2007 05:27:27 -0000	1.76
+++ progmodes/grep.el	13 Aug 2007 00:08:38 -0000
@@ -356,7 +356,7 @@
 Set up `compilation-exit-message-function' and run `grep-setup-hook'."
   (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t))
     (grep-compute-defaults))
-  (when (eq grep-highlight-matches t)
+  (when (and font-lock-mode (eq grep-highlight-matches t))
     ;; Modify `process-environment' locally bound in `compilation-start'
     (setenv "GREP_OPTIONS" (concat (getenv "GREP_OPTIONS") " --color=always"))
     ;; for GNU grep 2.5.1

[-- Attachment #1.1.3: Type: text/plain, Size: 711 bytes --]


compile.el used turn-on-font-lock unconditionally, supposedly to update
the font-locking keywords.

grep.el used the colorful output of grep without parsing it if
font-locking was off (thus giving the user an output with ^[31m). Of
course, someone who's playing with font-locking on/off in a grep buffer
executed with font-locking on will see those ^[31m; but it's a detail.

-- 
 |   Michaël `Micha' Cadilhac       |  «Tu aimeras ton prochain.»            |
 |   http://michael.cadilhac.name   |    D'abord, Dieu ou pas,               |
 |   JID/MSN:                       |       j'ai horreur qu'on me tutoie.    |
 `----  michael.cadilhac@gmail.com  |           -- P. Desproges         -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

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

* Re: can't turn off font-lock
  2007-08-13  0:10   ` Michaël Cadilhac
@ 2007-08-13  0:23     ` Karl Berry
  2007-08-13  5:01     ` Richard Stallman
  2007-08-13 23:31     ` Karl Berry
  2 siblings, 0 replies; 10+ messages in thread
From: Karl Berry @ 2007-08-13  0:23 UTC (permalink / raw)
  To: michael; +Cc: bug-emacs

    So the bug was in compile.el, mainly

Thank you very much!  (I'll be trying it tomorrow.)

As mentioned in other messages,
how about *Help* buffers?
And the minibuffer?  (Er, echo area.)
Can you look at those, by any chance?

Thanks,
Karl

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

* Re: can't turn off font-lock
  2007-08-12 23:41   ` Michaël Cadilhac
@ 2007-08-13  2:39     ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2007-08-13  2:39 UTC (permalink / raw)
  To: Michaël Cadilhac; +Cc: bug-emacs, karl

> From: michael@cadilhac.name (=?iso-8859-1?Q?Micha=EBl?= Cadilhac)
> Cc: karl@freefriends.org (Karl Berry),  bug-emacs@gnu.org
> Date: Mon, 13 Aug 2007 01:41:09 +0200
> 
> > That's not fontification, those are faces set by other features.  If
> > you place the cursor on one of the characters you think are fontified,
> > and type "C-u C-x =3D", Emacs will show you the face's name: you will
> > see that those are not font-lock faces.
> 
> I must disagree, I'm quite sure that it's plain font-locking.

I meant to say that this is not font locking turned on and off by the
global font-lock mode.  Those faces are named font-lock-SOMETHING.

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

* Re: can't turn off font-lock
  2007-08-13  0:10   ` Michaël Cadilhac
  2007-08-13  0:23     ` Karl Berry
@ 2007-08-13  5:01     ` Richard Stallman
  2007-08-13 23:31     ` Karl Berry
  2 siblings, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2007-08-13  5:01 UTC (permalink / raw)
  To: Michaël Cadilhac; +Cc: bug-emacs, karl

    compile.el used turn-on-font-lock unconditionally, supposedly to update
    the font-locking keywords.

Please do not install that change.  I suspect it is not correct.

compile.el uses Font Lock to set up the properties that enable
next-error to work.  It appears to me that if it doesn't turn
on Font Lock mode, then next-error won't work.

I could be mistaken, but if you think I am, let's check that before
installing such a change.

I wish the mechanisms and the code for this were better documented.
Is there someone who understands it who would like to write an
overall explanation in comments in compile.el.

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

* Re: can't turn off font-lock
  2007-08-13  0:10   ` Michaël Cadilhac
  2007-08-13  0:23     ` Karl Berry
  2007-08-13  5:01     ` Richard Stallman
@ 2007-08-13 23:31     ` Karl Berry
  2 siblings, 0 replies; 10+ messages in thread
From: Karl Berry @ 2007-08-13 23:31 UTC (permalink / raw)
  To: bug-emacs

    So the bug was in compile.el, mainly. Here's a fix (which I believe is
    correct) for that:

That makes the faces go away after (global-font-lock-mode 0) all right,
but, as rms surmised, now next-error doesn't work.  I get:
  Moved past last grep hit

Thanks,
k

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

end of thread, other threads:[~2007-08-13 23:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-11 21:24 can't turn off font-lock Karl Berry
2007-08-12  3:22 ` Eli Zaretskii
2007-08-12 17:56   ` Richard Stallman
2007-08-12 22:54   ` Karl Berry
2007-08-12 23:41   ` Michaël Cadilhac
2007-08-13  2:39     ` Eli Zaretskii
2007-08-13  0:10   ` Michaël Cadilhac
2007-08-13  0:23     ` Karl Berry
2007-08-13  5:01     ` Richard Stallman
2007-08-13 23:31     ` Karl Berry

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