mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-30 05:07:48 +00:00
Fix %start-line in `org-babel-tangle-comment-links'
* lisp/ob-tangle.el (org-babel-tangle-comment-links): %start-line reports the line number, not the buffer position at the beginning of line. Reported-by: immanuel <immanuel.litzroth@gmail.com> <http://lists.gnu.org/r/emacs-orgmode/2019-08/msg00267.html>
This commit is contained in:
parent
d64f7a2c9b
commit
ed048fa83d
|
@ -494,14 +494,16 @@ non-nil, return the full association list to be used by
|
||||||
result)))
|
result)))
|
||||||
|
|
||||||
(defun org-babel-tangle-comment-links (&optional info)
|
(defun org-babel-tangle-comment-links (&optional info)
|
||||||
"Return a list of begin and end link comments for the code block at point."
|
"Return a list of begin and end link comments for the code block at point.
|
||||||
(let ((link-data
|
INFO, when non nil, is the source block information, as returned
|
||||||
`(("start-line" . ,(number-to-string
|
by `org-babel-get-src-block-info'."
|
||||||
(org-babel-where-is-src-block-head)))
|
(let ((link-data (pcase (or info (org-babel-get-src-block-info 'light))
|
||||||
("file" . ,(buffer-file-name))
|
(`(,_ ,_ ,_ ,_ ,name ,start ,_)
|
||||||
("link" . ,(org-no-properties (org-store-link nil)))
|
`(("start-line" . ,(org-with-point-at start
|
||||||
("source-name" .
|
(line-beginning-position)))
|
||||||
,(nth 4 (or info (org-babel-get-src-block-info 'light)))))))
|
("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)
|
(list (org-fill-template org-babel-tangle-comment-format-beg link-data)
|
||||||
(org-fill-template org-babel-tangle-comment-format-end link-data))))
|
(org-fill-template org-babel-tangle-comment-format-end link-data))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue