emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer M Krug <Rainer@krugs.de>
To: John Kitchin <jkitchin@andrew.cmu.edu>
Cc: Bastien <bzg@gnu.org>, Aaron Ecay <aaronecay@gmail.com>,
	"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Writing .el files for org in org?
Date: Mon, 02 Jun 2014 16:00:36 +0200	[thread overview]
Message-ID: <m2egz7e7i3.fsf@krugs.de> (raw)
In-Reply-To: <CAJ51ETo8BWv+fowm0zDR3-0tFOvUY+HZEdiAVQPX3DJCY2HDGQ@mail.gmail.com> (John Kitchin's message of "Mon, 2 Jun 2014 07:22:49 -0400")

[-- Attachment #1: Type: text/plain, Size: 3706 bytes --]

John Kitchin <jkitchin@andrew.cmu.edu> 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. 

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 <bzg@gnu.org> wrote:
>
>> Rainer M Krug <Rainer@krugs.de> 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
>>
>>

-- 
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

[-- Attachment #2: Type: application/pgp-signature, Size: 494 bytes --]

  reply	other threads:[~2014-06-02 14:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-21 20:21 Writing .el files for org in org? Rainer M Krug
2014-05-21 23:25 ` Aaron Ecay
2014-05-22  8:12   ` Rainer M Krug
2014-05-22  8:56   ` Bastien
2014-05-22  9:25     ` Rainer M Krug
2014-05-22  9:29       ` Bastien
2014-05-22  9:54         ` Rainer M Krug
2014-05-22 11:04           ` Bastien
2014-05-22 11:42             ` Rainer M Krug
2014-05-22 15:10               ` Bastien
2014-05-23  7:29                 ` Rainer M Krug
2014-06-02 11:22             ` John Kitchin
2014-06-02 14:00               ` Rainer M Krug [this message]
2014-07-27 21:50                 ` Bastien
2014-07-30  2:04                   ` John Kitchin
2014-05-22 15:44           ` Josh Berry
2014-05-22 18:49             ` Rainer M Krug
2014-05-22  0:30 ` Grant Rettke
2014-05-22  8:30   ` Rainer M Krug
2014-05-22 23:34     ` Grant Rettke
2014-05-27  8:45 ` Thorsten Jolitz
2014-05-27  9:07   ` Rainer M Krug

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=m2egz7e7i3.fsf@krugs.de \
    --to=rainer@krugs.de \
    --cc=aaronecay@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=jkitchin@andrew.cmu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).