emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master cb2d5b2 2/2: Merge commit '3659f0267f1a70a7141b7d53d8a0696


From: Artur Malabarba
Subject: [elpa] master cb2d5b2 2/2: Merge commit '3659f0267f1a70a7141b7d53d8a0696d40247c08'
Date: Wed, 04 May 2016 15:27:27 +0000

branch: master
commit cb2d5b29dbdf0aab7f4804438e53bfa1a4dcd82d
Merge: f94daca 3659f02
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    Merge commit '3659f0267f1a70a7141b7d53d8a0696d40247c08'
---
 packages/validate/validate.el |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/packages/validate/validate.el b/packages/validate/validate.el
index 8408b63..7dfe45b 100644
--- a/packages/validate/validate.el
+++ b/packages/validate/validate.el
@@ -5,7 +5,7 @@
 ;; Author: Artur Malabarba <address@hidden>
 ;; Keywords: lisp
 ;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
-;; Version: 0.2
+;; Version: 0.3
 
 ;;; Commentary:
 ;;
@@ -182,5 +182,10 @@ with `validate-value'. NOERROR is passed to 
`validate-value'."
        (lambda (val)
          (validate-value val (custom-variable-type symbol) 'noerror))))
 
+(defmacro validate-setq (symbol value)
+  "Like `setq', but throw an error if validation fails.
+VALUE is validated against SYMBOL's custom type."
+  `(setq ,symbol (validate-value ,value (custom-variable-type ',symbol))))
+
 (provide 'validate)
 ;;; validate.el ends here



reply via email to

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