all messages for Emacs-related lists mirrored at yhetil.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
  2007-08-12 17:56 ` Richard Stallman
  0 siblings, 2 replies; 37+ 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] 37+ 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)
  2007-08-12 17:56 ` Richard Stallman
  1 sibling, 4 replies; 37+ 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] 37+ 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
  2007-08-12 19:53   ` Stefan Monnier
                     ` (2 more replies)
  1 sibling, 3 replies; 37+ messages in thread
From: Richard Stallman @ 2007-08-12 17:56 UTC (permalink / raw)
  To: Karl Berry; +Cc: emacs-devel

    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 think these cases are different.  I do not observe any fontification
in M-x shell.  In M-x grep, I do observe it, but M-x font-lock-mode
turns it off.  (I wonder why it was on.)

In C-h a font-lock RET, I see faces regardless of whether Font-Lock
mode is enabled.

All that is in the trunk.

Can someone please debug these problems, then ack?

^ permalink raw reply	[flat|nested] 37+ 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; 37+ 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] 37+ messages in thread

* Re: can't turn off font-lock
  2007-08-12 17:56 ` Richard Stallman
@ 2007-08-12 19:53   ` Stefan Monnier
  2007-08-12 21:48     ` Karl Berry
  2007-08-13  5:01     ` Richard Stallman
  2007-08-12 21:48   ` Karl Berry
  2007-08-12 22:54   ` Karl Berry
  2 siblings, 2 replies; 37+ messages in thread
From: Stefan Monnier @ 2007-08-12 19:53 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel, Karl Berry

> I think these cases are different.  I do not observe any fontification
> in M-x shell.  In M-x grep, I do observe it, but M-x font-lock-mode
> turns it off.  (I wonder why it was on.)

Because grep relies on compilation-mode, which uses font-lock to do its
work, so it forcefully enables font-lock.


        Stefan

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

* Re: can't turn off font-lock
  2007-08-12 17:56 ` Richard Stallman
  2007-08-12 19:53   ` Stefan Monnier
@ 2007-08-12 21:48   ` Karl Berry
  2007-08-13  5:00     ` Richard Stallman
  2007-08-12 22:54   ` Karl Berry
  2 siblings, 1 reply; 37+ messages in thread
From: Karl Berry @ 2007-08-12 21:48 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

    I do not observe any fontification in M-x shell.

Maybe I am using the wrong word, but when I do this:

$ emacs -q --no-site 
M-x eval-expression RET (global-font-lock-mode 0) RET
M-x shell RET pwd RET

I most definitely do observe fontish things happening:
- my shell prompt is in a turquoise color.
- after typing a command (say, "pwd") and hitting RET,
  the command is emboldened.

I see analogous output in -nw mode.

Thanks,
karl

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

* Re: can't turn off font-lock
  2007-08-12 19:53   ` Stefan Monnier
@ 2007-08-12 21:48     ` Karl Berry
  2007-08-12 22:11       ` Stefan Monnier
  2007-08-12 22:44       ` Alfred M. Szmidt
  2007-08-13  5:01     ` Richard Stallman
  1 sibling, 2 replies; 37+ messages in thread
From: Karl Berry @ 2007-08-12 21:48 UTC (permalink / raw)
  To: monnier; +Cc: rms, emacs-devel

    rms> In M-x grep, I do observe it, but M-x font-lock-mode turns it off.

I've made various attempts at turning off font-lock in compile/grep
hooks without success.  If someone knows a recipe that works, please
inform.

    monnier> Because grep relies on compilation-mode, which uses
    font-lock to do its work, so it forcefully enables font-lock.

