GNU bug report logs - #71240
Keeping track of class and packages, even w/o options

Previous Next

Package: auctex;

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

Date: Tue, 28 May 2024 10:07:02 UTC

Severity: normal

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 71240 in the body.
You can then email your comments to 71240 AT debbugs.gnu.org in the normal way.

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#71240; Package auctex. (Tue, 28 May 2024 10:07: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. (Tue, 28 May 2024 10:07: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: Keeping track of class and packages, even w/o options
Date: Tue, 28 May 2024 12:06:23 +0200
Hi all,

currently, AUCTeX keeps track of options given to packages and/or
documentclass in `LaTeX-provided-package-options' and
`LaTeX-provided-class-options' respectively.  No entries are added to
the variables if the packages/documentclass are loaded without options.
This is Ok in general, but things get complicated when we want to have a
style file where both package and class have the same name, e.g.:

  texmf-dist/tex/latex/standalone/standalone.cls
  texmf-dist/tex/latex/standalone/standalone.sty

We have to cater for different set of macros inside one style, so
something like this:

  (TeX-add-style-hook
   "standalone"
   (lambda ()
     ;; standalone.cls
     (when (assoc "standalone" LaTeX-provided-class-options)
       (TeX-add-symbols '(...)))

     ;; standalone.sty
     (when (assoc "standalone" LaTeX-provided-package-options)
       ...)))

which currently doesn't work because if the package or class are loaded
without options.  I suggest the following change to
`LaTeX-auto-cleanup':

--8<---------------cut here---------------start------------->8---
diff --git a/latex.el b/latex.el
index d0a9ee6f..8844fdc4 100644
--- a/latex.el
+++ b/latex.el
@@ -2168,9 +2168,8 @@ TYPE is one of the symbols mac or env."
               (add-to-list 'TeX-auto-file elt t)
               ;; Append to `LaTeX-provided-package-options' the name of the
               ;; package and the options provided to it at load time.
-              (unless (equal options '(""))
-                (TeX-add-to-alist 'LaTeX-provided-package-options
-                                  (list (cons elt options)))))
+              (TeX-add-to-alist 'LaTeX-provided-package-options
+                                (list (cons elt options))))
           ;; And a special "art10" style file combining style and size.
           (add-to-list 'TeX-auto-file style t)
           (add-to-list 'TeX-auto-file
@@ -2201,9 +2200,8 @@ TYPE is one of the symbols mac or env."
                               (t
                                "10")))
                        t)
-          (unless (equal options '(""))
-            (TeX-add-to-alist 'LaTeX-provided-class-options
-                              (list (cons style options)))))
+          (TeX-add-to-alist 'LaTeX-provided-class-options
+                            (list (cons style options))))

         ;; The third argument if "class" indicates LaTeX2e features.
         (cond ((or (string-equal class "class")
--8<---------------cut here---------------end--------------->8---

This adds entries like ("package/class" "") to the variables when no
options are given, and styles can check against them.

WDYT?

Best, Arash




Information forwarded to bug-auctex <at> gnu.org:
bug#71240; Package auctex. (Sun, 02 Jun 2024 15:23:02 GMT) Full text and rfc822 format available.

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

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Arash Esbati <arash <at> gnu.org>
Cc: 71240 <at> debbugs.gnu.org
Subject: Re: bug#71240: Keeping track of class and packages, even w/o options
Date: Mon, 03 Jun 2024 00:21:52 +0900
Hi Arash,

>>>>> Arash Esbati <arash <at> gnu.org> writes:
> This adds entries like ("package/class" "") to the variables when no
> options are given, and styles can check against them.

> WDYT?

I haven't tried it for myself, but I suppose it's a reasonable idea to
carry out.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW




Reply sent to Arash Esbati <arash <at> gnu.org>:
You have taken responsibility. (Sun, 02 Jun 2024 20:19:02 GMT) Full text and rfc822 format available.

Notification sent to Arash Esbati <arash <at> gnu.org>:
bug acknowledged by developer. (Sun, 02 Jun 2024 20:19:02 GMT) Full text and rfc822 format available.

Message #13 received at 71240-done <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: 71240-done <at> debbugs.gnu.org
Subject: Re: bug#71240: Keeping track of class and packages, even w/o options
Date: Sun, 02 Jun 2024 21:58:14 +0200
Ikumi Keita <ikumi <at> ikumi.que.jp> writes:

> I haven't tried it for myself, but I suppose it's a reasonable idea to
> carry out.

Thanks Keita.  I installed that change, and therefore closing this report.

Best, Arash




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 01 Jul 2024 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 44 days ago.

Previous Next


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