From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Beck Subject: Some Experiences with org-babel-load-file Date: Mon, 10 Dec 2012 23:33:39 +0100 Message-ID: <50C66343.2010202@miszellen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiCOR-0000wV-01 for emacs-orgmode@gnu.org; Mon, 10 Dec 2012 18:04:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiCOH-0001fD-I4 for emacs-orgmode@gnu.org; Mon, 10 Dec 2012 18:04:10 -0500 Received: from mo6-p04-ob.rzone.de ([2a01:238:20a:202:5304::1]:55789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiCOH-0001eN-9C for emacs-orgmode@gnu.org; Mon, 10 Dec 2012 18:04:01 -0500 Received: from [10.154.31.85] ([89.204.153.85]) by smtp.strato.de (jored mo18) (RZmta 31.7 SBL|AUTH) with ESMTPA id 5073b6oBAL87u1 for ; Mon, 10 Dec 2012 23:33:42 +0100 (CET) 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 Hello! As an experiment, I moved my .emacs and all my personal packages into an org-file and now load it with 'org-babel-load-file. This works fine enough: the source code blocks can handle several thousand lines of code (for later splitting) without any quirks, tough editing in the org-file sure gets slow. A couple of observations: 1. `org-babel-load-file' doesn't seem to be in the org docu. The instructions on worg are obsolete (mentions `org-install') and needlessly complicated. Just putting (package-initialize) ;; only if you use the newest org (require 'ob-tangle) (org-babel-load-file "/path/to/your/org-init-file.org") into your .emacs (no need for .emacs.d/init.el) seems to suffice. 2. Unless you are only setting variables, you want your functions to be byte-compiled. I modified `org-babel-load-file' to do that. Any reason not to? 3. While it saves some keystrokes not to have to write "tangle: yes", it seems to be at odds with `org-tangle-file (though it does respect "tangle: no"). 4. When I babel-load "my-package.org", all emacs sees is the tangled "my-package.el", which of course is right. The problem, however, is that I often search for one of my functions, change it … and loose the changes the next time I start emacs (I already got zapped a couple of times). Integrating org-tangle with the emacs documentation would be tough I guess. But how about setting a read-only file locale variable to block the most stupid mistakes? Overall, very nice. Thank you. -- Florian Beck