;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\207" [require cl-lib seq cus-edit] 2) #@63 Check that all VALUES match all SCHEMAS. (fn VALUES SCHEMAS) (defalias 'validate--check-list-contents #[514 "\211\205GGU\204\300\207\301\302\303\304#\"\207" ["wrong number of elements" seq-find identity seq-mapn validate--check] 8 (#$ . 494)]) #@10 (fn X) (defalias 'validate--indent-by-2 #[257 "\300\301\302#\207" [replace-regexp-in-string "^" " "] 5 (#$ . 753)]) #@100 Return nil if VALUE matches SCHEMA. If they don't match, return an explanation. (fn VALUE SCHEMA) (defalias 'validate--check #[514 "C\243\242\206\n\302\303@!\203+A\203+\211A\262\242\211A\262\242BB\262\202 \304\305\"\2063\262\302\306\307\310\311\312 !\313\"\314\315%\262\316\317\"\203P\302\202\252\320\321\"\203i\211\322!\206\252\323\242!?\205\252\324\202\252\316\325\"\203v\211!\202\252\320\326\"\203\241\3271\214\330\242\331\"\210\3320\202\220\210\202\227\203\227\302\202\252\211\333!\206\252\334\202\252\320\335\"\203\326\203\261A\203\267\336\337!\202\252\211\340!\206\252@\341\306\307\342\311\312!\343\"\344\345%\242\"\262\202\252\316\346\"\203\352\242@\232?\205\252\347\202\252\320\350\"\203\211\333!\206\252\351\242!\203\302\202\252\304\352\"\203 \353\202\252\354\242!?\205\252\355\202\252\320\356\"\203H\211\333!\206\252\357\242!\2031\302\202\252\351\242!\203<\360\202\252\354\242!?\205\252\361\202\252\320\362\"\203[\211\333!\205\252\211\312!\202\252\320\363\"\203h\211\322!\202\252\320\364\"\203u\211\333!\202\252\320\365\"\203\227\211\365!\206\252\366\242@@\"\206\252\366\242AA@\"\202\252\316\367\"\203\254\211\340!\206\252\370\242\"\202\252\320\312\"\203\301\211\312!\206\252\370\242\"\202\252\320\371\"\203\373\304\372\"\304\373\"\204\332\336\374!\202\366\211\204\344\336\375!\202\366\340!\206\366\366\242\335\365ED\"\266\202\202\252\316\376\"\203DA\204 \336\377!\202\252\201@\306\307\201A\311\312\n!\201B\"\344\201C%\"\201D\201E\"\205?\201F\201G\201H\201I#P\262\202\252\320\201J\"\205\252\211\340!\206\252\332C\211\203\221\211@\201K\306\307\201L\311\312!\201M\"\344\201C% \242#\211=\204\211\201N \242\"\240\210\210A\266\202\202V\210\242\205\250\201O\201G\201P\242\201Q#P\262\262\211\205\326\344\201R\201S\201T\242\330\201U\"\203\317\202\324\201H!$*\262\266\203\207" [print-level print-length nil keywordp plist-get :args make-byte-code 257 "\301\302\303\"!\300\242!?\205\302\304\"\207" vconcat vector [intern format "%sp" "not a %s"] 5 "\n\n(fn TT)" memql (sexp other) eql variable symbol boundp "this symbol has no variable binding" (integer number float string character symbol function boolean face) regexp (error) string-match "" t string "not a valid regexp" repeat error "`repeat' needs exactly one argument" list seq-some "\301\300\"\207" [validate--check] 4 "\n\n(fn V)" (const function-item variable-item) "not the expected value" file file-exists-p :must-match "file does not exist" file-writable-p "file is not accessible" directory file-directory-p "path is not a directory" "directory is not accessible" key-sequence coding-system color cons validate--check (list group) validate--check-list-contents alist :value-type :key-type "`alist' needs a :value-type" "`alist' needs a :key-type" (choice radio) "`choice' needs at least one argument" mapcar "\301\300\242\"\207" [validate--check] "\n\n(fn X)" seq-every-p identity "all of the options failed\n" mapconcat validate--indent-by-2 "\n" set seq-find "\301\300\"?\207" [validate--check] remove "the following values don't match any of the options:\n " #[257 "\300\301\"\207" [format "%s"] 4 "\n\n(fn X)"] "\n " 2 format "Looking for `%S' in `%S' failed because:\n%s" "\\`Looking"] 17 (#$ . 880)]) #@216 Check that VALUE matches SCHEMA. If it matches return VALUE, otherwise signal a `user-error'. If NOERROR is non-nil, return t to indicate a match and nil to indicate a failure. (fn VALUE SCHEMA &optional NOERROR) (defalias 'validate-value #[770 "\300\"\211\203?\205\301\302\"\202\207" [validate--check user-error "%s"] 7 (#$ . 4284)]) #@264 Check that SYMBOL's value matches its schema. SYMBOL must be the name of a custom option with a defined `custom-type'. If SYMBOL has a value and a type, they are checked with `validate-value'. NOERROR is passed to `validate-value'. (fn SYMBOL &optional NOERROR) (defalias 'validate-variable #[513 "J\300!\211\203\301\"\202\203\202\302\303\"\207" [custom-variable-type validate-value error "Variable `%s' has no custom-type."] 7 (#$ . 4639)]) #@72 Mark SYMBOL as a safe local if its custom type is obeyed. (fn SYMBOL) (defalias 'validate-mark-safe-local #[257 "\300\301\302\303\304\305\306!\307\"\310\311%#\207" [put safe-local-variable make-byte-code 257 "\301\302\300!\303#\207" vconcat vector [validate-value custom-variable-type noerror] 5 "\n\n(fn VAL)"] 10 (#$ . 5103)]) #@123 Like `setq', but throw an error if validation fails. VALUE is validated against SYMBOL's custom type. (fn [SYM VAL] ...) (defalias 'validate-setq '(macro . #[128 "\300\203<\211A\262\242\204\301\302!\202\211A\262\242\303\304\305DD\306\307\310\305 DDEE\311\312\305DEFB\266\203\202\313\314!B\207" [nil error "`validate-setq' takes an even number of arguments" if boundp quote setq validate-value custom-variable-type user-error "Trying to validate a variable that's not defined yet: `%s'.\nYou need to require the package before validating" progn reverse] 13 (#$ . 5444)])) (provide 'validate)