[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: Reiner Steib
Subject: [AUCTeX] Re: Customizing behavior TeX-insert-quote in comments
Date: Thu, 10 Aug 2006 10:00:51 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

On Thu, Aug 10 2006, Ralf Angeli wrote:

> * Reiner Steib (2006-08-09) writes:
>> 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.

Shouldn't we also test for a non-nil value of `font-lock-mode'?

          (and (boundp 'font-lock-mode)
               font-lock-mode ;; <-- Test if font-lock is turned on.
               (fboundp 'font-latex-faces-present-p)
               (font-latex-faces-present-p TeX-quote-force-quote-faces)
               (font-latex-faces-present-p TeX-quote-force-quote-faces
                                           (1- (point))))

Okay, probably it's not much faster.

A more radical idea (sorry, I didn't look into the code in detail, so
maybe this is nonsense):

Couldn't the functions `TeX-in-comment' (and friends) and `texmathp'
test via font-lock (if turned on)?

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

IIRC I sometimes switched from comment to text and back (M-;) when I
wanted to edit a comment.

Bye, Reiner.
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |

reply via email to

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