Am I to infer that M-x compile and M-x grep don't work without
fontification/faces (sorry, I don't understand the difference) any more?
If so, this should be mentioned somehow in the Font Lock node -- that
(global-font-lock-mode 0) doesn't turn off everything.  And in fact
there's no way of predicting what it does and doesn't turn off.

(Also, if so, I guess I'll have to write my own versions, since I find
faces badly and uselessly distracting, especially in -nw mode.  Maybe I
am the only person in the world this is true for.  Sigh.)

karl

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

* Re: can't turn off font-lock
  2007-08-12 21:48     ` Karl Berry
@ 2007-08-12 22:11       ` Stefan Monnier
  2007-08-12 22:54         ` Karl Berry
  2007-08-12 22:44       ` Alfred M. Szmidt
  1 sibling, 1 reply; 37+ messages in thread
From: Stefan Monnier @ 2007-08-12 22:11 UTC (permalink / raw)
  To: Karl Berry; +Cc: rms, emacs-devel

> (Also, if so, I guess I'll have to write my own versions,

You may be better off changing to not use font-lock, and then provide
a patch for it: I'd consider it as a bug-fix.

> since I find faces badly and uselessly distracting, especially in -nw
> mode.  Maybe I am the only person in the world this is true for.  Sigh.)

I'm sure you're not the only person.  I do like font-lock, but customize
most faces to look like `default' because I find them annoying/useless
(e.g. font-lock-keyword-face).


        Stefan

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

* Re: can't turn off font-lock
  2007-08-12 21:48     ` Karl Berry
  2007-08-12 22:11       ` Stefan Monnier
@ 2007-08-12 22:44       ` Alfred M. Szmidt
  1 sibling, 0 replies; 37+ messages in thread
From: Alfred M. Szmidt @ 2007-08-12 22:44 UTC (permalink / raw)
  To: Karl Berry; +Cc: emacs-devel, monnier, rms

   (Also, if so, I guess I'll have to write my own versions, since I find
   faces badly and uselessly distracting, especially in -nw mode.  Maybe I
   am the only person in the world this is true for.  Sigh.)

FWIW, I find this also annoying when using -nw.  One would expect that
disabling font-lock would disable font-lock...

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

* Re: can't turn off font-lock
  2007-08-12 22:11       ` Stefan Monnier
@ 2007-08-12 22:54         ` Karl Berry
  2007-08-12 23:15           ` Andreas Schwab
                             ` (4 more replies)
  0 siblings, 5 replies; 37+ messages in thread
From: Karl Berry @ 2007-08-12 22:54 UTC (permalink / raw)
  To: monnier; +Cc: rms, emacs-devel

    You may be better off changing to not use font-lock, and then provide
    a patch for it: I'd consider it as a bug-fix.

Well, these functions never relied on font-lock before 22.1, so I hope
there was some excellent reason for going to all the trouble of
implementing it that way.  Now going to even more trouble to unimplement
it seems painful, although I don't expect we can just revert, either.
Sigh.

    most faces to look like `default' because I find them annoying/useless

Maybe the defaults should be less fancy.  But that's a different discussion.

    (e.g. font-lock-keyword-face).

I have a lot of trouble figuring out the face names to disable; it takes
me major research to get from output in some non-default face in some
buffer back to the actual face-symbol to disable.  (This is why I was
devoutly hoping that "(global-font-lock-mode 0)" would just work.)

Eli's mention of "C-u C-x =" is very helpful, I had missed that in the
manual.  When I run it in the filenames in the grep output (after -nw
this time), I see the face listed as "(compilation-info underline
underline)".  And unfortunately, I have no idea how to translate that
into a face name to disable without delving into the sources, which is
what I was doing anyway.  Oh well.  Is there a better way?

Meanwhile, I have also never been able to figure out how to disable an
individual face (and could find no documentation about it, either).  I
gather I'm supposed to set whatever-face-symbol to 'default or "default"
or something?  Can you show me how you do it, please?

(For example, it occurred to me that another way to achieve my faceless
desires would be to somehow define "bold", "italic", and so on to all
map to "default".  No luck with anything I tried in that direction,
either.)

Thanks,
Karl

^ permalink raw reply	[flat|nested] 37+ 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; 37+ 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] 37+ messages in thread

* Re: can't turn off font-lock
  2007-08-12 17:56 ` Richard Stallman
  2007-08-12 19:53   ` Stefan Monnier
  2007-08-12 21:48   ` Karl Berry
@ 2007-08-12 22:54   ` Karl Berry
  2007-08-13  2:31     ` Eli Zaretskii
  2007-08-13  5:00     ` Richard Stallman
  2 siblings, 2 replies; 37+ messages in thread
From: Karl Berry @ 2007-08-12 22:54 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

> I most definitely do observe fontish things happening:

I'm sorry, my mistake.  I was mistakenly invoking a prior version of Emacs.
With 22.1, I don't see any fontification in M-x shell after
(global-font-lock-mode 0).  Yay.

I did notice another place where it happens in 22.1, though: a simple
M-x shows the "M-x " prompt in blue (in emacs-under-x), likewise other
prompts (e.g., "Eval: " after M-x eval-expression RET).

Thanks,
karl

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

* Re: can't turn off font-lock
  2007-08-12 22:54         ` Karl Berry
@ 2007-08-12 23:15           ` Andreas Schwab
  2007-08-13  2:38             ` Eli Zaretskii
  2007-08-12 23:24           ` Juri Linkov
                             ` (3 subsequent siblings)
  4 siblings, 1 reply; 37+ messages in thread
From: Andreas Schwab @ 2007-08-12 23:15 UTC (permalink / raw)
  To: Karl Berry; +Cc: emacs-devel, monnier, rms

karl@freefriends.org (Karl Berry) writes:

> Eli's mention of "C-u C-x =" is very helpful, I had missed that in the
> manual.  When I run it in the filenames in the grep output (after -nw
> this time), I see the face listed as "(compilation-info underline
> underline)".  And unfortunately, I have no idea how to translate that
> into a face name to disable without delving into the sources, which is
> what I was doing anyway.  Oh well.  Is there a better way?

