emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] ox-latex: Make more variables file local safe
@ 2024-02-09 14:29 gerard.vermeulen
  2024-02-09 23:04 ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: gerard.vermeulen @ 2024-02-09 14:29 UTC (permalink / raw)
  To: Emacs orgmode, Ihor Radchenko

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

Hi,

I have a direct use for org-latex-toc-command being a file local
safe variable and I looked a bit around for other variables not
being file local safe for no good reason IMO (why those not,
while similar variables yes).

I have attached a patch which makes six variables file local safe.

Regards -- Gerard

[-- Attachment #2: 0001-ox-latex-Make-more-variables-file-local-safe.patch --]
[-- Type: application/octet-stream, Size: 2571 bytes --]

From 886c5d82e39b60398dd890999a5ef2ce9d358761 Mon Sep 17 00:00:00 2001
From: Gerard Vermeulen <gerard.vermeulen@posteo.net>
Date: Fri, 9 Feb 2024 15:07:31 +0100
Subject: [PATCH] ox-latex: Make more variables file local safe

* lisp/ox-latex.el (org-latex-subtitle-format):
(org-latex-subtitle-separate, org-latex-toc-command):
(org-latex-image-default-option, org-latex-image-default-width):
(org-latex-image-default-height): Make those variables safe file
local.
---
 lisp/ox-latex.el | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index e3edef3bd..93e0f08b8 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -597,14 +597,16 @@ which is replaced with the subtitle."
   :group 'org-export-latex
   :version "26.1"
   :package-version '(Org . "8.3")
-  :type '(string :tag "Format string"))
+  :type '(string :tag "Format string")
+  :safe #'stringp)
 
 (defcustom org-latex-subtitle-separate nil
   "Non-nil means the subtitle is not typeset as part of title."
   :group 'org-export-latex
   :version "26.1"
   :package-version '(Org . "8.3")
-  :type 'boolean)
+  :type 'boolean
+  :safe #'booleanp)
 
 (defcustom org-latex-toc-command "\\tableofcontents\n\n"
   "LaTeX command to set the table of contents, list of figures, etc.
@@ -612,7 +614,8 @@ This command only applies to the table of contents generated with the
 toc:t, toc:1, toc:2, toc:3, ... options, not to those generated with
 the #+TOC keyword."
   :group 'org-export-latex
-  :type 'string)
+  :type 'string
+  :safe #'stringp)
 
 (defcustom org-latex-hyperref-template
   "\\hypersetup{\n pdfauthor={%a},\n pdftitle={%t},\n pdfkeywords={%k},
@@ -717,7 +720,8 @@ The function result will be used in the section format string."
   :group 'org-export-latex
   :version "24.4"
   :package-version '(Org . "8.0")
-  :type 'string)
+  :type 'string
+  :safe #'stringp)
 
 (defcustom org-latex-image-default-width ".9\\linewidth"
   "Default width for images.
@@ -725,7 +729,8 @@ This value will not be used if a height is provided."
   :group 'org-export-latex
   :version "24.4"
   :package-version '(Org . "8.0")
-  :type 'string)
+  :type 'string
+  :safe #'stringp)
 
 (defcustom org-latex-image-default-scale ""
   "Default scale for images.
@@ -745,7 +750,8 @@ environment."
   :group 'org-export-latex
   :version "24.4"
   :package-version '(Org . "8.0")
-  :type 'string)
+  :type 'string
+  :safe #'stringp)
 
 (defcustom org-latex-default-figure-position "htbp"
   "Default position for LaTeX figures."
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-10 14:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-09 14:29 [PATCH] ox-latex: Make more variables file local safe gerard.vermeulen
2024-02-09 23:04 ` Ihor Radchenko
2024-02-10 13:25   ` gerard.vermeulen
2024-02-10 14:56     ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).