summaryrefslogtreecommitdiff
path: root/lisp/org/org-habit.el
diff options
context:
space:
mode:
authorBastien Guerry <bastien1@free.fr>2012-04-01 11:49:25 +0200
committerBastien Guerry <bastien1@free.fr>2012-04-01 11:49:25 +0200
commit153ae947f845f6d4f31d3d239a1449899c3384f0 (patch)
treeb7ef6c7f4b94f4a4ee19eecd079c36aff84bddc5 /lisp/org/org-habit.el
parent42ee526b1adbe2ba7766203980a9d7089aae1a68 (diff)
downloademacs-153ae947f845f6d4f31d3d239a1449899c3384f0.tar.gz
Update to Org version 7.8.07 (commit da0e6f in Org's repo)
Diffstat (limited to 'lisp/org/org-habit.el')
-rw-r--r--lisp/org/org-habit.el26
1 files changed, 17 insertions, 9 deletions
diff --git a/lisp/org/org-habit.el b/lisp/org/org-habit.el
index 67f87797cb1..d019f3aeae6 100644
--- a/lisp/org/org-habit.el
+++ b/lisp/org/org-habit.el
@@ -334,7 +334,14 @@ current time."
(let ((inhibit-read-only t) l c
(buffer-invisibility-spec '(org-link))
(moment (time-subtract (current-time)
- (list 0 (* 3600 org-extend-today-until) 0))))
+ (list 0 (* 3600 org-extend-today-until) 0)))
+ disabled-overlays)
+ ;; Disable filters; this helps with alignment if there are links.
+ (mapc (lambda (ol)
+ (when (overlay-get ol 'invisible)
+ (overlay-put ol 'invisible nil)
+ (setq disabled-overlays (cons ol disabled-overlays))))
+ (overlays-in (point-min) (point-max)))
(save-excursion
(goto-char (if line (point-at-bol) (point-min)))
(while (not (eobp))
@@ -344,14 +351,15 @@ current time."
(delete-char (min (+ 1 org-habit-preceding-days
org-habit-following-days)
(- (line-end-position) (point))))
- (insert (org-habit-build-graph
- habit
- (time-subtract moment
- (days-to-time org-habit-preceding-days))
- moment
- (time-add moment
- (days-to-time org-habit-following-days))))))
- (forward-line)))))
+ (insert-before-markers
+ (org-habit-build-graph
+ habit
+ (time-subtract moment (days-to-time org-habit-preceding-days))
+ moment
+ (time-add moment (days-to-time org-habit-following-days))))))
+ (forward-line)))
+ (mapc (lambda (ol) (overlay-put ol 'invisible t))
+ disabled-overlays)))
(defun org-habit-toggle-habits ()
"Toggle display of habits in an agenda buffer."