org-mode/testing/lisp
Hraban Luyat 8a781d35dc
ob-tangle.el: fix ‘:comments noweb’ double linking
* lisp/ob-tangle.el: Refactor the double implementation to a single
helper function.  This avoids the double link wrapping.

* testing/lisp/test-ob-tangle.el: Add unit tests.

Babel tangle allows inserting comments at the tangled site which link
back to the source in the org file.  This linking was implemented
twice, to handle separate cases, but when using ‘:comments noweb’ it
ended up going through both codepaths.  This resulted in doubly
wrapped links.

By refactoring all link generation into a single function, this double
wrapping is avoided.

Example file, /tmp/test.org:

    * Inner
    #+name: inner
    #+begin_src emacs-lisp
    2
    #+end_src

    * Main
    #+header: :tangle test.el :comments noweb :noweb yes
    #+begin_src emacs-lisp
    1
    <<inner>>
    #+end_src

Before:

    ;; [[file:test.org::*Main][Main:1]]
    1
    ;; [[[[file:/tmp/test.org::inner][inner]]][inner]]
    2
    ;; inner ends here
    ;; Main:1 ends here

After:

    ;; [[file:test.org::*Main][Main:1]]
    1
    ;; [[file:test.org::inner][inner]]
    2
    ;; inner ends here
    ;; Main:1 ends here
2022-08-13 14:39:09 +08:00
..
test-ob-awk.el org-test: Fix ERC errors using latest Emacs master 2021-11-24 20:06:15 +08:00
test-ob-C.el org-test: Fix ERC errors using latest Emacs master 2021-11-24 20:06:15 +08:00
test-ob-clojure.el Update copyright year to 2022 2022-01-01 15:17:08 -05:00
test-ob-emacs-lisp.el Update copyright year to 2022 2022-01-01 15:17:08 -05:00
test-ob-eshell.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-exp.el org-babel-exp-process-buffer: Improve performance 2022-06-16 13:21:39 +08:00
test-ob-fortran.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-header-arg-defaults.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-java.el Update copyright year to 2022 2022-01-01 15:17:08 -05:00
test-ob-julia.el Include support for evaluating julia code 2021-09-25 16:00:02 +02:00
test-ob-lilypond.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-lob.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-lua.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-maxima.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-octave.el test-ob-octave: Add missing `provide' 2022-04-27 16:56:31 +08:00
test-ob-perl.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-plantuml.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-python.el ob-comint.el, ob-python.el: Async session evaluation 2021-05-18 09:13:28 -07:00
test-ob-R.el lisp/ob-R: Async evaluation in R 2021-09-28 18:22:12 +02:00
test-ob-ruby.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-scheme.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-sed.el org-test: Fix ERC errors using latest Emacs master 2021-11-24 20:06:15 +08:00
test-ob-shell.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-sql.el ob-sql.el: Add support for SAP HANA 2021-03-16 23:53:09 -04:00
test-ob-sqlite.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-table.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ob-tangle.el ob-tangle.el: fix ‘:comments noweb’ double linking 2022-08-13 14:39:09 +08:00
test-ob.el ob-core.el/babel: Special handling for attachment links in src block 2022-06-14 21:44:25 +08:00
test-oc.el oc: Allow declaring cite styles as a function 2021-12-12 15:42:29 +01:00
test-ol-bbdb.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-ol.el * testing/lisp/test-ol.el: Fix test name 2022-08-06 13:52:44 +08:00
test-org-agenda.el org-agenda: Fix regression when diary sexp timestamps are ignored 2022-03-26 15:17:45 +08:00
test-org-archive.el Re-implement org-element-cache and add headline support 2021-10-16 23:22:18 +08:00
test-org-attach-git.el test-org-attach-git: Fix recent failure to load tests 2021-11-27 16:16:51 -05:00
test-org-attach.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-org-capture.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-org-clock.el Use `org-encode-time' helper macro 2022-07-17 16:40:18 +08:00
test-org-colview.el Re-implement org-element-cache and add headline support 2021-10-16 23:22:18 +08:00
test-org-datetree.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-org-duration.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-org-element.el ; Fix typos 2022-07-01 17:42:52 +08:00
test-org-feed.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-org-fold.el test-org-fold: Cover the issue fixed by previous commit 2022-07-12 21:30:58 +08:00
test-org-footnote.el footnote: Allow footnotes at footnote definition start 2021-10-06 14:34:14 +02:00
test-org-info.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-org-inlinetask.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-org-lint.el Merge branch 'bugfix' 2022-02-13 22:14:55 +01:00
test-org-list.el org-list-struct-apply-struct: Do not rely on `match-data' after edits 2022-07-11 19:13:07 +08:00
test-org-macro.el macro: Properly collect multiple authors 2021-10-23 14:32:00 +02:00
test-org-macs.el test-org-macs.el: Add test for template-expansion bug 2022-04-30 17:45:32 +08:00
test-org-num.el org-num: Add tests 2020-08-28 08:45:41 +02:00
test-org-pcomplete.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-org-protocol.el test-org-protocol.el: Decode "+" to " " tests 2021-09-27 17:52:03 +02:00
test-org-src.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-org-table.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-org-tempo.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-org-timer.el Prefer HTTPS to HTTP for links to gnu.org 2021-03-21 14:29:13 -04:00
test-org.el testing/lisp: Update to handle new download policy 2022-07-20 23:37:26 +08:00
test-ox-publish.el ; Fix typos 2022-07-01 17:42:52 +08:00
test-ox.el testing/lisp: Update to handle new download policy 2022-07-20 23:37:26 +08:00
test-property-inheritance.el org-test: Fix ERC errors using latest Emacs master 2021-11-24 20:06:15 +08:00