[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 0d3bf2ed49 1/2: org-babel-tangle-single-block: Do n
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 0d3bf2ed49 1/2: org-babel-tangle-single-block: Do not create comment link when not requested |
Date: |
Sun, 31 Jul 2022 02:58:01 -0400 (EDT) |
branch: externals/org
commit 0d3bf2ed491ab2828ca1a2c42ea0d4e457c32bd4
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
org-babel-tangle-single-block: Do not create comment link when not requested
* lisp/ob-tangle.el (org-babel-tangle-single-block): Do not spend
extra time creating link to source block when :comments is set to
"no".
---
lisp/ob-tangle.el | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index fdba72278f..4b8fad6ce6 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -485,16 +485,20 @@ non-nil, return the full association list to be used by
(extra (nth 3 info))
(coderef (nth 6 info))
(cref-regexp (org-src-coderef-regexp coderef))
- (link (let* (
- ;; The created link is transient. Using ID is
- ;; not necessary, but could have side-effects if
- ;; used. An ID property may be added to
- ;; existing entries thus creatin unexpected file
- ;; modifications.
- (org-id-link-to-org-use-id nil)
- (l (org-no-properties (org-store-link nil))))
- (and (string-match org-link-bracket-re l)
- (match-string 1 l))))
+ (link (if (string= "no" (cdr (assq :comments params))) ""
+ (let* (
+ ;; The created link is transient. Using ID is
+ ;; not necessary, but could have side-effects if
+ ;; used. An ID property may be added to
+ ;; existing entries thus creating unexpected
+ ;; file modifications.
+ (org-id-link-to-org-use-id nil)
+ (l (org-no-properties
+ (cl-letf (((symbol-function
'org-store-link-functions)
+ (lambda () nil)))
+ (org-store-link nil)))))
+ (and (string-match org-link-bracket-re l)
+ (match-string 1 l)))))
(source-name
(or (nth 4 info)
(format "%s:%d"