unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#45969: [PATCH] Mark nxml-mode customs as safe
@ 2021-01-18 20:35 Lucas Werkmeister
  2021-01-19  3:47 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas Werkmeister @ 2021-01-18 20:35 UTC (permalink / raw)
  To: 45969; +Cc: Lucas Werkmeister

* lisp/nxml/nxml-mode.el: Add :safe.
---

Notes:
    This lets users customize nxml-mode variables more easily.  For
    instance, systemd sets nxml-child-indent to 2 for its man/*.xml
    files; without this change, emacs prompts the user whether that
    value is safe or not.

 lisp/nxml/nxml-mode.el | 30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index 5bc3049d90..0602943db2 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -54,26 +54,30 @@ nxml-char-ref-display-glyph-flag
   "Non-nil means display glyph following character reference.
 The glyph is displayed in face `nxml-glyph'."
   :group 'nxml
-  :type 'boolean)
+  :type 'boolean
+  :safe #'booleanp)
 
 (defcustom nxml-sexp-element-flag t
   "Non-nil means sexp commands treat an element as a single expression."
   :version "27.1"                       ; nil -> t
   :group 'nxml
-  :type 'boolean)
+  :type 'boolean
+  :safe #'booleanp)
 
 (defcustom nxml-slash-auto-complete-flag nil
   "Non-nil means typing a slash automatically completes the end-tag.
 This is used by `nxml-electric-slash'."
   :group 'nxml
-  :type 'boolean)
+  :type 'boolean
+  :safe #'booleanp)
 
 (defcustom nxml-child-indent 2
   "Indentation for the children of an element relative to the start-tag.
 This only applies when the line or lines containing the start-tag contains
 nothing else other than that start-tag."
   :group 'nxml
-  :type 'integer)
+  :type 'integer
+  :safe #'integerp)
 
 (defcustom nxml-attribute-indent 4
   "Indentation for the attributes of an element relative to the start-tag.
@@ -81,12 +85,14 @@ nxml-attribute-indent
 In other cases, the first attribute on one line is indented the same
 as the first attribute on the previous line."
   :group 'nxml
-  :type 'integer)
+  :type 'integer
+  :safe #'integerp)
 
 (defcustom nxml-bind-meta-tab-to-complete-flag t
   "Non-nil means to use nXML completion in \\[completion-at-point]."
   :group 'nxml
-  :type 'boolean)
+  :type 'boolean
+  :safe #'booleanp)
 
 (defcustom nxml-prefer-utf-16-to-utf-8-flag nil
   "Non-nil means prefer UTF-16 to UTF-8 when saving a buffer.
@@ -94,7 +100,8 @@ nxml-prefer-utf-16-to-utf-8-flag
 and when its current `buffer-file-coding-system' specifies neither UTF-16
 nor UTF-8."
   :group 'nxml
-  :type 'boolean)
+  :type 'boolean
+  :safe #'booleanp)
 
 (defcustom nxml-prefer-utf-16-little-to-big-endian-flag (eq system-type
 							    'windows-nt)
@@ -103,7 +110,8 @@ nxml-prefer-utf-16-little-to-big-endian-flag
 auto-detected. It may be relevant both when there is no encoding declaration
 and when the encoding declaration specifies `UTF-16'."
   :group 'nxml
-  :type 'boolean)
+  :type 'boolean
+  :safe #'booleanp)
 
 (defcustom nxml-default-buffer-file-coding-system nil
   "Default value for `buffer-file-coding-system' for a buffer for a new file.
@@ -112,13 +120,15 @@ nxml-default-buffer-file-coding-system
 A buffer's `buffer-file-coding-system' affects what
 \\[nxml-insert-xml-declaration] inserts."
   :group 'nxml
-  :type 'coding-system)
+  :type 'coding-system
+  :safe #'coding-system-p)
 
 (defcustom nxml-auto-insert-xml-declaration-flag nil
   "Non-nil means automatically insert an XML declaration in a new file.
 The XML declaration is inserted using `nxml-insert-xml-declaration'."
   :group 'nxml
-  :type 'boolean)
+  :type 'boolean
+  :safe #'booleanp)
 
 (defface nxml-delimited-data
   '((t (:inherit font-lock-doc-face)))
-- 
2.30.0






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

* bug#45969: [PATCH] Mark nxml-mode customs as safe
  2021-01-18 20:35 bug#45969: [PATCH] Mark nxml-mode customs as safe Lucas Werkmeister
@ 2021-01-19  3:47 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-19  3:47 UTC (permalink / raw)
  To: Lucas Werkmeister; +Cc: 45969

Lucas Werkmeister <mail@lucaswerkmeister.de> writes:

> * lisp/nxml/nxml-mode.el: Add :safe.
> ---
>
> Notes:
>     This lets users customize nxml-mode variables more easily.  For
>     instance, systemd sets nxml-child-indent to 2 for its man/*.xml
>     files; without this change, emacs prompts the user whether that
>     value is safe or not.

Makes sense to me; applied to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2021-01-19  3:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 20:35 bug#45969: [PATCH] Mark nxml-mode customs as safe Lucas Werkmeister
2021-01-19  3:47 ` Lars Ingebrigtsen

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

	https://git.savannah.gnu.org/cgit/emacs.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).