emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#71240: closed (Keeping track of class and packages, even w/o options


From: GNU bug Tracking System
Subject: bug#71240: closed (Keeping track of class and packages, even w/o options)
Date: Sun, 02 Jun 2024 20:19:02 +0000

Your message dated Sun, 02 Jun 2024 21:58:14 +0200
with message-id <m2a5k3i0bt.fsf@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@gnu.org.)


-- 
71240: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71240
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: Keeping track of class and packages, even w/o options Date: Tue, 28 May 2024 12:06:23 +0200 User-agent: Gnus/5.13 (Gnus v5.13)
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



--- End Message ---
--- Begin Message --- Subject: Re: bug#71240: Keeping track of class and packages, even w/o options Date: Sun, 02 Jun 2024 21:58:14 +0200 User-agent: Gnus/5.13 (Gnus v5.13)
Ikumi Keita <ikumi@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


--- End Message ---

reply via email to

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