Just click on it.

> Meanwhile, I have also never been able to figure out how to disable an
> individual face (and could find no documentation about it, either).  I
> gather I'm supposed to set whatever-face-symbol to 'default or "default"
> or something?  Can you show me how you do it, please?

M-x customize-face RET

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: can't turn off font-lock
  2007-08-12 22:54         ` Karl Berry
  2007-08-12 23:15           ` Andreas Schwab
@ 2007-08-12 23:24           ` Juri Linkov
  2007-08-13 22:14             ` Karl Berry
  2007-08-13  2:37           ` Eli Zaretskii
                             ` (2 subsequent siblings)
  4 siblings, 1 reply; 37+ messages in thread
From: Juri Linkov @ 2007-08-12 23:24 UTC (permalink / raw)
  To: Karl Berry; +Cc: emacs-devel, monnier, rms

> Meanwhile, I have also never been able to figure out how to disable an
> individual face (and could find no documentation about it, either).  I
> gather I'm supposed to set whatever-face-symbol to 'default or "default"
> or something?  Can you show me how you do it, please?

You can try this code to disable face attributes of all faces:

  (mapc (lambda (face) (modify-face face)) (face-list))

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ 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; 37+ 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] 37+ messages in thread

* Re: can't turn off font-lock
  2007-08-12 22:54   ` Karl Berry
@ 2007-08-13  2:31     ` Eli Zaretskii
  2007-08-13  5:00     ` Richard Stallman
  1 sibling, 0 replies; 37+ messages in thread
From: Eli Zaretskii @ 2007-08-13  2:31 UTC (permalink / raw)
  To: Karl Berry; +Cc: emacs-devel

> Date: Sun, 12 Aug 2007 17:54:30 -0500
> From: karl@freefriends.org (Karl Berry)
> Cc: emacs-devel@gnu.org
> 
> I did notice another place where it happens in 22.1, though: a simple
> M-x shows the "M-x " prompt in blue (in emacs-under-x), likewise other
> prompts (e.g., "Eval: " after M-x eval-expression RET).

That's a face called `minibuffer-prompt'; customize it to be as
`default', if you don't want to see it.

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

* Re: can't turn off font-lock
  2007-08-12 22:54         ` Karl Berry
  2007-08-12 23:15           ` Andreas Schwab
  2007-08-12 23:24           ` Juri Linkov
@ 2007-08-13  2:37           ` Eli Zaretskii
  2007-08-13  5:00           ` Richard Stallman
  2007-08-13 19:56           ` Eli Zaretskii
  4 siblings, 0 replies; 37+ messages in thread
From: Eli Zaretskii @ 2007-08-13  2:37 UTC (permalink / raw)
  To: Karl Berry; +Cc: emacs-devel

> Date: Sun, 12 Aug 2007 17:54:01 -0500
> From: karl@freefriends.org (Karl Berry)
> Cc: rms@gnu.org, emacs-devel@gnu.org
> 
> Eli's mention of "C-u C-x =" is very helpful, I had missed that in the
> manual.  When I run it in the filenames in the grep output (after -nw
> this time), I see the face listed as "(compilation-info underline
> underline)".  And unfortunately, I have no idea how to translate that
> into a face name to disable without delving into the sources, which is
> what I was doing anyway.  Oh well.  Is there a better way?

Yes: go to the face name and press RET.  You will be presented with
the Custom buffer where you can customize this face.

The face name, btw, is the first part: `compilation-info'.

