Skip to content

Commit c779b7a

Browse files
committed
org-babel-detangle: Fix :comments link for src blocks before first heading
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org): Allow fuzzy matching when following the backlink to src block from tangles source. The current default value of `org-link-search-must-match-exact-headline` makes `org-link-open-from-string` treat fuzzy links as headlines without falling back to fuzzy text search. Bind it to nil to force fuzzy text matching while detangling. Fixes https://orgmode.org/list/87zgh1qxfk.fsf@posteo.net
1 parent 6dc7852 commit c779b7a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lisp/ob-tangle.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,10 @@ which enable the original code blocks to be found."
581581
(error "Not in tangled code"))
582582
(setq body (buffer-substring body-start end)))
583583
;; Go to the beginning of the relative block in Org file.
584-
(org-link-open-from-string link)
584+
;; Explicitly allow fuzzy search even if user customized
585+
;; otherwise.
586+
(let (org-link-search-must-match-exact-headline)
587+
(org-link-open-from-string link))
585588
(setq target-buffer (current-buffer))
586589
(if (string-match "[^ \t\n\r]:\\([[:digit:]]+\\)" block-name)
587590
(let ((n (string-to-number (match-string 1 block-name))))

0 commit comments

Comments
 (0)