Browse Source

org-agenda: Test if span makes sense

* lisp/org-agenda.el (org-agenda-list): Raise an error if span is
  negative.

Recent behavior was to create an agenda for one day.
Marco Wahl 1 month ago
parent
commit
ee1ec29405
1 changed files with 3 additions and 0 deletions
  1. 3 0
      lisp/org-agenda.el

+ 3 - 0
lisp/org-agenda.el

@@ -4127,6 +4127,9 @@ items if they have an hour specification like [h]h:mm."
 	  span (nth 2 org-agenda-overriding-arguments)))
   (when (and (integerp arg) (> arg 0))
     (setq span arg arg nil))
+  (when (numberp span)
+    (unless (< 0 span)
+      (user-error "Agenda creation impossible for this span(=%d days)." span)))
   (catch 'exit
     (setq org-agenda-buffer-name
 	  (or org-agenda-buffer-tmp-name