changeset 5787:10395934b99e

Add :risky and :safe options to defcustom. 2014-01-27 Michael Sperber <mike@xemacs.org> * custom.el (custom-declare-variable, defcustom): Add :risky and :safe options
author Mike Sperber <sperber@deinprogramm.de>
date Mon, 27 Jan 2014 17:41:46 +0100
parents 6355de501637
children 6a6c89b53c5d
files lisp/ChangeLog lisp/custom.el
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Jan 23 15:03:16 2014 +0000
+++ b/lisp/ChangeLog	Mon Jan 27 17:41:46 2014 +0100
@@ -1,3 +1,8 @@
+2014-01-27  Michael Sperber  <mike@xemacs.org>
+
+	* custom.el (custom-declare-variable, defcustom): Add :risky and
+	:safe options
+
 2013-12-30  Byrel Mitchell <byrel.mitchell@gmail.com>
 
 	* menubar.el (add-menu-item-1, delete-menu-item): Do not assume
--- a/lisp/custom.el	Thu Jan 23 15:03:16 2014 +0000
+++ b/lisp/custom.el	Mon Jan 27 17:41:46 2014 +0100
@@ -178,6 +178,10 @@
 		 (put symbol 'custom-get value))
 		((eq keyword :require)
 		 (push value requests))
+		((eq keyword :risky)
+		 (put symbol 'risky-local-variable value))
+		((eq keyword :safe)
+		 (put symbol 'safe-local-variable value))
 		((eq keyword :type)
 		 (put symbol 'custom-type value))
 		((eq keyword :options)
@@ -264,6 +268,8 @@
 	VALUE should be a feature symbol.  If you save a value
 	for this option, then when your custom init file loads the value,
 	it does (require VALUE) first.
+:risky  Set SYMBOL's `risky-local-variable' property to VALUE.
+:safe   Set SYMBOL's `safe-local-variable' property to VALUE.
 :version
         VALUE should be a string specifying that the variable was
         first introduced, or its default value was changed, in Emacs