branch: elpa/cycle-at-point
commit 0be84f33f1d93eabb1808e71f9085bc71017ca77
Author: Campbell Barton <[email protected]>
Commit: Campbell Barton <[email protected]>

    Use user-error for user-data validation errors
    
    These errors are caused by incorrectly configured cycle data, not
    internal programming bugs. user-error is more appropriate as it
    won't trigger the debugger and signals user-correctable issues.
    
    Also removed awkward commas after quoted keywords in messages.
---
 cycle-at-point.el | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/cycle-at-point.el b/cycle-at-point.el
index c9973dcb473..29e96bd7e5d 100644
--- a/cycle-at-point.el
+++ b/cycle-at-point.el
@@ -149,19 +149,21 @@ Argument CYCLE-DATA is the list of cycle definitions to 
search."
                                     prefix
                                     cycle-data-index
                                     err))))
-                    ((listp v)) ; Valid: list of strings, continue.
+                    ((listp v)
+                     nil) ; Valid: list of strings, continue.
                     (t
-                     (error "%s: expected `:data', to be a list of strings, 
found %S"
-                            prefix
-                            (type-of v))))
+                     (user-error "%s: expected `:data' to be a list of 
strings, found %S"
+                                 prefix
+                                 (type-of v))))
                    (setq arg-words v))
                   (:case-fold
                    (cond
-                    ((memq v '(nil t))) ; Valid boolean, continue.
+                    ((memq v '(nil t))
+                     nil) ; Valid boolean, continue.
                     (t
-                     (error "%s: expected `:case-fold', to be nil or t" 
prefix)))
+                     (user-error "%s: expected `:case-fold' to be nil or t" 
prefix)))
                    (setq arg-case-fold v))
-                  (_ (error "%s: unknown argument %S" prefix arg-current)))))
+                  (_ (user-error "%s: unknown argument %S" prefix 
arg-current)))))
              (t
               (user-error
                "%s: (error at index %d) all arguments must be keyword, value 
pairs, found %S"

Reply via email to