summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2019-07-06 10:24:11 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-07-06 10:24:11 +0200
commitacf4f0881a2435f44ceaf15568d15e39490a1287 (patch)
treeb1aeada828e012a58d48b3e3f2c92bd7c3e36e35
parent7bc6f8d61964be4f090e90535022d8ed03fe775a (diff)
downloadorg-mode-acf4f0881a2435f44ceaf15568d15e39490a1287.tar.gz
org-agenda: Fix "Args out of range" error in `org-agenda-list'
* lisp/org-agenda.el (org-agenda-list): Do not add text properties on empty headers.
-rw-r--r--lisp/org-agenda.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 67a0f33..c05d0a7 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4189,9 +4189,12 @@ items if they have an hour specification like [h]h:mm."
((= w1 w2) (format " (W%02d)" w1))
(t (format " (W%02d-W%02d)" w1 w2)))
":\n")))
- (add-text-properties s (1- (point)) (list 'face 'org-agenda-structure
- 'org-date-line t))
- (org-agenda-mark-header-line s))
+ ;; Add properties if we actually inserted a header.
+ (when (> (point) s)
+ (add-text-properties s (1- (point))
+ (list 'face 'org-agenda-structure
+ 'org-date-line t))
+ (org-agenda-mark-header-line s)))
(while (setq d (pop day-numbers))
(setq date (calendar-gregorian-from-absolute d)
s (point))