emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jeremias Gonzalez <jgonzalez49@ucmerced.edu>
To: emacs-orgmode@gnu.org
Subject: org-babel-tangle not using relative links
Date: Fri, 5 Jun 2020 23:06:26 -0700	[thread overview]
Message-ID: <6fb12326-52d3-7177-eff5-62603261b388@ucmerced.edu> (raw)

I cannot seem to be able to make org-babel-tangle respect the setting of 
org-babel-tangle-use-relative-file-links to t. Here is my process after 
launching "emacs -Q" (the default for 
org-babel-tangle-use-relative-file-links appears to be true in this 

1. Write example org file named test.org with the following basic 
contents, making sure that the top line is refreshed with C-c C-c:

#+PROPERTY: header-args :tangle test.py :comments link
* My top level
Here is my description
#+BEGIN_SRC python
print("This is my code")

2. Run M-x org-babel-tangle on the org file, which produces test.py with 
the following contents:

# [[file:d:/mytest/test.org::*My%20top%20level][My top level:1]]
print("This is my code")
# My top level:1 ends here

As can be seen in the first line, it uses an absolute file path 
containing my org file and py file, rather than the expected relative one.

I looked through the ob-tangle.el file to try and see why this is the 
case, and it looks like there's some negative boolean result in this if 
statement in the org-babel-tangle-single-block function which causes it 
to skip over the code that would make use of the relative path:

		(if (and org-babel-tangle-use-relative-file-links
			 (string-match org-link-types-re link)
			 (string= (match-string 0 link) "file"))

(on the online copy of the code, this is the region under consideration:


I have not yet tried the most recent development copy because I do not 
see considerable difference in the relevant lines compared to the 
version of ob-tangle.el I have, but I can try the development copy as a 
next step)

Here is the additional bug reporter output, on my Windows 10 64 bit 

Emacs  : GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
  of 2019-08-29
Package: Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ c:/Useful 

             reply	other threads:[~2020-06-06  8:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-06  6:06 Jeremias Gonzalez [this message]
2020-06-08 22:21 ` Jeremias Gonzalez
2020-06-09  0:32 ` Kyle Meyer
2020-06-09  0:37   ` Kyle Meyer
2020-06-09 23:07     ` Jeremias Gonzalez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6fb12326-52d3-7177-eff5-62603261b388@ucmerced.edu \
    --to=jgonzalez49@ucmerced.edu \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: org-babel-tangle not using relative links' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).