branch: main
commit 2ebd33057b5a681f2d01d1358b26dd538c3fc86f
Author: Arash Esbati <ar...@gnu.org>
Commit: Arash Esbati <ar...@gnu.org>

    Mark options as buffer-local with :local keyword
    
    * context.el (ConTeXt-Mark-version, ConTeXt-default-environment):
    * latex.el (LaTeX-default-options, LaTeX-default-environment)
    (LaTeX-float, LaTeX-default-format, LaTeX-default-width)
    (LaTeX-default-position, LaTeX-label-alist):
    * tex.el (TeX-command-extra-options, TeX-engine)
    (TeX-PDF-from-DVI, TeX-PDF-via-dvips-ps2pdf, TeX-command-BibTeX)
    (TeX-command-Biber, TeX-command-Show, TeX-master)
    (TeX-output-dir, TeX-default-macro, TeX-insert-braces-alist)
    (TeX-auto-regexp-list, TeX-auto-parse-length)
    (TeX-auto-x-parse-length, TeX-auto-x-regexp-list)
    (TeX-default-extension, TeX-kill-process-without-query): Set the
    :local keyword to t to mark the option as automatically
    buffer-local.  This is a re-install of commmit 77a02f83 which was
    reverted since :local didn't work in Emacs 27.1.  This change is
    now safe since AUCTeX requires at least Emacs 28.1.
---
 context.el | 12 +++++------
 latex.el   | 30 +++++++++++++--------------
 tex.el     | 70 ++++++++++++++++++++++++++++++--------------------------------
 3 files changed, 54 insertions(+), 58 deletions(-)

diff --git a/context.el b/context.el
index 183b617e..25cbeb34 100644
--- a/context.el
+++ b/context.el
@@ -1,6 +1,6 @@
 ;;; context.el --- Support for ConTeXt documents.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2003-2024  Free Software Foundation, Inc.
+;; Copyright (C) 2003-2025  Free Software Foundation, Inc.
 
 ;; Author: Patrick Gundlach <p...@levana.de>
 ;;         Berend de Boer <ber...@pobox.com>
@@ -493,8 +493,8 @@ in your init file such as .emacs.d/init.el or .emacs."
   "ConTeXt Mark version used for running ConTeXt."
   :type 'string
   :group 'TeX-command
-  :safe #'stringp)
-(make-variable-buffer-local 'ConTeXt-Mark-version)
+  :safe #'stringp
+  :local t)
 
 (defun ConTeXt-numbered-section-heading ()
   "Hook to prompt for ConTeXt section name.
@@ -621,10 +621,10 @@ for a label to be inserted after the sectioning command."
 
 ;; TODO: interface awareness
 (defcustom ConTeXt-default-environment "itemize"
-  "The default environment when creating new ones with `ConTeXt-environment'."
+  "Default environment when creating new ones with `ConTeXt-environment'."
   :group 'ConTeXt-environment
-  :type 'string)
-(make-variable-buffer-local 'ConTeXt-default-environment)
+  :type 'string
+  :local t)
 
 (TeX-auto-add-type "environment" "ConTeXt")
 
diff --git a/latex.el b/latex.el
index ebc88218..bc27b266 100644
--- a/latex.el
+++ b/latex.el
@@ -62,9 +62,8 @@
   "Default options to documentclass.
 A comma-seperated list of strings."
   :group 'LaTeX-environment
-  :type '(repeat (string :format "%v")))
-
-(make-variable-buffer-local 'LaTeX-default-options)
+  :type '(repeat (string :format "%v"))
+  :local t)
 
 (defcustom LaTeX-insert-into-comments nil
   "Whether insertion commands stay in comments.
@@ -556,8 +555,8 @@ The behaviour of this hook is controlled by variable 
`LaTeX-section-label'."
 It is overridden by `LaTeX-default-document-environment' when it
 is non-nil and the current environment is \"document\"."
   :group 'LaTeX-environment
-  :type 'string)
-(make-variable-buffer-local 'LaTeX-default-environment)
+  :type 'string
+  :local t)
 
 (defvar-local LaTeX-default-document-environment nil
   "The default environment when creating new ones with
@@ -1004,8 +1003,8 @@ optional argument is omitted.)"
   :group 'LaTeX-environment
   :type '(choice (const :tag "Do not prompt" nil)
                  (const :tag "Empty" "")
-                 (string :format "%v")))
-(make-variable-buffer-local 'LaTeX-float)
+                 (string :format "%v"))
+  :local t)
 
 (defcustom LaTeX-top-caption-list nil
   "List of float environments with top caption."
@@ -1049,14 +1048,14 @@ code listings and take a caption and label."
 (defcustom LaTeX-default-format ""
   "Default format for array and tabular environments."
   :group 'LaTeX-environment
-  :type 'string)
-(make-variable-buffer-local 'LaTeX-default-format)
+  :type 'string
+  :local t)
 
 (defcustom LaTeX-default-width "1.0\\linewidth"
   "Default width for minipage and tabular* environments."
   :group 'LaTeX-environment
-  :type 'string)
-(make-variable-buffer-local 'LaTeX-default-width)
+  :type 'string
+  :local t)
 
 (defcustom LaTeX-default-position ""
   "Default position for array and tabular environments.
@@ -1064,8 +1063,8 @@ If nil, act like the empty string is given, but do not 
prompt."
   :group 'LaTeX-environment
   :type '(choice (const :tag "Do not prompt" nil)
                  (const :tag "Empty" "")
-                 string))
-(make-variable-buffer-local 'LaTeX-default-position)
+                 string)
+  :local t)
 
 (defcustom LaTeX-equation-label "eq:"
   "Default prefix to equation labels."
@@ -1150,9 +1149,8 @@ corresponding entry."
   :group 'LaTeX-label
   :type '(repeat (cons (string :tag "Environment")
                        (choice (string :tag "Label prefix")
-                               (symbol :tag "Label prefix symbol")))))
-
-(make-variable-buffer-local 'LaTeX-label-alist)
+                               (symbol :tag "Label prefix symbol"))))
+  :local t)
 
 (defvar TeX-read-label-prefix nil
   "Initial input for the label in `TeX-read-label'.")