> Meanwhile, I have also never been able to figure out how to disable an
> individual face (and could find no documentation about it, either).  I
> gather I'm supposed to set whatever-face-symbol to 'default or "default"
> or something?  Can you show me how you do it, please?

One way is to use defface to have the face inherit from `default'.
See the examples in the various *.el files (search for ":inherit").

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

* Re: can't turn off font-lock
  2007-08-12 23:15           ` Andreas Schwab
@ 2007-08-13  2:38             ` Eli Zaretskii
  0 siblings, 0 replies; 37+ messages in thread
From: Eli Zaretskii @ 2007-08-13  2:38 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: emacs-devel, monnier, rms, karl

> From: Andreas Schwab <schwab@suse.de>
> Date: Mon, 13 Aug 2007 01:15:00 +0200
> Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, rms@gnu.org
> 
> karl@freefriends.org (Karl Berry) writes:
> 
> > Eli's mention of "C-u C-x =" is very helpful, I had missed that in the
> > manual.  When I run it in the filenames in the grep output (after -nw
> > this time), I see the face listed as "(compilation-info underline
> > underline)".  And unfortunately, I have no idea how to translate that
> > into a face name to disable without delving into the sources, which is
> > what I was doing anyway.  Oh well.  Is there a better way?
> 
> Just click on it.

Or type RET with point on the face's name.

^ permalink raw reply	[flat|nested] 37+ 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; 37+ 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] 37+ messages in thread

* Re: can't turn off font-lock
  2007-08-12 21:48   ` Karl Berry
@ 2007-08-13  5:00     ` Richard Stallman
  0 siblings, 0 replies; 37+ messages in thread
From: Richard Stallman @ 2007-08-13  5:00 UTC (permalink / raw)
  To: Karl Berry; +Cc: emacs-devel

    Maybe I am using the wrong word, but when I do this:

    $ emacs -q --no-site 
    M-x eval-expression RET (global-font-lock-mode 0) RET
    M-x shell RET pwd RET

    I most definitely do observe fontish things happening:
    - my shell prompt is in a turquoise color.
    - after typing a command (say, "pwd") and hitting RET,
      the command is emboldened.

If someone can reproduce it, he can investigate how it happens.

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

* Re: can't turn off font-lock
  2007-08-12 22:54   ` Karl Berry
  2007-08-13  2:31     ` Eli Zaretskii
@ 2007-08-13  5:00     ` Richard Stallman
  2007-08-13 23:31       ` Karl Berry
  2007-08-13 23:31       ` Karl Berry
  1 sibling, 2 replies; 37+ messages in thread
From: Richard Stallman @ 2007-08-13  5:00 UTC (permalink / raw)
  To: Karl Berry; +Cc: emacs-devel

    I did notice another place where it happens in 22.1, though: a simple
    M-x shows the "M-x " prompt in blue (in emacs-under-x), likewise other
    prompts (e.g., "Eval: " after M-x eval-expression RET).

That is not font-lock mode.  Emacs uses a different face for the prompt.

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

* Re: can't turn off font-lock
  2007-08-12 22:54         ` Karl Berry
                             ` (2 preceding siblings ...)
  2007-08-13  2:37           ` Eli Zaretskii
@ 2007-08-13  5:00           ` Richard Stallman
  2007-08-13 19:56           ` Eli Zaretskii
  4 siblings, 0 replies; 37+ messages in thread
From: Richard Stallman @ 2007-08-13  5:00 UTC (permalink / raw)
  To: Karl Berry; +Cc: monnier, emacs-devel

    Meanwhile, I have also never been able to figure out how to disable an
    individual face (and could find no documentation about it, either).  I
    gather I'm supposed to set whatever-face-symbol to 'default or "default"
    or something?  Can you show me how you do it, please?

This is documented in the Emacs manual.  There are entire sections on faces.
Did you read them?

    (For example, it occurred to me that another way to achieve my faceless
    desires would be to somehow define "bold", "italic", and so on to all
    map to "default".  No luck with anything I tried in that direction,
    either.)

That is a very bad idea for how to turn off font lock.

^ permalink raw reply	[flat|nested] 37+ 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; 37+ 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] 37+ messages in thread

* Re: can't turn off font-lock
  2007-08-12 19:53   ` Stefan Monnier
  2007-08-12 21:48     ` Karl Berry
@ 2007-08-13  5:01     ` Richard Stallman
  1 sibling, 0 replies; 37+ messages in thread
