GNU bug report logs -
#78296
Hand-written styles with `LaTeX-provided-package-options'
Previous Next
To reply to this bug, email your comments to 78296 AT debbugs.gnu.org.
There is no need to reopen the bug first.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-auctex <at> gnu.org
:
bug#78296
; Package
auctex
.
(Wed, 07 May 2025 08:18: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
.
(Wed, 07 May 2025 08:18:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi all,
say you have a .tex file like this:
--8<---------------cut here---------------start------------->8---
\documentclass[11pt]{article}
\usepackage{mypackage}
\begin{document}
foo
\end{document}
%%% Local Variables:
%%% mode: LaTeX
%%% TeX-master: t
%%% End:
--8<---------------cut here---------------end--------------->8---
loading mypackage.sty and you have also written an AUCTeX style file
mypackage.el which looks like this:
--8<---------------cut here---------------start------------->8---
;;; -*- lexical-binding: t; -*-
(TeX-add-style-hook
"mypackage"
(lambda ()
(TeX-add-to-alist 'LaTeX-provided-class-options
'(("article" "11pt")))
(TeX-add-to-alist 'LaTeX-provided-package-options
'(("babel" "english")
("booktabs" "")
("fontspec" "")
("geometry" "a4paper")
("graphicx" "")
("lastpage" "")
("microtype" "activate")
("parskip" "")
("siunitx" "")
("tabularx" "")
("titlesec" "pagestyles")
("xcolor" "svgnames")
("xspace" "")))
(TeX-run-style-hooks
"article"
"babel"
"booktabs"
"fontspec"
"geometry"
"graphicx"
"lastpage"
"microtype"
"parskip"
"siunitx"
"tabularx"
"titlesec"
"xcolor"
"xspace"))
TeX-dialect)
--8<---------------cut here---------------end--------------->8---
IIUC, the hand-written additions to `LaTeX-provided-package-options' and
`LaTeX-provided-class-options' are never activated in the .tex file. I
played with moving these forms around from `LaTeX-auto-cleanup':
(setq LaTeX-provided-class-options nil)
(setq LaTeX-provided-package-options nil)
but no avail. The best solution I can currently offer is:
--8<---------------cut here---------------start------------->8---
diff --git a/latex.el b/latex.el
index 3a32c4e7..8b35851a 100644
--- a/latex.el
+++ b/latex.el
@@ -1943,6 +1943,8 @@ For example, its value will be
...)
See also `LaTeX-provided-package-options'.")
+(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-provided-class-options)
+
(defun LaTeX-provided-class-options-member (class option)
"Return non-nil if OPTION has been given to CLASS at load time.
The value is actually the tail of the list of options given to CLASS."
@@ -1966,6 +1968,8 @@ For example, its value will be
...)
See also `LaTeX-provided-class-options'.")
+(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-provided-package-options)
+
(defun LaTeX-provided-package-options-member (package option)
"Return non-nil if OPTION has been given to PACKAGE at load time.
The value is actually the tail of the list of options given to PACKAGE."
@@ -2140,8 +2144,8 @@ TYPE is one of the symbols mac or env."
LaTeX-auto-bibliography)))
;; Reset class and packages options for the current buffer
- (setq LaTeX-provided-class-options nil)
- (setq LaTeX-provided-package-options nil)
+ ;; (setq LaTeX-provided-class-options nil)
+ ;; (setq LaTeX-provided-package-options nil)
;; Cleanup document classes and packages
(unless (null LaTeX-auto-style)
--8<---------------cut here---------------end--------------->8---
I.e., adding the variables to `TeX-normal-mode-reset-list' and deleting
the forms inside `LaTeX-auto-cleanup'. Am I missing something?
Best, Arash
Information forwarded
to
bug-auctex <at> gnu.org
:
bug#78296
; Package
auctex
.
(Fri, 09 May 2025 09:06:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 78296 <at> debbugs.gnu.org (full text, mbox):
Hi Arash,
>>>>> Arash Esbati <arash <at> gnu.org> writes:
> --8<---------------cut here---------------start------------->8---
> \documentclass[11pt]{article}
> \usepackage{mypackage}
> \begin{document}
> foo
> \end{document}
> %%% Local Variables:
> %%% mode: LaTeX
> %%% TeX-master: t
> %%% End:
> --8<---------------cut here---------------end--------------->8---
> loading mypackage.sty and you have also written an AUCTeX style file
> mypackage.el which looks like this:
> --8<---------------cut here---------------start------------->8---
> ;;; -*- lexical-binding: t; -*-
> (TeX-add-style-hook
> "mypackage"
> (lambda ()
> (TeX-add-to-alist 'LaTeX-provided-class-options
> '(("article" "11pt")))
> (TeX-add-to-alist 'LaTeX-provided-package-options
> '(("babel" "english")
> ("booktabs" "")
> ("fontspec" "")
> ("geometry" "a4paper")
> ("graphicx" "")
> ("lastpage" "")
> ("microtype" "activate")
> ("parskip" "")
> ("siunitx" "")
> ("tabularx" "")
> ("titlesec" "pagestyles")
> ("xcolor" "svgnames")
> ("xspace" "")))
> (TeX-run-style-hooks
> "article"
> "babel"
> "booktabs"
> "fontspec"
> "geometry"
> "graphicx"
> "lastpage"
> "microtype"
> "parskip"
> "siunitx"
> "tabularx"
> "titlesec"
> "xcolor"
> "xspace"))
> TeX-dialect)
> --8<---------------cut here---------------end--------------->8---
> IIUC, the hand-written additions to `LaTeX-provided-package-options' and
> `LaTeX-provided-class-options' are never activated in the .tex file.
Hmm, indeed.
> The best solution I can currently offer is:
> --8<---------------cut here---------------start------------->8---
> diff --git a/latex.el b/latex.el
> index 3a32c4e7..8b35851a 100644
> --- a/latex.el
> +++ b/latex.el
> @@ -1943,6 +1943,8 @@ For example, its value will be
> ...)
> See also `LaTeX-provided-package-options'.")
> +(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-provided-class-options)
> +
> (defun LaTeX-provided-class-options-member (class option)
> "Return non-nil if OPTION has been given to CLASS at load time.
> The value is actually the tail of the list of options given to CLASS."
> @@ -1966,6 +1968,8 @@ For example, its value will be
> ...)
> See also `LaTeX-provided-class-options'.")
> +(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-provided-package-options)
> +
> (defun LaTeX-provided-package-options-member (package option)
> "Return non-nil if OPTION has been given to PACKAGE at load time.
> The value is actually the tail of the list of options given to PACKAGE."
> @@ -2140,8 +2144,8 @@ TYPE is one of the symbols mac or env."
> LaTeX-auto-bibliography)))
> ;; Reset class and packages options for the current buffer
> - (setq LaTeX-provided-class-options nil)
> - (setq LaTeX-provided-package-options nil)
> + ;; (setq LaTeX-provided-class-options nil)
> + ;; (setq LaTeX-provided-package-options nil)
> ;; Cleanup document classes and packages
> (unless (null LaTeX-auto-style)
> --8<---------------cut here---------------end--------------->8---
> I.e., adding the variables to `TeX-normal-mode-reset-list' and deleting
> the forms inside `LaTeX-auto-cleanup'. Am I missing something?
I think that would be a reasonable solution. (Maybe we should tune
`LaTeX-auto-cleanup' to skip, for efficiency, additions to
`LaTeX-provided-package-options' and `LaTeX-provided-class-options' when
those variables already have non-nil bindings.)
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW
Information forwarded
to
bug-auctex <at> gnu.org
:
bug#78296
; Package
auctex
.
(Fri, 09 May 2025 12:42:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 78296 <at> debbugs.gnu.org (full text, mbox):
Hi Keita,
Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
> I think that would be a reasonable solution.
Thanks for looking at this.
> (Maybe we should tune `LaTeX-auto-cleanup' to skip, for efficiency,
> additions to `LaTeX-provided-package-options' and
> `LaTeX-provided-class-options' when those variables already have
> non-nil bindings.)
How would you then reset those variables? Say, you comment out your
hand-written package and hit C-c C-n, now those variables should not
contain your additions, but that will not happen, right? Or am I
missing something?
Best, Arash
Information forwarded
to
bug-auctex <at> gnu.org
:
bug#78296
; Package
auctex
.
(Mon, 12 May 2025 13:32:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 78296 <at> debbugs.gnu.org (full text, mbox):
Hi Arash,
>>>>> Arash Esbati <arash <at> gnu.org> writes:
>> (Maybe we should tune `LaTeX-auto-cleanup' to skip, for efficiency,
>> additions to `LaTeX-provided-package-options' and
>> `LaTeX-provided-class-options' when those variables already have
>> non-nil bindings.)
> How would you then reset those variables? Say, you comment out your
> hand-written package and hit C-c C-n, now those variables should not
> contain your additions, but that will not happen, right? Or am I
> missing something?
My thought is to add such skips in addition to your proposal, so I
expect that prefix argument C-u for C-c C-n would reset those variables.
(Please forgive me if I'm saying something stupid.)
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW
Information forwarded
to
bug-auctex <at> gnu.org
:
bug#78296
; Package
auctex
.
(Mon, 26 May 2025 12:04:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 78296 <at> debbugs.gnu.org (full text, mbox):
Hi Keita,
Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
> My thought is to add such skips in addition to your proposal, so I
> expect that prefix argument C-u for C-c C-n would reset those
> variables.
Sorry for my late response, and thanks for the clarification. I admit
I'm in general not happy with the current situation where we reset
`LaTeX-provided-(class|package)-options' in `LaTeX-auto-cleanup'. We
have `LaTeX-auto-prepare' for that, but the 2 variables in question seem
to be different. So my current vote is add them to
`TeX-normal-mode-reset-list' and be done with it, as we do for some
other variables as well.
> (Please forgive me if I'm saying something stupid.)
No worries, that is usually my part :-)
Best, Arash
Information forwarded
to
bug-auctex <at> gnu.org
:
bug#78296
; Package
auctex
.
(Thu, 26 Jun 2025 07:52:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 78296 <at> debbugs.gnu.org (full text, mbox):
Arash Esbati <arash <at> gnu.org> writes:
> Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
>
>> My thought is to add such skips in addition to your proposal, so I
>> expect that prefix argument C-u for C-c C-n would reset those
>> variables.
>
> Sorry for my late response, and thanks for the clarification. I admit
> I'm in general not happy with the current situation where we reset
> `LaTeX-provided-(class|package)-options' in `LaTeX-auto-cleanup'. We
> have `LaTeX-auto-prepare' for that, but the 2 variables in question seem
> to be different. So my current vote is add them to
> `TeX-normal-mode-reset-list' and be done with it, as we do for some
> other variables as well.
Ping! Keita, do you have any other comment on this? I used this setup
for some times now and it worked well. Can I install it?
Best, Arash
Information forwarded
to
bug-auctex <at> gnu.org
:
bug#78296
; Package
auctex
.
(Fri, 27 Jun 2025 10:43:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 78296 <at> debbugs.gnu.org (full text, mbox):
Hi Arash,
>>>>> Arash Esbati <arash <at> gnu.org> writes:
>> Sorry for my late response, and thanks for the clarification. I admit
>> I'm in general not happy with the current situation where we reset
>> `LaTeX-provided-(class|package)-options' in `LaTeX-auto-cleanup'. We
>> have `LaTeX-auto-prepare' for that, but the 2 variables in question seem
>> to be different. So my current vote is add them to
>> `TeX-normal-mode-reset-list' and be done with it, as we do for some
>> other variables as well.
> Ping! Keita, do you have any other comment on this? I used this setup
> for some times now and it worked well. Can I install it?
Sorry, I'm fine with your idea. Please go ahead!
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW
Reply sent
to
Arash Esbati <arash <at> gnu.org>
:
You have taken responsibility.
(Fri, 27 Jun 2025 12:20:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Arash Esbati <arash <at> gnu.org>
:
bug acknowledged by developer.
(Fri, 27 Jun 2025 12:20:03 GMT)
Full text and
rfc822 format available.
Message #28 received at 78296-done <at> debbugs.gnu.org (full text, mbox):
Hi Keita,
Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
> Sorry, I'm fine with your idea. Please go ahead!
Thanks for your response. I pushed that change, closing.
Should I trigger a new ELPA release, 14.1.0? Do we have enough new
stuff, WDYT?
Best, Arash
Information forwarded
to
bug-auctex <at> gnu.org
:
bug#78296
; Package
auctex
.
(Sat, 28 Jun 2025 06:31:01 GMT)
Full text and
rfc822 format available.
Message #31 received at 78296 <at> debbugs.gnu.org (full text, mbox):
Hi Arash,
Arash Esbati <arash <at> gnu.org> writes:
> Should I trigger a new ELPA release, 14.1.0? Do we have enough new
> stuff, WDYT?
I don't mean to hold things up here, but I got some feedback yesterday
that my attempted fix 26807f1cfdb8573bad60765b47ca2b70723d5262 is not
working correctly, so I wouldn't mind having a bit more time to get that
squared away before the next release.
Thanks, best,
Paul
Information forwarded
to
bug-auctex <at> gnu.org
:
bug#78296
; Package
auctex
.
(Sat, 28 Jun 2025 12:01:02 GMT)
Full text and
rfc822 format available.
Message #34 received at 78296 <at> debbugs.gnu.org (full text, mbox):
"Paul D. Nelson" <ultrono <at> gmail.com> writes:
> I don't mean to hold things up here, but I got some feedback yesterday
> that my attempted fix 26807f1cfdb8573bad60765b47ca2b70723d5262 is not
> working correctly, so I wouldn't mind having a bit more time to get that
> squared away before the next release.
Hi Paul,
thanks for letting me know. No worries, and no rush. Just give me a
shout once you're done.
Best, Arash
Information forwarded
to
bug-auctex <at> gnu.org
:
bug#78296
; Package
auctex
.
(Thu, 10 Jul 2025 17:19:07 GMT)
Full text and
rfc822 format available.
Message #37 received at 78296 <at> debbugs.gnu.org (full text, mbox):
Hi Arash,
Arash Esbati <arash <at> gnu.org> writes:
> "Paul D. Nelson" <ultrono <at> gmail.com> writes:
>
>> I don't mean to hold things up here, but I got some feedback yesterday
>> that my attempted fix 26807f1cfdb8573bad60765b47ca2b70723d5262 is not
>> working correctly, so I wouldn't mind having a bit more time to get that
>> squared away before the next release.
>
> Hi Paul,
>
> thanks for letting me know. No worries, and no rush. Just give me a
> shout once you're done.
>
> Best, Arash
I pushed a commit just now correcting the attempted fix mentioned above.
(I haven't managed to fully address the "shared folder" issue, but I
guess that will have to wait.) With that, I'm OK with a release.
I'll mention that I have at least a couple "submitted" patches
(bug#78693, bug#78741) that I think are in good shape, but should
probably be reviewed before merging. No rush on these, of course --
could just as well leave them for the next release.
Thanks, best,
Paul
This bug report was last modified today.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.