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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Arash Esbati <arash <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#71240: closed (Keeping track of class and packages, even w/o
 options)
Date: Sun, 02 Jun 2024 20:19:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 02 Jun 2024 21:58:14 +0200
with message-id <m2a5k3i0bt.fsf <at> macmutant.fritz.box>
and subject line Re: bug#71240: Keeping track of class and packages, even w/o options
has caused the debbugs.gnu.org bug report #71240,
regarding Keeping track of class and packages, even w/o options
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
71240: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71240
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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


[Message part 3 (message/rfc822, inline)]
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


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.