Derek Chen-Becker <[email protected]> writes: > Here's the full set of patches for removing the deprecated `show' parameter > as well as updating the handling of priorities in `org-priority'. Looking > forward to your feedback.
Thanks! Please use double space between sentences in the commit message. > + (user-error "Invalid priority value `%s'" priority))) Just `error' I think. `user-error' is used when the requested user command cannot be performed. Here, it is just a function that is called with invalid value. > When called programmatically, ACTION can be `set', `up', `down', an > uppercase alphabetic character A through Z, or an integer 0 through 64, > inclusive. If a lower-case character is passed as ACTION or entered via > interactive prompt, it will automatically be converted to uppercase." What about 'remove? > ;; Validate the input string to ensure it's a valid value because > ;; string-to-number returns zero for a non-numeric > string, which could > ;; be a valid priority > (unless (string-match-p "[0-9]\\|[1-5][0-9]\\|6[0-4]" > s) > (user-error "Priority must be a number between `%s' > and `%s'" > (org-priority-to-string > org-priority-highest) > (org-priority-to-string > org-priority-lowest))) Why not using `org-priority-valid-cookie-string-p'? > + (let ((validatef (lambda (variable value) > + (widget-apply (widget-convert (get variable > 'custom-type)) :match value)))) > + ;; Valid numeric values for high/low/default > + (seq-every-p (lambda (var) > + (should (funcall validatef var 0)) `cl-flet' would lead to slightly shorter code here. -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>
