瀏覽代碼

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 6 年之前
父節點
當前提交
ee1ec29405
共有 1 個文件被更改,包括 3 次插入0 次删除
  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