bug-auctex
[Top][All Lists]
Advanced

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

Re: [Bug-AUCTeX] 11.86; LaTeX-current-environment related bug


From: Mosè Giordano
Subject: Re: [Bug-AUCTeX] 11.86; LaTeX-current-environment related bug
Date: Fri, 24 May 2013 23:44:18 +0200

Hi David,

2013/5/24 David Kastrup <address@hidden>:
> Huh? fontification is _lazy_ by default.  Off-screen areas are not
> fontified unless you page over them.
>
> Check out the documentation for jit-lock-mode, the variant of font-lock
> that is active as Emacs' _default_.
Ok, got it, thanks for the reference.

Moreover, replacing `TeX-in-commented-line' with `TeX-in-comment'
inside `LaTeX-current-environment' makes it a recursive function.  In
some situations I get
  Debugger entered--Lisp error: (error "Lisp nesting exceeds
`max-lisp-eval-depth'")
So probably using `TeX-in-comment' isn't a good idea at all.

How about not checking comments in `LaTeX-current-environment'?  I.e.,
something like
--8<---------------cut here---------------start------------->8---
  (setq arg (if arg (if (< arg 1) 1 arg) 1))
  (save-excursion
    (while (and (/= arg 0)
        (re-search-backward
         "\\\\\\(begin\\|end\\) *{ *\\([A-Za-z*]+\\) *}" nil t))
      (setq arg (if (string= (match-string 1) "end") (1+ arg) (1- arg)))))
  (if (/= arg 0)
      "document"
    (match-string-no-properties 2))
--8<---------------cut here---------------end--------------->8---
This has definitely side effects, but also make it possible to put a
dummy \begin{} or \end{} inside comment to help AUCTeX guess current
environment, much like (info "(auctex) Known problems").

Do you have other ideas?

Bye,
Mosè



reply via email to

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