Browse Source

org: Improve org-todo handling of negative prefix args

* lisp/org.el (org-todo): Handle -1 prefix args consistently and error
on other negative args.
Allen Li 3 years ago
parent
commit
bfd63cc4f2
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/org.el

+ 2 - 1
lisp/org.el

@@ -8901,7 +8901,8 @@ When called through ELisp, arg is also interpreted in the following way:
 	 nil cl
 	 nil cl
 	 (when (org-invisible-p) (org-end-of-subtree nil t))))
 	 (when (org-invisible-p) (org-end-of-subtree nil t))))
     (when (equal arg '(16)) (setq arg 'nextset))
     (when (equal arg '(16)) (setq arg 'nextset))
-    (when (equal arg -1) (org-cancel-repeater) (setq arg nil))
+    (when (equal (prefix-numeric-value arg) -1) (org-cancel-repeater) (setq arg nil))
+    (when (< (prefix-numeric-value arg) -1) (user-error "Prefix argument %d not supported" arg))
     (let ((org-blocker-hook org-blocker-hook)
     (let ((org-blocker-hook org-blocker-hook)
 	  commentp
 	  commentp
 	  case-fold-search)
 	  case-fold-search)