[Top][All Lists]

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

[AUCTeX-devel] Re: Font-lock of []{} in the CVS version

From: Christian Schlauer
Subject: [AUCTeX-devel] Re: Font-lock of []{} in the CVS version
Date: Mon, 23 Jul 2007 20:54:58 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Ralf Angeli <address@hidden> writes:

> * Christian Schlauer (2007-07-15) writes:


>> Personally, I liked the previous behaviour. I think the parentheses
>> get too much `weight' now due to the black colour. They aren't text
>> that will appear in the output, and previously, their `visual impact'
>> when reading the source was reduced by the font-locking.
> That's a strange perception because font locking is often called
> highlighting, not lowlighting.  So font-locked text is supposed to stand
> out.

I don't see it from that point of view. Hmm. Maybe it is like this (at
least for me): font-locked text stands out. Always. But as one gets
used to the different faces, one interprets some faces like
`font-lock-comment-face' as less important (as these comments never
get executed) than for example `font-lock-keyword-face'. So the user
develops a `ranking' of the faces, where `font-lock-warning-face' is
probably at the top and `font-lock-comment-face' is somewhere at the
lower end, but definitely below the `default' face. And every face
below `default' in the ranking is not interpreted as highlighted, but
lowlighted (by the user's brain). I think that's a nice theory. :-)

>> IMO, they
>> look too dominant now.
> Please look at something like \chapter{foo} and say that again. (c:

Okay, I have to admit that's more dominant than the parens --
actually, \part{Long-title-spanning-over-several-lines} beats
everything else concerning dominance.

>> was this change intentional?
> Yes.


>> If so, why is
>> this font-locking of parens preferred?
> Because braces are not part of the macro parameter, they are just
> delimiters.

That's true. Your change makes sense.

But wait! What about $foo$? All five letters are in
`font-latex-math-face'. Aren't the `$' just delimiters? ;-)

(Please don't make the `$'s black now!)

>> Can I customize this?
> No.
> It shouldn't be too difficult (even for a user) to give braces and
> brackets a face like `font-latex-sedate-face'.  Perhaps I'll experiment
> with that.

That would be nice. What does `not too difficult' mean? Is it like two
lines of elisp in `LaTeX-mode-hook'? I think that would be nice to

[*A few trials later ...*]

Regarding the "shouldn't be too difficult": the following works (as it
is more or less copied verbatim from C-h f font-lock-add-keywords):

(add-hook 'LaTeX-mode-hook
          (lambda ()
             '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)))))

But if I replace `font-lock-warning-face' with
`font-latex-sedate-face', it breaks already!? Tested by starting a
fresh Emacs, copying the statement into the *scratch* buffer, C-x C-e,
and opening a LaTeX file containing `FIXME:'.
> But before I want to finish the font locking changes.

Of course.

Christian Schlauer

reply via email to

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