Browse Source

Bugfix: Fix indentation problems

David Maus writes:

>  When I start to clock a headline (C-c C-x C-i) that does not have a
>  LOGBOOK drawer orgmode inserts one but removes the indentation of the
>  first line below the headline:
>
>  Example:
>
>  * TODO Do something
>   Do this, do that etc.
>
>  after C-c C-x C-i becomes
>
>  * TODO Do something
>   :LOGBOOK:
>   CLOCK: [2009-03-20 Fr 19:03]--[2009-03-20 Fr 19:03] =>  0:00
>   :END:
>  Do this, do that etc.

Fixed with this commit, a patch written by Peter Jones.
Carsten Dominik 16 years ago
parent
commit
76ac6dce68
2 changed files with 7 additions and 5 deletions
  1. 2 0
      lisp/ChangeLog
  2. 5 5
      lisp/org-clock.el

+ 2 - 0
lisp/ChangeLog

@@ -1,5 +1,7 @@
 2009-03-21  Carsten Dominik  <carsten.dominik@gmail.com>
 2009-03-21  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
+	* org-clock.el (org-clock-find-position): Fix drawer indentations.
+
 	* org-export-latex.el (org-export-latex-low-levels): More options
 	* org-export-latex.el (org-export-latex-low-levels): More options
 	for how to process lower levels in LaTeX.
 	for how to process lower levels in LaTeX.
 	(org-export-latex-subcontent): Better treatment for lists as a
 	(org-export-latex-subcontent): Better treatment for lists as a

+ 5 - 5
lisp/org-clock.el

@@ -444,13 +444,13 @@ the clocking selection, associated with the letter `d'."
 		(stringp org-clock-into-drawer)
 		(stringp org-clock-into-drawer)
 		(and (integerp org-clock-into-drawer)
 		(and (integerp org-clock-into-drawer)
 		     (< org-clock-into-drawer 2)))
 		     (< org-clock-into-drawer 2)))
-	(org-indent-line-function)
 	(insert ":" drawer ":\n:END:\n")
 	(insert ":" drawer ":\n:END:\n")
-	(beginning-of-line 0)
-	(org-indent-line-function)
-	(beginning-of-line 0)
+        (beginning-of-line -1)
+        (org-indent-line-function)
 	(org-flag-drawer t)
 	(org-flag-drawer t)
-	(beginning-of-line 2)
+        (beginning-of-line 2)
+        (org-indent-line-function)
+	(beginning-of-line)
 	(or org-log-states-order-reversed
 	(or org-log-states-order-reversed
 	    (and (re-search-forward org-property-end-re nil t)
 	    (and (re-search-forward org-property-end-re nil t)
 		 (goto-char (match-beginning 0))))))))
 		 (goto-char (match-beginning 0))))))))