[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/org b523ad4: ob-tangle.el: Fix coderef removal
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/org b523ad4: ob-tangle.el: Fix coderef removal during tangling |
Date: |
Fri, 9 Apr 2021 18:57:13 -0400 (EDT) |
branch: externals-release/org
commit b523ad491dd3d3aebac77d42e48eac1e0ff345f1
Author: Tom Gillespie <tgbugs@gmail.com>
Commit: Nicolas Goaziou <mail@nicolasgoaziou.fr>
ob-tangle.el: Fix coderef removal during tangling
* lisp/ob-tangle.el (orb-babel-tangle-single-block): Regularize
behavior when removing coderefs during tangling. This fixes an issue
where trailing whitespace would be retained when coderefs were removed
for tangling.
---
lisp/ob-tangle.el | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index 3c3943c..b9f9eb7 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -415,9 +415,8 @@ non-nil, return the full association list to be used by
(src-lang (nth 0 info))
(params (nth 2 info))
(extra (nth 3 info))
- (cref-fmt (or (and (string-match "-l \"\\(.+\\)\"" extra)
- (match-string 1 extra))
- org-coderef-label-format))
+ (coderef (nth 6 info))
+ (cref-regexp (org-src-coderef-regexp coderef))
(link (let ((l (org-no-properties (org-store-link nil))))
(and (string-match org-link-bracket-re l)
(match-string 1 l))))
@@ -446,8 +445,7 @@ non-nil, return the full association list to be used by
(funcall assignments-cmd params))))))
(when (string-match "-r" extra)
(goto-char (point-min))
- (while (re-search-forward
- (replace-regexp-in-string "%s" ".+" cref-fmt) nil t)
+ (while (re-search-forward cref-regexp nil t)
(replace-match "")))
(run-hooks 'org-babel-tangle-body-hook)
(buffer-string))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals-release/org b523ad4: ob-tangle.el: Fix coderef removal during tangling,
ELPA Syncer <=