From: Richard Stallman @ 2007-08-13  5:01 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel, karl

    Because grep relies on compilation-mode, which uses font-lock to do its
    work, so it forcefully enables font-lock.

It seems like a bug for it to work this way.

What it ought to do is enable Font Lock in an internal way, so it will
put on font-lock-face properties.  These properties should be created
regardless of whether Font Lock mode is enabled, but they should
only affect display when Font Lock mode is enabled.

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

* Re: can't turn off font-lock
  2007-08-12 22:54         ` Karl Berry
                             ` (3 preceding siblings ...)
  2007-08-13  5:00           ` Richard Stallman
@ 2007-08-13 19:56           ` Eli Zaretskii
  4 siblings, 0 replies; 37+ messages in thread
From: Eli Zaretskii @ 2007-08-13 19:56 UTC (permalink / raw)
  To: Karl Berry; +Cc: emacs-devel

> Date: Sun, 12 Aug 2007 17:54:01 -0500
> From: karl@freefriends.org (Karl Berry)
> Cc: rms@gnu.org, emacs-devel@gnu.org
> 
> Eli's mention of "C-u C-x =" is very helpful, I had missed that in the
> manual.

Btw, how did you search for it in the manual?  Perhaps indexing needs
improvement.

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

* Re: can't turn off font-lock
  2007-08-12 23:24           ` Juri Linkov
@ 2007-08-13 22:14             ` Karl Berry
  2007-08-13 23:27               ` Juri Linkov
  0 siblings, 1 reply; 37+ messages in thread
From: Karl Berry @ 2007-08-13 22:14 UTC (permalink / raw)
  To: juri, emacs-devel

      (mapc (lambda (face) (modify-face face)) (face-list))

Thanks Juri, that's very helpful.  I discovered I don't really want mode
line faces disabled :), so I'm playing with some conditions, but that's
a detail.  And it has to be run after packages get loaded, since of
course it can't disable faces that don't exist yet.  Another detail.  At
least now I know how to shut them off.

Karl

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

* Re: can't turn off font-lock
  2007-08-13 22:14             ` Karl Berry
