Browse Source

Clock history: Second try to get fontification right.

Carsten Dominik 16 years ago
parent
commit
88673a8724
2 changed files with 14 additions and 3 deletions
  1. 3 0
      lisp/ChangeLog
  2. 11 3
      lisp/org-clock.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-05-05  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-clock.el (org-clock-insert-selection-line): Fix prefious
+	patch.
+
 	* org.el (org-edit-src-code, org-edit-fixed-width-region): Use
 	separate buffer instead of indirect buffer to edit source code.
 	(org-edit-src-exit): Make this function work with the new setup.

+ 11 - 3
lisp/org-clock.el

@@ -242,7 +242,7 @@ of a different task.")
 And return a cons cell with the selection character integer and the marker
 pointing to it."
   (when (marker-buffer marker)
-    (let (file cat task)
+    (let (file cat task heading prefix)
       (with-current-buffer (org-base-buffer (marker-buffer marker))
 	(save-excursion
 	  (save-restriction
@@ -252,8 +252,16 @@ pointing to it."
 		  cat (or (org-get-category)
 			  (progn (org-refresh-category-properties)
 				 (org-get-category)))
-		  task (org-fontify-like-in-org-mode
-			(org-get-heading 'notags) org-odd-levels-only)))))
+		  heading (org-get-heading 'notags)
+		  prefix (save-excursion
+			  (org-back-to-heading t)
+			  (looking-at "\\*+ ")
+			  (match-string 0))
+		  task (substring
+			(org-fontify-like-in-org-mode 
+			 (concat prefix heading)
+			 org-odd-levels-only)
+			(length prefix))))))
       (when (and cat task)
 	(insert (format "[%c] %-15s %s\n" i cat task))
 	(cons i marker)))))