Browse Source

Added a :link parameter to org-dblock-write:clocktable.

Bastien Guerry 17 năm trước cách đây
mục cha
commit
3ac45fa5f2
2 tập tin đã thay đổi với 14 bổ sung3 xóa
  1. 4 2
      ChangeLog
  2. 10 1
      org.el

+ 4 - 2
ChangeLog

@@ -1,8 +1,10 @@
 2008-03-06  Bastien Guerry  <bzg@altern.org>
 
 	* org.el (org-get-legal-level): Aliased to `org-get-valid-level'.
-	* org.el (org-get-tags-at): Bugfix: prevent `org-back-to-heading'
-	from throwing an error when getting tags before headlines.
+	(org-dblock-write:clocktable): Added a :link parameter, linking
+	headlines to their location in the Org agenda files.
+	(org-get-tags-at): Bugfix: prevent `org-back-to-heading' from
+	throwing an error when getting tags before headlines.
 
 2008-03-06  Carsten Dominik  <dominik@science.uva.nl>
 

+ 10 - 1
org.el

@@ -19331,6 +19331,7 @@ the returned times will be formatted strings."
 	   (ts (plist-get params :tstart))
 	   (te (plist-get params :tend))
 	   (block (plist-get params :block))
+	   (link (plist-get params :link))
 	   ipos time h m p level hlc hdl
 	   cc beg end pos tbl)
       (when step
@@ -19395,7 +19396,15 @@ the returned times will be formatted strings."
 					(- (match-end 1) (match-beginning 1))))
 			   (<= level maxlevel))
 		  (setq hlc (if emph (or (cdr (assoc level hlchars)) "") "")
-			hdl (match-string 2)
+			hdl (if (not link)
+				(match-string 2)
+			      (org-make-link-string
+			       (format "file:%s::%s"
+				       (buffer-file-name)
+				       (save-match-data
+					 (org-make-org-heading-search-string
+					  (match-string 2))))
+			       (match-string 2)))
 			h (/ time 60)
 			m (- time (* 60 h)))
 		  (if (and (not multifile) (= level 1)) (push "|-" tbl))