Browse Source

Fix bug in org-narrow-to-subtree, which could lead to clock errors

Bernt Hansen writes:

> I have a monthly repeated task (Archive tasks) that has lots of
> old clock time on it currently but has never been marked DONE
> since the creation of the property LAST_REPEAT_TIME.  If this
> task is clocking when Emacs exits and you restart emacs and
> answer Yes to continue the clock - the modeline has the total
> time for the parent task (151:04 instead of the total time for
> this task (5:04).  If I clock the task in again the modeline is
> correct.
Carsten Dominik 16 years ago
parent
commit
7087902788
3 changed files with 6 additions and 2 deletions
  1. 4 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-clock.el
  3. 1 1
      lisp/org.el

+ 4 - 0
lisp/ChangeLog

@@ -1,5 +1,9 @@
 2009-07-08  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-clock.el (org-clock-goto): Find hidden headlines as well.
+
+	* org.el (org-narrow-to-subtree): Find hidden headlines as well.
+
 	* org-plot.el (org-plot/add-options-to-plist): Add timeind
 	option.
 

+ 1 - 1
lisp/org-clock.el

@@ -811,7 +811,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection."
     (if (or (< m (point-min)) (> m (point-max))) (widen))
     (goto-char m)
     (org-show-entry)
-    (org-back-to-heading)
+    (org-back-to-heading t)
     (org-cycle-hide-drawers 'children)
     (recenter)
     (if recent

+ 1 - 1
lisp/org.el

@@ -6176,7 +6176,7 @@ If yes, remember the marker and the distance to BEG."
   (save-excursion
     (save-match-data
       (narrow-to-region
-       (progn (org-back-to-heading) (point))
+       (progn (org-back-to-heading t) (point))
        (progn (org-end-of-subtree t) (point))))))
 
 (defun org-clone-subtree-with-time-shift (n &optional shift)