diff --git a/tex.el b/tex.el
index 590f938a..267dc27d 100644
--- a/tex.el
+++ b/tex.el
@@ -530,8 +530,8 @@ string."
 
 (defcustom TeX-command-extra-options ""
   "String with the extra options to be given to the TeX processor."
-  :type 'string)
-(make-variable-buffer-local 'TeX-command-extra-options)
+  :type 'string
+  :local t)
 
 (defvar TeX-command-text nil
   "Dynamically bound by `TeX-command-expand'.")
@@ -1639,8 +1639,8 @@ It should be one of the following symbols:\n\n"
   :type `(choice ,@(mapcar (lambda (x)
                              `(const :tag ,(nth 1 x) ,(car x)))
                            (TeX-engine-alist)))
-  :safe (lambda (arg) (memq arg (mapcar #'car TeX-engine-alist-builtin))))
-(make-variable-buffer-local 'TeX-engine)
+  :safe (lambda (arg) (memq arg (mapcar #'car TeX-engine-alist-builtin)))
+  :local t)
 
 (defun TeX-engine-set (type)
   "Set TeX engine to TYPE.
@@ -2146,17 +2146,17 @@ Programs should not use this variable directly but the 
function
           (const :tag "No DVI to PDF conversion" nil)
           (const :tag "dvips - ps2pdf sequence" "Dvips")
           (const :tag "dvipdfmx" "Dvipdfmx"))
-  :safe #'string-or-null-p)
+  :safe #'string-or-null-p
+  :local t)
 ;; If you plan to support new values of `TeX-PDF-from-DVI' remember to update
 ;; `TeX-command-default' accordingly.
-(make-variable-buffer-local 'TeX-PDF-from-DVI)
 
 (defcustom TeX-PDF-via-dvips-ps2pdf nil
   "Whether to produce PDF output through the (La)TeX - dvips - ps2pdf 
sequence."
   :group 'TeX-command
   :type 'boolean
-  :safe #'booleanp)
-(make-variable-buffer-local 'TeX-PDF-via-dvips-ps2pdf)
+  :safe #'booleanp
+  :local t)
 (make-obsolete-variable 'TeX-PDF-via-dvips-ps2pdf 'TeX-PDF-from-DVI "11.90")
 
 (defun TeX-PDF-from-DVI ()
@@ -2187,21 +2187,21 @@ for backward compatibility."
 (defcustom TeX-command-BibTeX "BibTeX"
   "The name of the BibTeX entry in `TeX-command-list'."
   :group 'TeX-command-name
-  :type 'string)
-  (make-variable-buffer-local 'TeX-command-BibTeX)
+  :type 'string
+  :local t)
 
 (defcustom TeX-command-Biber "Biber"
   "The name of the Biber entry in `TeX-command-list'."
   :group 'TeX-command-name
-  :type 'string)
-  (make-variable-buffer-local 'TeX-command-Biber)
+  :type 'string
+  :local t)
 
 (defcustom TeX-command-Show "View"
   "The default command to show (view or print) a TeX file.
 Must be the car of an entry in `TeX-command-list'."
   :group 'TeX-command-name
-  :type 'string)
-  (make-variable-buffer-local 'TeX-command-Show)
+  :type 'string
+  :local t)
 
 (defcustom TeX-command-Print "Print"
   "The name of the Print entry in `TeX-command-Print'."
@@ -2323,8 +2323,8 @@ It is suggested that you use the File Variables (see the 
info node
                  (string :format "%v"))
   :safe (lambda (x)
           (or (stringp x)
-              (member x (quote (t nil shared dwim))))))
-(make-variable-buffer-local 'TeX-master)
+              (member x (quote (t nil shared dwim)))))
+  :local t)
 
 (defcustom TeX-one-master "\\.\\(texi?\\|[dl]tx\\)\\'"
   "Regular expression matching ordinary TeX files.
@@ -2564,8 +2564,8 @@ is assumed to be the same as the directory of 
`TeX-master'."
   :group 'TeX-file
   :safe #'string-or-null-p
   :type '(choice (const :tag "Directory of master file" nil)
-                 (string :tag "Custom" "build")))
-(make-variable-buffer-local 'TeX-output-dir)
+                 (string :tag "Custom" "build"))
+  :local t)
 
 (defun TeX--master-output-dir (master-dir relative-to-master &optional ensure)
   "Return the directory path where output files should be placed.
@@ -3308,9 +3308,8 @@ See `completion-at-point-functions'."
 (defcustom TeX-default-macro "ref"
   "The default macro when creating new ones with `TeX-insert-macro'."
   :group 'TeX-macro
-  :type 'string)
-
-(make-variable-buffer-local 'TeX-default-macro)
+  :type 'string
+  :local t)
 
 (defcustom TeX-insert-braces t
   "If non-nil, append an empty pair of braces after inserting a macro.
@@ -3331,8 +3330,8 @@ will use its value to decide what to do, whatever the 
value of
 the variable `TeX-insert-braces'."
   :group 'TeX-macro
   :type '(repeat (cons (string :tag "Macro name")
-                       (boolean :tag "Append braces?"))))
-(make-variable-buffer-local 'TeX-insert-braces-alist)
+                       (boolean :tag "Append braces?")))
+  :local t)
 
 (defcustom TeX-insert-macro-default-style 'show-optional-args
   "Specifies whether `TeX-insert-macro' will ask for all optional arguments.
@@ -4351,8 +4350,8 @@ It can also be a name of a variable having such value."
                         (group (regexp :tag "Match")
                                (sexp :tag "Groups")
                                symbol)))
-  :group 'TeX-parse)
-  (make-variable-buffer-local 'TeX-auto-regexp-list)
+  :group 'TeX-parse
+  :local t)
 
 (defun TeX-auto-add-regexp (regexp)
   "Add REGEXP to `TeX-auto-regexp-list' if not already a member."
@@ -4399,16 +4398,16 @@ alter the numbering of any ordinary, non-shy groups.")
 (defcustom TeX-auto-parse-length 999999
   "Maximal length of TeX file (in characters) that will be parsed."
   :group 'TeX-parse
-  :type 'integer)
-  (make-variable-buffer-local 'TeX-auto-parse-length)
+  :type 'integer
+  :local t)
 
 (defcustom TeX-auto-x-parse-length 0
   "Maximum length of TeX file that will be parsed additionally.
 Use `TeX-auto-x-regexp-list' for parsing the region between
 `TeX-auto-parse-length' and this value."
   :group 'TeX-parse
-  :type 'integer)
-  (make-variable-buffer-local 'TeX-auto-x-parse-length)
+  :type 'integer
+  :local t)
 
 (defcustom TeX-auto-x-regexp-list 'LaTeX-auto-label-regexp-list
   "List of regular expressions used for additional parsing.
@@ -4425,8 +4424,8 @@ See `TeX-auto-x-parse-length'."
                         (group (regexp :tag "Match")
                                (sexp :tag "Groups")
                                symbol)))
-  :group 'TeX-parse)
-  (make-variable-buffer-local 'TeX-auto-x-regexp-list)
+  :group 'TeX-parse
+  :local t)
 
 (defun TeX-regexp-group-count (regexp)
   "Return number of groups in a REGEXP.  This is not foolproof:
@@ -4576,9 +4575,8 @@ Check for potential LaTeX environments."
 (defcustom TeX-default-extension "tex"
   "Default extension for TeX files."
   :group 'TeX-file-extension
-  :type 'string)
-
-  (make-variable-buffer-local 'TeX-default-extension)
+  :type 'string
+  :local t)
 
 (defvar TeX-doc-extensions
   '("dvi" "pdf" "ps" "txt" "html" "dvi\\.gz" "pdf\\.gz" "ps\\.gz" "txt\\.gz"
@@ -8899,8 +8897,8 @@ Return nil only if no process buffer exists."
   "If non-nil, abort a running document process without user query."
   :type 'boolean
   :safe #'booleanp
-  :group 'TeX-command)
-(make-variable-buffer-local 'TeX-kill-process-without-query)
+  :group 'TeX-command
+  :local t)
 
 (defun TeX-process-check (name)
   "Check if a process for the TeX document NAME already exists.

Reply via email to