From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sami Airaksinen Subject: [PATCH] org.el: org-babel-load-file loads first tangle file Date: Thu, 29 Jan 2015 23:49:20 +0200 Message-ID: <54CAAAE0.208@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NGNKs4cwTFBUOlsTfW3Fk6QsXr6cLm1dN" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGwxy-0003cU-O9 for emacs-orgmode@gnu.org; Thu, 29 Jan 2015 16:49:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGwxu-0006Oa-FI for emacs-orgmode@gnu.org; Thu, 29 Jan 2015 16:49:34 -0500 Received: from mail-lb0-x236.google.com ([2a00:1450:4010:c04::236]:62895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGwxu-0006OI-7S for emacs-orgmode@gnu.org; Thu, 29 Jan 2015 16:49:30 -0500 Received: by mail-lb0-f182.google.com with SMTP id l4so32968602lbv.13 for ; Thu, 29 Jan 2015 13:49:28 -0800 (PST) Received: from [10.0.1.8] (a91-156-176-206.elisa-laajakaista.fi. [91.156.176.206]) by mx.google.com with ESMTPSA id eb8sm2346304lbb.28.2015.01.29.13.49.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jan 2015 13:49:27 -0800 (PST) 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 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NGNKs4cwTFBUOlsTfW3Fk6QsXr6cLm1dN Content-Type: multipart/mixed; boundary="------------060702060009030700090600" This is a multi-part message in MIME format. --------------060702060009030700090600 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, I use quite sophisticated (read complicated) initialization of my emacs. Now I finally updated my emacs and org-mode upto date and found out that org-babel-load-file doesn't work as previously. I don't know if you have already noticed but if your tangled source org-mode file has multiple target files for the tangle blocks, it loads the file which was found last. This most often isn't the file name that was given as input. There could be more generic solution to this, but I though that it might be best to keep this patching simple as possible. This is my first patch proposal so I hope I'm doing right and adding it as an attachment to this post --=20 Sami Airaksinen --------------060702060009030700090600 Content-Type: text/x-patch; name="0001-org.el-org-babel-load-file-loads-first-tangle-file.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-org.el-org-babel-load-file-loads-first-tangle-file.patc"; filename*1="h" =46rom fe2c30fb06935ce871485b4e3816313d59d96cbe Mon Sep 17 00:00:00 2001 From: Sami Airaksinen Date: Thu, 29 Jan 2015 23:10:02 +0200 Subject: [PATCH] org.el: org-babel-load-file loads first tangle file (org-babel-load-file): When org-mode FILE has multiple target files for tangle blocks, `exported-file' will be set to last found target file, which might not be the `file'. Therefore fix for this bug is to select the last element of that tangled file list, which is the tangle target file of the first found tangle block, most typically the `file'. Suggestion from a patch proposal by Sami Airaksinen TINYCHANGE --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index b0e4380..2bc7f30 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -236,7 +236,7 @@ file to byte-code before it is loaded." (unless (and (file-exists-p exported-file) (> (funcall age file) (funcall age exported-file))) (setq exported-file - (car (org-babel-tangle-file file exported-file "emacs-lisp")))) + (car (last (org-babel-tangle-file file exported-file "emacs-lisp"))= ))) (message "%s %s" (if compile (progn (byte-compile-file exported-file 'load) --=20 1.9.1 --------------060702060009030700090600-- --NGNKs4cwTFBUOlsTfW3Fk6QsXr6cLm1dN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUyqrnAAoJELdhJChF8OS56PwH/3YlEoinTJNqj0ki590lHWEy Hzv43Q30H9IlrRgBD4+kj2g4KdlgRFWzkHCLY9nln66kMizvld3tjb30mAbuDoiu j/nciOxKsCt+1I0Nw+qJNLIvIjpLyh5iRFQPGjAtDNwJgYgZpTeLGSG5Lyz+KaEU 88qwOR9FZVorOcmxqT0tXOCK/MnU0WaZVmuPMv/2VNJnZFSaO8FstM/D3n9mPLhM S3RXBIRBBoDEhH4E8Q7zAp90folIGuhdIYobUa6ex66JaGRi5mlAPxQdt58t4xp/ pvTm1+peeRFxqm+fbyXBSvF7xIM7RsHpnn6wn4L6whh6m8GFLx6E79etnwDHR9w= =osFk -----END PGP SIGNATURE----- --NGNKs4cwTFBUOlsTfW3Fk6QsXr6cLm1dN--