From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [BUG][babel] Tangling into directories does not add directories to org file Date: Fri, 10 Oct 2014 10:45:35 +0200 Message-ID: References: <87iojsk28y.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcVph-0005FF-1l for emacs-orgmode@gnu.org; Fri, 10 Oct 2014 04:46:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcVpZ-0004x3-Ic for emacs-orgmode@gnu.org; Fri, 10 Oct 2014 04:45:52 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:36161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcVpZ-0004wl-Ce for emacs-orgmode@gnu.org; Fri, 10 Oct 2014 04:45:45 -0400 Received: by mail-wi0-f180.google.com with SMTP id em10so1317523wid.7 for ; Fri, 10 Oct 2014 01:45:44 -0700 (PDT) Received: from Rainers-MacBook-Pro-3.local (arn78-1-88-186-171-7.fbx.proxad.net. [88.186.171.7]) by mx.google.com with ESMTPSA id gw6sm1869735wib.8.2014.10.10.01.45.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Oct 2014 01:45:43 -0700 (PDT) In-Reply-To: <87iojsk28y.fsf@gmail.com> (Aaron Ecay's message of "Thu, 09 Oct 2014 23:55:09 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Aaron Ecay writes: > Hi Rainer, > > 2014ko urriak 9an, Rainer M Krug-ek idatzi zuen: >>=20 >> I'd like to ping this as I think it >> is an important bug. It e.g. make debugging of R packages, whose source >> is in org, more difficult, (the .R files are tangled into ./R/) as ess >> does not find the source of the R code in R as it uses the links in the >> comments to find the org file. > > FWIW, I agree with you, but personally it=E2=80=99s hard to see myself ha= ving > time to address this in the near future. Maybe you could try making a > patch yourself. It sounds like the sort of thing that should be > self-contained and easy to fix (famous last words, I know...) It looks like this - but I am always shocked by the number of brackets in lisp. The "problem" is in the function =3Ddefun org-babel-spec-to-string (spec)=3D in the file =3Dlisp/ob-tangle.R=3D in the section #+begin_src emacs-lisp=20 (file (if org-babel-tangle-use-relative-file-links (file-relative-name (nth 1 spec)) (nth 1 spec))) (link (let ((link (nth 2 spec))) (if org-babel-tangle-use-relative-file-links (when (string-match "^\\(file:\\|docview:\\)\\(.*\\)" link) (let* ((type (match-string 1 link)) (path (match-string 2 link)) (origpath path) (case-fold-search nil)) (setq path (file-relative-name path)) (concat type path))) link))) #+end_src the function file-relative-name (file-relative-name FILENAME &optional DIRECTORY). If I am not mistaken, the optional argument DIRECTORY needs to be set to the directory of the tangled file. I assume it is not set at the moment.=20 But I have no idea how to get this path and how to pass it to the function. Rainer =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJUN5y0AAoJENvXNx4PUvmCDDMH/iHLJg+uBPu0nhgC0cau1H2Y y4SdrqV24AAIP+oH+q6QtDhLlz4VbJzM3nKSd8+AacG5BimDrUjCTW31MjIoDOuj PZKjAPFmMTF54MTUR5HlLCV01sUt8ucRNeIwrdL52tpg6eAN+VI/nmVvGdDgwcuI JFKErVYDhArp0s+jNG96/MhNvdbnz4CCzKWaxqZhuCn/KoWmrSqSC3H8DnSunuHD m5b1biA8Lra6kkW2Go+4HdGIBvM62tO6jSBp/Il/E0Grysj8u5v8A5pmiszB012X EteJKnUXbIeU6J5A6Aiki5NN24qNUOBq/XZ7pZDd2F5B/aX9KfyA+jVYy+1Sc8M= =MiOx -----END PGP SIGNATURE----- --=-=-=--