branch: externals/auctex commit 5b50b1e2dacc378af76796f038a6469972dad1bc Author: Arash Esbati <ar...@gnu.org> Commit: Arash Esbati <ar...@gnu.org>
Set the safe-local-variable property with the :safe keyword * context.el (ConTeXt-Mark-version): * font-latex.el (font-latex-quotes, font-latex-fontify-script): * tex-style.el (LaTeX-fancyvrb-chars, LaTeX-shortvrb-chars): * tex.el (TeX-engine, TeX-PDF-mode, TeX-PDF-via-dvips-ps2pdf) (TeX-master): Use the :safe keyword to set the safe-local-variable property. --- context.el | 6 +++--- font-latex.el | 14 ++++++-------- tex-style.el | 10 +++++----- tex.el | 22 ++++++++++------------ 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/context.el b/context.el index b4f6dea0f4..10c1c180d3 100644 --- a/context.el +++ b/context.el @@ -1,6 +1,6 @@ ;;; context.el --- Support for ConTeXt documents. -*- lexical-binding: t; -*- -;; Copyright (C) 2003-2023 Free Software Foundation, Inc. +;; Copyright (C) 2003-2024 Free Software Foundation, Inc. ;; Maintainer: Berend de Boer <ber...@pobox.com> ;; Keywords: tex @@ -495,9 +495,9 @@ in your init file such as .emacs.d/init.el or .emacs." (defcustom ConTeXt-Mark-version "II" "ConTeXt Mark version used for running ConTeXt." :type 'string - :group 'TeX-command) + :group 'TeX-command + :safe #'stringp) (make-variable-buffer-local 'ConTeXt-Mark-version) -(put 'ConTeXt-Mark-version 'safe-local-variable #'stringp) (defun ConTeXt-numbered-section-heading () "Hook to prompt for ConTeXt section name. diff --git a/font-latex.el b/font-latex.el index b9495ea3ef..45ef8dd967 100644 --- a/font-latex.el +++ b/font-latex.el @@ -110,9 +110,8 @@ the language option supplied to the babel package. If nil, quoted content will not be fontified." :type '(choice (const auto) (const french) (const german) (const nil)) - :group 'font-latex) -(put 'font-latex-quotes 'safe-local-variable - (lambda (x) (memq x '(auto french german nil)))) + :group 'font-latex + :safe (lambda (x) (memq x '(auto french german nil)))) (defun font-latex-add-quotes (quotes) "Add QUOTES to `font-latex-quote-list'. @@ -969,11 +968,10 @@ script operators ^ and _ are not displayed." :type '(choice (boolean :tag "Enabled") (const :tag "Multiple levels" multi-level) (const :tag "Hide ^ and _" invisible)) - :group 'font-latex) -(put 'font-latex-fontify-script 'safe-local-variable - (lambda (val) - (or (booleanp val) - (memq val '(multi-level invisible))))) + :group 'font-latex + :safe (lambda (val) + (or (booleanp val) + (memq val '(multi-level invisible))))) (defcustom font-latex-fontify-script-max-level 3 "Maximum scriptification level for which script faces are applied. diff --git a/tex-style.el b/tex-style.el index 6fdeceedf5..c5131fe4f9 100644 --- a/tex-style.el +++ b/tex-style.el @@ -1,6 +1,6 @@ ;;; tex-style.el --- Customizable variables for AUCTeX style files -*- lexical-binding: t; -*- -;; Copyright (C) 2005-2023 Free Software Foundation, Inc. +;; Copyright (C) 2005-2024 Free Software Foundation, Inc. ;; Author: Reiner Steib <reiner.st...@gmx.de> ;; Keywords: tex, wp, convenience @@ -303,8 +303,8 @@ becomes the default value meaning that verbatim fontification is always performed for the characters in the list, no matter if your document actually defines shortverb chars using \\DefineShortVerb." - :type '(repeat character)) -(put 'LaTeX-fancyvrb-chars 'safe-local-variable #'listp) + :type '(repeat character) + :safe #'listp) ;; style/fontspec.el @@ -420,8 +420,8 @@ becomes the default value meaning that verbatim fontification is always performed for the characters in the list, no matter if your document actually defines shortvrb chars using \\MakeShortVrb." - :type '(repeat character)) -(put 'LaTeX-shortvrb-chars 'safe-local-variable #'listp) + :type '(repeat character) + :safe #'listp) ;; style/splitidx.el diff --git a/tex.el b/tex.el index c49d7e080e..5a35d98177 100644 --- a/tex.el +++ b/tex.el @@ -1578,10 +1578,9 @@ It should be one of the following symbols:\n\n" :group 'TeX-command :type `(choice ,@(mapcar (lambda (x) `(const :tag ,(nth 1 x) ,(car x))) - (TeX-engine-alist)))) + (TeX-engine-alist))) + :safe (lambda (arg) (memq arg (mapcar #'car TeX-engine-alist-builtin)))) (make-variable-buffer-local 'TeX-engine) -(put 'TeX-engine 'safe-local-variable - (lambda (arg) (memq arg (mapcar #'car TeX-engine-alist-builtin)))) (defun TeX-engine-set (type) "Set TeX engine to TYPE. @@ -2008,8 +2007,8 @@ enabled and the `synctex' binary is available." (defcustom TeX-PDF-mode t nil :group 'TeX-command :set #'TeX-mode-set - :type 'boolean) -(put 'TeX-PDF-mode 'safe-local-variable #'booleanp) + :type 'boolean + :safe #'booleanp) (define-minor-mode TeX-PDF-mode "Minor mode for using PDFTeX. @@ -2102,9 +2101,9 @@ Programs should not use this variable directly but the function (defcustom TeX-PDF-via-dvips-ps2pdf nil "Whether to produce PDF output through the (La)TeX - dvips - ps2pdf sequence." :group 'TeX-command - :type 'boolean) + :type 'boolean + :safe #'booleanp) (make-variable-buffer-local 'TeX-PDF-via-dvips-ps2pdf) -(put 'TeX-PDF-via-dvips-ps2pdf 'safe-local-variable #'booleanp) (make-obsolete-variable 'TeX-PDF-via-dvips-ps2pdf 'TeX-PDF-from-DVI "11.90") (defun TeX-PDF-from-DVI () @@ -2267,12 +2266,11 @@ It is suggested that you use the File Variables (see the info node (const :tag "This file" t) (const :tag "Shared" shared) (const :tag "Dwim" dwim) - (string :format "%v"))) + (string :format "%v")) + :safe (lambda (x) + (or (stringp x) + (member x (quote (t nil shared dwim)))))) (make-variable-buffer-local 'TeX-master) -(put 'TeX-master 'safe-local-variable - (lambda (x) - (or (stringp x) - (member x (quote (t nil shared dwim)))))) (defcustom TeX-one-master "\\.\\(texi?\\|dtx\\)$" "Regular expression matching ordinary TeX files.