Browse Source

Fix bug with invisible agenda items

Peter Westlake writes:

> This is quite obscure, and an odd corner case, but here it is.
>
> If you have an item which is:
>
> - a TODO
> - scheduled
> - ordered
> - blocked by a child TODO
>
> then it leaves an empty line in the agenda.
>
> Here's a test case:
> ,----
> | * Press t r on this line in the agenda
> |   SCHEDULED: <2009-09-02 Wed>
> |   :PROPERTIES:
> |   :ORDERED:  t
> |   :END:
> | *** TODO Report invisible scheduled items
> `----
>
> C-a a a will show an agenda with "Scheduled: Press t r ...".
> Press "t" on that line to add a TODO.
> Press "r" to redisplay, and see the line go blank.
>
> Peter.
Carsten Dominik 15 years ago
parent
commit
0f9ad773c0
2 changed files with 8 additions and 1 deletions
  1. 5 0
      lisp/ChangeLog
  2. 3 1
      lisp/org-agenda.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2009-09-03  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-agenda.el (org-agenda-dim-blocked-tasks): Make sure the
+	invisibility overlay starts on the newline.
+
 2009-09-02  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-protocol.el (org-protocol-store-link)

+ 3 - 1
lisp/org-agenda.el

@@ -2573,7 +2573,9 @@ bind it in the options section.")
 				       :from 'todo
 				       :to 'done)))))))
 	    (if org-blocked-by-checkboxes (setq invis1 nil))
-	    (setq b (if invis1 (max (point-min) (1- (point))) (point))
+	    (setq b (if invis1
+			(max (point-min) (1- (point-at-bol)))
+		      (point-at-bol))
 		  e (point-at-eol)
 		  ov (org-make-overlay b e))
 	    (if invis1