From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Riley Subject: Re: org-babel and emacs init Date: Tue, 26 Jan 2010 20:42:24 +0100 Message-ID: References: <87fx5s7lvv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZrJb-0006vb-Qn for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 14:43:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZrJY-0006s6-04 for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 14:43:07 -0500 Received: from [199.232.76.173] (port=50259 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZrJX-0006rx-Ha for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 14:43:03 -0500 Received: from lo.gmane.org ([80.91.229.12]:34573) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NZrJW-0002kb-U0 for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 14:43:03 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1NZrJS-0006Iq-Am for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 20:42:58 +0100 Received: from 85.183.18.158 ([85.183.18.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Jan 2010 20:42:58 +0100 Received: from rileyrgdev by 85.183.18.158 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Jan 2010 20:42:58 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org "Eric Schulte" writes: > Hi Richard, > > Richard Riley writes: > >> What approach have you taken to loading multiple files using the >> org-babel method? >> >> The example on the babel page searches out all org files and then >> untangles the elisp snippets and rewrites files with a .el extensions >> loading them as it goes. >> >> But how to order this or how best to load /decode/execute at run time >> in say an autoload or eval after load? Simply call org-babel-load-file >> instead of require? >> > > Currently the only option is `org-babel-load-file'. Off the top of my > head I don't see why an analogous `org-babel-require' function would not > work, and it seems that it would satisfy this need for conditional > loading. > >> >> e.g say I wanted to keep my (typically large) .gnus.el file as an org >> file. How best to deal with that? Currently I have an eval after load >> with all the code in that used to be in my .gnus.el in my >> emacs-init.org. Other approaches? >> > > again, maybe using something like the eventually-to-be-implemented > org-babel-require would work here? > >> >> Would there be a way to get the load system to check for an org file >> first and call org-babel-load-file? >> > > I'm not sure exactly what you mean here. I was thinking of (require 'xyz) somehow being overloaded to first check for org files. Fuzzy thinking most likely ;) If I eval a block such as (require 'mylib) it would be nice if it could detect the org has changed and so re-create the el etc. see below .... > >> >> Should possibly writing the org file auto create the .el file? Or is >> that best left to load time? >> > > I think this will be more reliable if it is left as a load-time > operation, rather than as a save-hook or something. Also, since the > file is only re-tangled when the .org file is newer than the .el file it > should not be a noticeable startup performance hit. It's true about the overhead being small but if you edit the org file then the elisp file should, I think, always be up to date and not out of sync until the next emacs startup. Especially for those of us who might use the daemon and restarts are few and far between. Imagine I alter a tangled block in the my org file and save and later want to email some lisp to a friend - as happened to today I might forget the updated org and instead copy from the .el file - oops! > > Thanks -- Eric Thanks for your reply. I really like org-babel. The only things I would say about the current implementation, and being totally selfish as I only use it for elisp at the moment ;), is that C-c C-c should use the org-ctl-cl-ctl-c functionality to edit the code block as the default instead of the harder to key "C-'". Would it be hard to make the default org-file or src type configurable? On that note it would be wonderful if somehow nxhtml would work with this so we could actually edit in place in emacs-lisp mode. Is there anything in that direction? Great stuff, regard r. > >> >> Any opinions or discussions/pointers appreciated. >> >> regards, >> >> r. >> >> >> >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Please use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > -- Google Talk : rileyrgdev@googlemail.com http://www.google.com/talk ASCII ribbon campaign ( ) - against HTML email X & vCards / \