From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Writing .el files for org in org? Date: Mon, 02 Jun 2014 16:00:36 +0200 Message-ID: References: <87lhturac1.fsf@gmail.com> <87sio29op5.fsf@bzg.ath.cx> <87vbsy88lk.fsf@bzg.ath.cx> <8738g2krbk.fsf@bzg.ath.cx> 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]:42274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrSnF-00082x-PC for emacs-orgmode@gnu.org; Mon, 02 Jun 2014 10:00:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrSnA-0004zB-Pt for emacs-orgmode@gnu.org; Mon, 02 Jun 2014 10:00:53 -0400 In-Reply-To: (John Kitchin's message of "Mon, 2 Jun 2014 07:22:49 -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: John Kitchin Cc: Bastien , Aaron Ecay , "emacs-orgmode@gnu.org" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable John Kitchin writes: > What if we created a new directory in the repository called "org" which > contains these kinds of files? It would be analogous to the "lisp" > directory. I don't think we need to have both ob-R.org and ob-R.el in the > repository. I think that would be a very good idea for certain modules like your org-ref and ob-R I am working on. > > For example I wrote org-ref.org, and I load it like this in my init file > (the intention here is to only tangle the org file when it is newer than > the el file or if there is no el file. for some reason my memory says that > org-babel-load-file was not doing this but that may be a faulty memory). > > (if (or > (not (file-exists-p "org-ref.el")) > (< (float-time (nth 5 (file-attributes "org-ref.el"))) > (float-time (nth 5 (file-attributes "org-ref.org"))))) > (progn > (org-babel-tangle-file (expand-file-name "org-ref.org" > starter-kit-dir)) > (load-file (expand-file-name "org-ref.el" starter-kit-dir))) > (require 'org-ref)) Isn't the already existing org-babel-load-file doing exactly that? It is robust as it is used by many to load emacs.org, and it can also compile the file. > > I could see there being something like the lisp path for finding these > files, so that we could just do: > > (org-require 'org-ref) > > or the org-babel-load-file could be adapted to have a path to search for > files.=20 OK - this sounds like a good approach. Thinking about it, I don't know if it is a good idea to change the installed files or add new ones, as this might (will?) cause access right problems. I would rather suggest to tangle the org file into a temporary file and then load it from there. Therefore, write access is not required for the installation (which is safer). So this would mean a rewrite of the org-babel-load-file function, or just add a third optional argument for the path of the .el and/or .elc file. > This way there is no auto-tangling, committing, etc... just regular > version control on the source of the source. That would be great, and I would convert the existing ob-R.el immediately. Cheers, Rainer > > > > > John > > ----------------------------------- > John Kitchin > Associate Professor > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > http://kitchingroup.cheme.cmu.edu > > > > On Thu, May 22, 2014 at 7:04 AM, Bastien wrote: > >> Rainer M Krug writes: >> >> > So the reason why I think it would be advantageous to have these files >> > in org does not lie with the programmer familiar with emacs-lisp, but >> > with somebody familiar with the other side. >> >> Sorry I was too terse in my previous answer: I completely agree with >> the goal you describe, but I don't think adding an .org source along >> the .el output (say e.g. ob-R.org and ob-R.el) will simplify my life >> as a maintainer: each time an ob-*.org file is changed we need to >> tangle it again... and this leads to auto-tangling, auto-committing >> considerations that I don't even want to start thinking about. >> >> -- >> Bastien >> >> =2D-=20 Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,= UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJTjIOKAAoJENvXNx4PUvmC2w8IAImG7uAPvpGDS442aj2pyM7Y o9yC4pdj/tsy6KJo615NEp0UwivK6v8eYcFAiSlId6fthwlczyVNp0Pnb02GE7KY 2LoslIdosYuQ8nAKazxyy5NPqFBFcasyYyo7r+jDPx9Uj+a0S8+0bk7S43nsYXxq C1dJ2KslDILsC0cIrZhTUtJetpuU9giEL7X7zFeVCoMdPJoIGPl+VL6yFkAIm481 JY2n2b5Zl1ypp0OtmlfyfEpD80DwIQW3cWYjZRQTu63J8OSv7diD7kCPo36rCPnr GGtf0c5TwH50xeGYizxIn0/7+FGP266XkQR0dB7vS0TVAY87TVGpvKfrN6Vj+YA= =myPv -----END PGP SIGNATURE----- --=-=-=--