GNU bug report logs - #45969
[PATCH] Mark nxml-mode customs as safe

Previous Next

Package: emacs;

Reported by: Lucas Werkmeister <mail <at> lucaswerkmeister.de>

Date: Mon, 18 Jan 2021 20:36:02 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 45969 in the body.
You can then email your comments to 45969 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#45969; Package emacs. (Mon, 18 Jan 2021 20:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lucas Werkmeister <mail <at> lucaswerkmeister.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 18 Jan 2021 20:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lucas Werkmeister <mail <at> lucaswerkmeister.de>
To: bug-gnu-emacs <at> gnu.org
Cc: Lucas Werkmeister <mail <at> lucaswerkmeister.de>
Subject: [PATCH] Mark nxml-mode customs as safe
Date: Mon, 18 Jan 2021 21:35:25 +0100
* 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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45969; Package emacs. (Tue, 19 Jan 2021 03:48:01 GMT) Full text and rfc822 format available.

Message #8 received at 45969 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Lucas Werkmeister <mail <at> lucaswerkmeister.de>
Cc: 45969 <at> debbugs.gnu.org
Subject: Re: bug#45969: [PATCH] Mark nxml-mode customs as safe
Date: Tue, 19 Jan 2021 04:47:32 +0100
Lucas Werkmeister <mail <at> 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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 19 Jan 2021 03:48:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 45969 <at> debbugs.gnu.org and Lucas Werkmeister <mail <at> lucaswerkmeister.de> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 19 Jan 2021 03:48:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 16 Feb 2021 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 59 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.