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: David Kastrup
Subject: Re: [Bug-AUCTeX] 11.86; LaTeX-current-environment related bug
Date: Sat, 25 May 2013 08:47:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Mosè Giordano <address@hidden> writes:

> 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
>   (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))
> 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").

How would that play together with docTeX-mode?  In docTeX-mode, things
like

%    \begin{macrocode}
\newenvironment{blubla}[1]
{
  \begin{centering}
%    \end{macrocode}
% We now try inserting the element
%    \begin{macrocode}
     #1
  \end{centering}%
}{}
%    \end{macrocode}

are pretty frequent.

-- 
David Kastrup



reply via email to

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