From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Bastien <bzg@gnu.org>
Cc: Aaron Ecay <aaronecay@gmail.com>,
"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Writing .el files for org in org?
Date: Tue, 29 Jul 2014 22:04:12 -0400 [thread overview]
Message-ID: <CAJ51ETreRzBsWfdzwGU6o99fcNm6CMuW9-1Fza-huJWaxMtRUg@mail.gmail.com> (raw)
In-Reply-To: <87d2cp75wd.fsf@bzg.ath.cx>
[-- Attachment #1: Type: text/plain, Size: 2142 bytes --]
Ok, I am giving it a shot. Here is my setup:
;;;;;;; org path
(defvar org-load-path
(list (file-name-as-directory
(expand-file-name "org" starter-kit-dir)))
"List of directories to find org-files that
`org-babel-load-file' can load code from")
(defun org-require (feature)
"Load a FEATURE from an org-file.
FEATURE is a symbol, and it is loaded from an org-file by the name of
FEATURE.org, that is in the `org-load-path'. The FEATURE is loaded from
`org-babel-load-file'."
(let ((org-file (concat (symbol-name feature) ".org"))
(path))
;; find the org-file
(catch 'result
(loop for dir in org-load-path do
(when (file-exists-p
(setq path
(expand-file-name
org-file
dir)))
(throw 'result path))))
(let ((default-directory (file-name-directory path)))
(org-babel-load-file path))))
(org-require 'org-ref)
(org-require 'doi-utils)
(org-require 'org-show)
In the only directory I define in org-load-path, I put org-show.org,
org-ref.org, and doi-utils.org, and the code above is in an init file. When
I load emacs, for these files, so far, it works great. They are simple
files that only tangle to one .el file so far.
John
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu
On Sun, Jul 27, 2014 at 5:50 PM, Bastien <bzg@gnu.org> wrote:
> Hi John and Rainer,
>
> Rainer M Krug <Rainer@krugs.de> 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.
>
> Maybe you could use such a "load-flow" for a while, see if it is
> robust enough, and if so, we could move on and have it in the repo?
>
> My gut feeling is that it will bring some issues, so experimenting
> before would be nice.
>
> --
> Bastien
>
[-- Attachment #2: Type: text/html, Size: 3835 bytes --]
next prev parent reply other threads:[~2014-07-30 2:04 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
2014-07-27 21:50 ` Bastien
2014-07-30 2:04 ` John Kitchin [this message]
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=CAJ51ETreRzBsWfdzwGU6o99fcNm6CMuW9-1Fza-huJWaxMtRUg@mail.gmail.com \
--to=jkitchin@andrew.cmu.edu \
--cc=aaronecay@gmail.com \
--cc=bzg@gnu.org \
--cc=emacs-orgmode@gnu.org \
/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).