[Top][All Lists]

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

[AUCTeX] Re: Customizing behavior TeX-insert-quote in comments

From: Ralf Angeli
Subject: [AUCTeX] Re: Customizing behavior TeX-insert-quote in comments
Date: Thu, 10 Aug 2006 07:41:07 +0200

* Reiner Steib (2006-08-09) writes:

> On Wed, Aug 09 2006, Ralf Angeli wrote:
>> * Reiner Steib (2006-08-09) writes:
>>> But I'm not sure if it's the right approach.  Especially it's not
>>> clear to me why we check for comments and math two times (font-lock
>>> and `texmathp').
>> There are people who don't use font locking.
> Sure.  But is the font-lock based detection (`font-latex-math-face',
> `font-lock-comment-face') more reliable than `texmathp' and
> `TeX-in-comment'?

No, but it's much faster (at least in comparison to `texmpathp').  So
checking the presence of certain faces is just a shortcut in case font
locking is turned on to not run tests which take longer if we already
found something.

>>> Comments?
>>> +(defcustom TeX-quote-force-quote-faces '(font-latex-verbatim-face
>>> +                                    font-latex-math-face
>>> +                                    font-lock-comment-face)
>> I'd rather use a defcustom which does not exhibit implementation
>> details.  A list of symbols, e.g. 'verbatim, 'math, 'comments, with
>> respective explanatory strings for the defcustom could do.
> Well, this would require a mapping from these symbols to the faces, so
> that the user cannot add arbitrary faces anymore.

Yes, but checking for faces is not a way of reliably checking for the
constructs we are interested in anyway.  If you want that configurable
we could use an alist where the first element of each item would be a
symbol depicting the type (verbatim, math, comments) and the second a
predicate for checking the construct (e.g. `(lambda () (or
(font-latex-faces-present-p 'font-latex-math-face) (texmathp)))').

But I don't really want to expose something like this to the user for
the feature we are talking about.  In the end I didn't even think that
anybody would want to configure it at all.  That's why there is no
configuratio option.  And even though there is now a request for a
configuration option, that's likely to be one of those rare cases.


reply via email to

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