From debbugs-submit-bounces@debbugs.gnu.org Wed May 07 04:17:33 2025 Received: (at submit) by debbugs.gnu.org; 7 May 2025 08:17:33 +0000 Received: from localhost ([127.0.0.1]:40118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCZy8-0002fM-Jx for submit@debbugs.gnu.org; Wed, 07 May 2025 04:17:33 -0400 Received: from lists.gnu.org ([2001:470:142::17]:60716) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uCZy5-0002em-Pj for submit@debbugs.gnu.org; Wed, 07 May 2025 04:17:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uCZy0-00012x-Du for bug-auctex@gnu.org; Wed, 07 May 2025 04:17:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uCZy0-0004f8-45 for bug-auctex@gnu.org; Wed, 07 May 2025 04:17:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=pCxv1CkD99hvWdtPe7YLjRl5QKpup55uUBLqfcgyh+0=; b=jDj0SrTbSYv3/s E90qqiNwB4u/fPIysi9OdP1ZnZmjKfPmp8dTsaPXzjJrNUWUQMqqzmuIcT25iNmHZpN4JO2BPZZKe sdWrG9kkliHqs7VNZ80Lwv2pxL4pe0qbmmrbZr/9NevS6zDrXaY7hmD1htY1tIAq/sAmX5+WsGCyE ttCH67EHuf3QRwYMpEQu2TFfKOrrwqUQtowc1JXs+zvAtORRIm/0exYZE2my9tLUsTeL8Y5CpPTZF a4uUTct7fuRca0kcwCNRcNT3pBhxzW8Spl+UXwTismcpUtGQ3WIKnr/u/KslynMJKOOp/UoeA9yi2 31PZ4d8NODqpOQHCxIag==; From: Arash Esbati To: "auctex-bugs" Subject: Hand-written styles with `LaTeX-provided-package-options' Date: Wed, 07 May 2025 10:17:20 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Fri May 09 05:05:59 2025 Received: (at 78296) by debbugs.gnu.org; 9 May 2025 09:05:59 +0000 Received: from localhost ([127.0.0.1]:35438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uDJg7-00073T-9g for submit@debbugs.gnu.org; Fri, 09 May 2025 05:05:59 -0400 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:49366) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uDJg3-00073H-MU for 78296@debbugs.gnu.org; Fri, 09 May 2025 05:05:56 -0400 Received: from localhost (42-144-37-89.rev.home.ne.jp [42.144.37.89]) by smtp1a.inetd.co.jp (Postfix) with ESMTPSA id B87C560; Fri, 9 May 2025 18:05:52 +0900 (JST) From: Ikumi Keita To: Arash Esbati Subject: Re: bug#78296: Hand-written styles with `LaTeX-provided-package-options' In-reply-to: References: Comments: In-reply-to Arash Esbati message dated "Wed, 07 May 2025 10:17:20 +0200." X-Mailer: MH-E 8.6+git; nmh 1.8; Emacs 30.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17679.1746781551.1@localhost> Date: Fri, 09 May 2025 18:05:51 +0900 Message-ID: <17684.1746781551@localhost> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78296 Cc: 78296@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Arash, >>>>> Arash Esbati 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 From debbugs-submit-bounces@debbugs.gnu.org Fri May 09 08:41:32 2025 Received: (at 78296) by debbugs.gnu.org; 9 May 2025 12:41:32 +0000 Received: from localhost ([127.0.0.1]:36566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uDN2h-00068t-81 for submit@debbugs.gnu.org; Fri, 09 May 2025 08:41:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50764) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uDN2c-000688-37 for 78296@debbugs.gnu.org; Fri, 09 May 2025 08:41:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uDN2S-0003Md-RI; Fri, 09 May 2025 08:41:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=R3ZyWBwtcTR0fUEVcevbXBTSDdAQg51k2sKjgDMhjLA=; b=g16zkXVpJJYsoSEQ5lgZ yFWull9hdJDqrCkPAWUmO/yHMstm7j95EFSmzVl9HsE3KybXjsgHUdGo+se21nVvGhpeTUkiTcoXh 5gu8EqYic3Q9NIOzduyQfrYZjuYUr22eBRjkKppSvdnXKauyYRKq3aFYLX//fmDbFhDUbEm/gbZB7 ylWk1HIUQSB63jR6GViuBI1C5E26MjhFagRgDlqfvuE+BtXfzg3vChuyfzFhFazGp3DLWLRYJbL2A d5DJHbZNqDoFWvVvwcgY4D8Nfyi4IG3BJ93K33iuuzVqo8pPvt9X1WnikaUojITv3CFHJZHh+frIu 5EOJkHyiBtds1Q==; From: Arash Esbati To: Ikumi Keita Subject: Re: bug#78296: Hand-written styles with `LaTeX-provided-package-options' In-Reply-To: <17684.1746781551@localhost> References: <17684.1746781551@localhost> Date: Fri, 09 May 2025 14:40:54 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78296 Cc: 78296@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Keita, Ikumi Keita 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 From debbugs-submit-bounces@debbugs.gnu.org Mon May 12 09:31:34 2025 Received: (at 78296) by debbugs.gnu.org; 12 May 2025 13:31:34 +0000 Received: from localhost ([127.0.0.1]:51509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uETFm-0005Hb-A4 for submit@debbugs.gnu.org; Mon, 12 May 2025 09:31:34 -0400 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:57248) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uETFi-0005HL-UB for 78296@debbugs.gnu.org; Mon, 12 May 2025 09:31:31 -0400 Received: from localhost (42-144-37-89.rev.home.ne.jp [42.144.37.89]) by smtp1a.inetd.co.jp (Postfix) with ESMTPSA id 574D75C; Mon, 12 May 2025 22:31:27 +0900 (JST) From: Ikumi Keita To: Arash Esbati Subject: Re: bug#78296: Hand-written styles with `LaTeX-provided-package-options' In-reply-to: References: <17684.1746781551@localhost> Comments: In-reply-to Arash Esbati message dated "Fri, 09 May 2025 14:40:54 +0200." X-Mailer: MH-E 8.6+git; nmh 1.8; Emacs 30.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21340.1747056687.1@localhost> Date: Mon, 12 May 2025 22:31:27 +0900 Message-ID: <21341.1747056687@localhost> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78296 Cc: 78296@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Arash, >>>>> Arash Esbati 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 From debbugs-submit-bounces@debbugs.gnu.org Mon May 26 08:03:53 2025 Received: (at 78296) by debbugs.gnu.org; 26 May 2025 12:03:53 +0000 Received: from localhost ([127.0.0.1]:55548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uJWYb-00010A-HJ for submit@debbugs.gnu.org; Mon, 26 May 2025 08:03:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36724) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uJWYX-0000zV-RI for 78296@debbugs.gnu.org; Mon, 26 May 2025 08:03:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uJWYP-0006v5-Gu; Mon, 26 May 2025 08:03:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=BluaLygLxOZZXZxq4Z6hzcTohYJYcuOxDt04gZCgvrI=; b=N1A1hyCPBBa07Z7Vmb+V DYYZ8lt3SOs+gyq4gImkr6sEMXr3nqhGu008+PSEF/S3yKhaA/RWsbKiOPyDC2ds9xeMEX8VEzWot 6jsgvzNqAQt6kxKjPzf/HMt+3zIBzZlcbnIrCan412YHp+zzxvHA/qQqeCfYEMYCulQL14Ah+1Txy yknhn/5tj3qi5545UOK6rry/ZXse/AyS8m6eFXRY5VfNhzHGHXPy03z3ynN1mo0R9QlqxndJTwk6B XoAOBLYWEIeVecpc5qGEitaCX3URCwHDzfXgc12WeL1d+eYeh7YGgP9J5CHEWUnq0oI19iJg70Jfc Jz21kMbwgbcB+w==; From: Arash Esbati To: Ikumi Keita Subject: Re: bug#78296: Hand-written styles with `LaTeX-provided-package-options' In-Reply-To: <21341.1747056687@localhost> References: <17684.1746781551@localhost> <21341.1747056687@localhost> Date: Mon, 26 May 2025 14:03:36 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78296 Cc: 78296@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Keita, Ikumi Keita 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