diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-02-09 00:41:15 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-02-09 00:41:15 +0100 |
commit | 19baf228c0b257f2e338bffc4c6989fbee885c3d (patch) | |
tree | 224651916569374ed697d50f4656e096be8bb350 | |
parent | 67d25049ed5e4497eae3df065858613dcfe2f3de (diff) | |
download | org-mode-19baf228c0b257f2e338bffc4c6989fbee885c3d.tar.gz |
org-habit: Silence byte-compiler
* lisp/org-habit.el (org-habit-build-graph): Silence
byte-compiler. Tiny refactoring.
-rw-r--r-- | lisp/org-habit.el | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/lisp/org-habit.el b/lisp/org-habit.el index 8e5f579..2ef1b7a 100644 --- a/lisp/org-habit.el +++ b/lisp/org-habit.el @@ -388,27 +388,22 @@ current time." (throw :exit s)))))))))) donep))) markedp face) - (if donep - (let ((done-time (time-add - starting - (days-to-time - (- start (time-to-days starting)))))) - - (aset graph index org-habit-completed-glyph) - (setq markedp t) - (while (and done-dates - (= start (car done-dates))) - (setq last-done-date (car done-dates) - done-dates (cdr done-dates)))) - (if todayp - (aset graph index org-habit-today-glyph))) + (cond + (donep + (aset graph index org-habit-completed-glyph) + (setq markedp t) + (while (and done-dates (= start (car done-dates))) + (setq last-done-date (car done-dates)) + (setq done-dates (cdr done-dates)))) + (todayp + (aset graph index org-habit-today-glyph))) (setq face (if (or in-the-past-p todayp) (car faces) (cdr faces))) - (if (and in-the-past-p - (not (eq face 'org-habit-overdue-face)) - (not markedp)) - (setq face (cdr faces))) + (when (and in-the-past-p + (not (eq face 'org-habit-overdue-face)) + (not markedp)) + (setq face (cdr faces))) (put-text-property index (1+ index) 'face face graph) (put-text-property index (1+ index) 'help-echo @@ -416,7 +411,7 @@ current time." (org-time-stamp-format) (time-add starting (days-to-time (- start (time-to-days starting))))) (if donep " DONE" "")) - graph)) + graph)) (setq start (1+ start) index (1+ index))) graph)) |