From dbafdb904b48e72620f066a5c7cb0a123fc64baa Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 4 May 2016 11:58:38 -0300 Subject: [PATCH] Add validate-mark-safe-local --- validate.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/validate.el b/validate.el index 1ded67b0d..9eebe9a36 100644 --- a/validate.el +++ b/validate.el @@ -175,5 +175,12 @@ with `validate-value'. NOERROR is passed to `validate-value'." (if noerror val (error "Variable `%s' has no custom-type." symbol))))) +;;;###autoload +(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 -- 2.39.2