GNU bug report logs - #70807
Resetting *-local variables before parsing

Previous Next

Package: auctex;

Reported by: Arash Esbati <arash <at> gnu.org>

Date: Mon, 6 May 2024 19:11:02 UTC

Severity: normal

To reply to this bug, email your comments to 70807 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-auctex <at> gnu.org:
bug#70807; Package auctex. (Mon, 06 May 2024 19:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arash Esbati <arash <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Mon, 06 May 2024 19:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: "auctex-bugs" <bug-auctex <at> gnu.org>
Subject: Resetting *-local variables before parsing
Date: Mon, 06 May 2024 21:10:05 +0200
Hi all,

please save this small file on your HD and call it 'minimal-test.tex'.

--8<---------------cut here---------------start------------->8---
\documentclass{article}

\begin{document}
text body.
\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
--8<---------------cut here---------------end--------------->8---

Now set `TeX-parse-self' to t and open the file, hit 'C-c C-n' and the
parsed file 'minimal-test.el' should look like this:

--8<---------------cut here---------------start------------->8---
;; -*- lexical-binding: t; -*-

(TeX-add-style-hook
 "minimal-test"
 (lambda ()
   (TeX-run-style-hooks
    "latex2e"
    "article"
    "art10"))
 :latex)
--8<---------------cut here---------------end--------------->8---

Now move point into preamble and do

   C-c C-m usepackage RET hyperref RET RET C-c C-n

minimal-test.el should look like this now:

--8<---------------cut here---------------start------------->8---
;; -*- lexical-binding: t; -*-

(TeX-add-style-hook
 "minimal-test"
 (lambda ()
   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "href")
   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperimage")
   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperbaseurl")
   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "nolinkurl")
   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "url")
   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "path")
   (add-to-list 'LaTeX-verbatim-macros-with-delims-local "path")
   (TeX-run-style-hooks
    "latex2e"
    "article"
    "art10"
    "hyperref"))
 :latex)
--8<---------------cut here---------------end--------------->8---

Now comment out the \usepackage{hyperref} and again 'C-c C-n', the
file looks like this:

--8<---------------cut here---------------start------------->8---
;; -*- lexical-binding: t; -*-

(TeX-add-style-hook
 "minimal-test"
 (lambda ()
   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "path")
   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "url")
   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "nolinkurl")
   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperbaseurl")
   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperimage")
   (add-to-list 'LaTeX-verbatim-macros-with-braces-local "href")
   (add-to-list 'LaTeX-verbatim-macros-with-delims-local "path")
   (TeX-run-style-hooks
    "latex2e"
    "article"
    "art10"))
 :latex)
--8<---------------cut here---------------end--------------->8---

Note how the entry for "hyperref" is gone, but not the add-to-list
forms; the value of LaTeX-verbatim-* are not reset.  This probably
applies for `LaTeX-verbatim-environments-local', but I didn't check.

For me, the value of the -local version should be reset somewhere before
parsing and running the style hooks again, but I couldn't find an
appropriate place.  Does this approach make sense?  And if yes, any idea
where to put the reset?  Any comments welcome.

Best, Arash




This bug report was last modified 200 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.