[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master dbafdb9 5/7: Add validate-mark-safe-local

From: Artur Malabarba
Subject: [elpa] master dbafdb9 5/7: Add validate-mark-safe-local
Date: Wed, 04 May 2016 15:00:37 +0000

branch: master
commit dbafdb904b48e72620f066a5c7cb0a123fc64baa
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    Add validate-mark-safe-local
 validate.el |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/validate.el b/validate.el
index 1ded67b..9eebe9a 100644
--- a/validate.el
+++ b/validate.el
@@ -175,5 +175,12 @@ with `validate-value'. NOERROR is passed to 
       (if noerror val
         (error "Variable `%s' has no custom-type." symbol)))))
+(defun validate-mark-safe-local (symbol)
+  "Mark SYMBOL as a safe local if its custom type is obeyed."
+  (put symbol 'safe-local-variable
+       (lambda (val)
+         (validate-value val (custom-variable-type symbol) 'noerror))))
 (provide 'validate)
 ;;; validate.el ends here

reply via email to

[Prev in Thread] Current Thread [Next in Thread]