diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-07-06 10:24:11 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-07-06 10:24:11 +0200 |
commit | acf4f0881a2435f44ceaf15568d15e39490a1287 (patch) | |
tree | b1aeada828e012a58d48b3e3f2c92bd7c3e36e35 | |
parent | 7bc6f8d61964be4f090e90535022d8ed03fe775a (diff) | |
download | org-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.el | 9 |
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)) |