@ 2007-08-13 23:27               ` Juri Linkov
  0 siblings, 0 replies; 37+ messages in thread
From: Juri Linkov @ 2007-08-13 23:27 UTC (permalink / raw)
  To: Karl Berry; +Cc: emacs-devel

>       (mapc (lambda (face) (modify-face face)) (face-list))
>
> Thanks Juri, that's very helpful.  I discovered I don't really want mode
> line faces disabled :), so I'm playing with some conditions, but that's
> a detail.  And it has to be run after packages get loaded, since of
> course it can't disable faces that don't exist yet.  Another detail.  At
> least now I know how to shut them off.

I use the following trick to post-process faces immediately after they
get created.  I also modified this code to not reset mode line faces:

(defun my-faces-fix (&optional frame)
  "Fix defined faces."
  (interactive)
  ;; Check if this function is called by `custom-define-hook' from
  ;; `custom-declare-face' where the variable `face' is bound locally.
  (when (boundp 'face)
    (dolist (face (face-list))
      (unless (memq face '(mode-line mode-line-highlight mode-line-inactive))
        ;; Reset all face attributes
        (modify-face face)))))

;; 1. Fix existing faces
(let ((face t)) (my-faces-fix))

;; 2. Call `my-faces-fix' every time some new face gets defined
(add-to-list 'custom-define-hook 'my-faces-fix)

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 37+ 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; 37+ 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] 37+ messages in thread

* Re: can't turn off font-lock
  2007-08-13  5:00     ` Richard Stallman
@ 2007-08-13 23:31       ` Karl Berry
  2007-08-14  3:26         ` Eli Zaretskii
  2007-08-14 16:06         ` Richard Stallman
  2007-08-13 23:31       ` Karl Berry
  1 sibling, 2 replies; 37+ messages in thread
From: Karl Berry @ 2007-08-13 23:31 UTC (permalink / raw)
  To: emacs-devel

    That is not font-lock mode.  Emacs uses a different face for the prompt.

>From a user's point of view, I can say that this apparently-crucial
distinction between font-lock faces and non-font-lock faces is utterly
obscure (I'll send a separate msg about that), and it just seems weird
that (global-font-lock-mode 0) doesn't turn off everything.  

If you feel it's inappropriate for (global-font-lock-mode 0) to turn off
such things, then how about another feature that turns off all these
colorizations and such things?  As in, (black-and-white-emacs) ...

As I wrote in other msgs, it is quite painful to discover and turn off
all the face names individually.  (E.g., C-u C-x = isn't usable with
minibuffer text, mode lines, etc.)

If this isn't going to happen, then I suggest adding something to the
Font Lock node saying that it does not affect all faces.

karl

P.S. I also noticed that the startup screen and *scratch* buffer text are
colorized, although I was turning off font-lock on the cmd line:
  emacs-22.1 -q --no-site --eval "(global-font-lock-mode 0)"
The mode lines also use gray rather than black and white.
(Not that these particular things are very important to me.)

I imagine these are more instances of non-font-lock faces.  Just
mentioning it for the archives.

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

* Re: can't turn off font-lock
  2007-08-13  5:00     ` Richard Stallman
  2007-08-13 23:31       ` Karl Berry
@ 2007-08-13 23:31       ` Karl Berry
  2007-08-13 23:51         ` Stefan Monnier
  2007-08-14 16:06         ` Richard Stallman
  1 sibling, 2 replies; 37+ messages in thread
From: Karl Berry @ 2007-08-13 23:31 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

About documentation and font-lock vs non-font-lock faces.

For instance, the third paragraph of the Faces node says this:

     Emacs uses faces automatically for highlighting, through the work of
  Font Lock mode.

This statement is one of the reasons why I conflated Faces and Font Lock
in the first place.  To me, making the minibuffer text appear in blue,
or the mode line in some kind of reverse video, or grep hits in yellow,
is "highlighting".  Everything that isn't normal text was "highlighting",
in my naive understanding.  Oh well.

I can suggest explicitly stating something like "Emacs also uses faces
in other circumstances, not related to Font Lock".

Also, that node's section title is "Using Multiple Typefaces".  This
also misled me.  Emacs' faces are hardly the same as typographic
typefaces; they are at least as much about, well, highlighting (via bold
or underline or whatever), as about choosing Times Roman
vs. Helvetica.  I suggest that simply "Faces" would be a less misleading
name.  Anything that doesn't use the word "Typeface" would be an
improvement, IMHO.

k

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

* Re: can't turn off font-lock
  2007-08-13 23:31       ` Karl Berry
@ 2007-08-13 23:51         ` Stefan Monnier
  2007-08-14 16:06           ` Richard Stallman
  2007-08-14 16:06         ` Richard Stallman
  1 sibling, 1 reply; 37+ messages in thread
From: Stefan Monnier @ 2007-08-13 23:51 UTC (permalink / raw)
  To: Karl Berry; +Cc: rms, emacs-devel

> This statement is one of the reasons why I conflated Faces and Font Lock
> in the first place.

The intention in Emacs-22 is indeed to conflate the two, but it hasn;t been
done consistently.


        Stefan

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

* Re: can't turn off font-lock
  2007-08-13 23:31       ` Karl Berry
@ 2007-08-14  3:26         ` Eli Zaretskii
  2007-08-14 16:06         ` Richard Stallman
  1 sibling, 0 replies; 37+ messages in thread
From: Eli Zaretskii @ 2007-08-14  3:26 UTC (permalink / raw)
  To: Karl Berry; +Cc: emacs-devel

> Date: Mon, 13 Aug 2007 18:31:08 -0500
> From: karl@freefriends.org (Karl Berry)
> 
> As I wrote in other msgs, it is quite painful to discover and turn off
> all the face names individually.  (E.g., C-u C-x = isn't usable with
> minibuffer text, mode lines, etc.)

Did you actually try to use "C-u C-x =" in the minibuffer?  It works
for me.

But I agree that discovering the faces is a job best avoided.

> If you feel it's inappropriate for (global-font-lock-mode 0) to turn off
> such things, then how about another feature that turns off all these
> colorizations and such things?  As in, (black-and-white-emacs) ...

I think it makes a lot of sense to have either global-font-lock-mode
turn off all faces (perhaps with minor exceptions, like mode line and
fringe?) or to have another option to do that in one go.

> P.S. I also noticed that the startup screen and *scratch* buffer text are
> colorized, although I was turning off font-lock on the cmd line:
>   emacs-22.1 -q --no-site --eval "(global-font-lock-mode 0)"

Try doing that in one of the hooks defined by startup.el, it could be
that the command-line args are processed too late for them to have any
effect on the initial display.

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

* Re: can't turn off font-lock
  2007-08-13 23:51         ` Stefan Monnier
@ 2007-08-14 16:06           ` Richard Stallman
  0 siblings, 0 replies; 37+ messages in thread
From: Richard Stallman @ 2007-08-14 16:06 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel, karl

    > This statement is one of the reasons why I conflated Faces and Font Lock
    > in the first place.

    The intention in Emacs-22 is indeed to conflate the two, but it hasn;t been
    done consistently.

That's true for highlighting of buffers due to major modes, but there
are other kinds of highlighting in Emacs.  For instance, of minibuffer
prompts, and Custom buffers.

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

* Re: can't turn off font-lock
  2007-08-13 23:31       ` Karl Berry
  2007-08-13 23:51         ` Stefan Monnier
@ 2007-08-14 16:06         ` Richard Stallman
  1 sibling, 0 replies; 37+ messages in thread
From: Richard Stallman @ 2007-08-14 16:06 UTC (permalink / raw)
  To: Karl Berry; +Cc: emacs-devel

This should make it clearer.  Thanks.

  Most major modes assign faces to the text automatically through the
work of Font Lock mode.  @xref{Font Lock}, for more information about
Font Lock mode and syntactic highlighting.  You can print the current
buffer with the highlighting that appears on your screen using the
command @code{ps-print-buffer-with-faces}.  @xref{PostScript}.

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

* Re: can't turn off font-lock
  2007-08-13 23:31       ` Karl Berry
  2007-08-14  3:26         ` Eli Zaretskii
@ 2007-08-14 16:06         ` Richard Stallman
  1 sibling, 0 replies; 37+ messages in thread
From: Richard Stallman @ 2007-08-14 16:06 UTC (permalink / raw)
  To: Karl Berry; +Cc: emacs-devel

    >From a user's point of view, I can say that this apparently-crucial
    distinction between font-lock faces and non-font-lock faces is utterly
    obscure (I'll send a separate msg about that), and it just seems weird
    that (global-font-lock-mode 0) doesn't turn off everything.  

I do not want to eliminate the possibility of highlighting under
explicit program control.  For instance, it makes no sense to turn off
the faces in a Custom buffer.

    If this isn't going to happen, then I suggest adding something to the
    Font Lock node saying that it does not affect all faces.

I don't see anything which suggests it does.  Where did you get that
mistaken idea?  If you show me some text which seems to suggest it,
I can clarify that text.

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

end of thread, other threads:[~2007-08-14 16:06 UTC | newest]

Thread overview: 37+ 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
2007-08-12 17:56 ` Richard Stallman
2007-08-12 19:53   ` Stefan Monnier
2007-08-12 21:48     ` Karl Berry
2007-08-12 22:11       ` Stefan Monnier
2007-08-12 22:54         ` Karl Berry
2007-08-12 23:15           ` Andreas Schwab
2007-08-13  2:38             ` Eli Zaretskii
2007-08-12 23:24           ` Juri Linkov
2007-08-13 22:14             ` Karl Berry
2007-08-13 23:27               ` Juri Linkov
2007-08-13  2:37           ` Eli Zaretskii
2007-08-13  5:00           ` Richard Stallman
2007-08-13 19:56           ` Eli Zaretskii
2007-08-12 22:44       ` Alfred M. Szmidt
2007-08-13  5:01     ` Richard Stallman
2007-08-12 21:48   ` Karl Berry
2007-08-13  5:00     ` Richard Stallman
2007-08-12 22:54   ` Karl Berry
2007-08-13  2:31     ` Eli Zaretskii
2007-08-13  5:00     ` Richard Stallman
2007-08-13 23:31       ` Karl Berry
2007-08-14  3:26         ` Eli Zaretskii
2007-08-14 16:06         ` Richard Stallman
2007-08-13 23:31       ` Karl Berry
2007-08-13 23:51         ` Stefan Monnier
2007-08-14 16:06           ` Richard Stallman
2007-08-14 16:06         ` Richard Stallman

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.