|
@@ -494,14 +494,16 @@ non-nil, return the full association list to be used by
|
|
|
result)))
|
|
|
|
|
|
(defun org-babel-tangle-comment-links (&optional info)
|
|
|
- "Return a list of begin and end link comments for the code block at point."
|
|
|
- (let ((link-data
|
|
|
- `(("start-line" . ,(number-to-string
|
|
|
- (org-babel-where-is-src-block-head)))
|
|
|
- ("file" . ,(buffer-file-name))
|
|
|
- ("link" . ,(org-no-properties (org-store-link nil)))
|
|
|
- ("source-name" .
|
|
|
- ,(nth 4 (or info (org-babel-get-src-block-info 'light)))))))
|
|
|
+ "Return a list of begin and end link comments for the code block at point.
|
|
|
+INFO, when non nil, is the source block information, as returned
|
|
|
+by `org-babel-get-src-block-info'."
|
|
|
+ (let ((link-data (pcase (or info (org-babel-get-src-block-info 'light))
|
|
|
+ (`(,_ ,_ ,_ ,_ ,name ,start ,_)
|
|
|
+ `(("start-line" . ,(org-with-point-at start
|
|
|
+ (line-beginning-position)))
|
|
|
+ ("file" . ,(buffer-file-name))
|
|
|
+ ("link" . ,(org-no-properties (org-store-link nil)))
|
|
|
+ ("source-name" . ,name))))))
|
|
|
(list (org-fill-template org-babel-tangle-comment-format-beg link-data)
|
|
|
(org-fill-template org-babel-tangle-comment-format-end link-data))))
|
|
|
|