diff options
author | Max Mikhanosha <max@openchat.com> | 2013-03-26 06:54:53 -0400 |
---|---|---|
committer | Max Mikhanosha <max@openchat.com> | 2013-03-26 06:55:53 -0400 |
commit | 9594249b4d5ceacfe96dc97c40f697de48cf50d3 (patch) | |
tree | 8c07b3daad9692798a483ea6b3684ccc9e64947c | |
parent | 2c994218ea67ced426f03d0a851eeec81f112dbc (diff) | |
download | org-mode-9594249b4d5ceacfe96dc97c40f697de48cf50d3.tar.gz |
Fix agenda generation error if agenda had time grid and agenda format
contain effort
* lisp/org-agenda.el (org-agenda-format-item): Ensure effort is "" when unset
-rw-r--r-- | lisp/org-agenda.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index b722657..72ff2a7 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6493,12 +6493,15 @@ Any match of REMOVE-RE will be removed from TXT." (match-string 2 txt)) t t txt)))) (when (derived-mode-p 'org-mode) - (setq effort (ignore-errors (get-text-property 0 'org-effort txt))) - (if effort - (setq neffort (org-duration-string-to-minutes effort) - effort (setq effort (concat "[" effort "]"))) - ;; prevent erroring out with %e format when there is no effort - (setq effort ""))) + (setq effort (ignore-errors (get-text-property 0 'org-effort txt)))) + + ;; org-agenda-add-time-grid-maybe calls us with *Agenda* as + ;; current buffer, so move this check outside of above + (if effort + (setq neffort (org-duration-string-to-minutes effort) + effort (setq effort (concat "[" effort "]"))) + ;; prevent erroring out with %e format when there is no effort + (setq effort "")) (when remove-re (while (string-match remove-re txt) |