summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Wahl <marcowahlsoft@gmail.com>2019-03-18 15:06:15 +0100
committerMarco Wahl <marcowahlsoft@gmail.com>2019-03-18 15:06:15 +0100
commitee1ec294056ad71c7356ff8ba3b46d786a606f38 (patch)
tree6451c874151ae6dd45428ae15d0a8d74644fc18a
parentc2f3f1912e78bd9eb0f79f28d876e97ab52f924c (diff)
downloadorg-mode-ee1ec294056ad71c7356ff8ba3b46d786a606f38.tar.gz
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.
-rw-r--r--lisp/org-agenda.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index f6f501b..baf9c8d 100644
--- a/lisp/org-agenda.el
+++ b/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