From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Some Experiences with org-babel-load-file Date: Tue, 11 Dec 2012 07:52:36 -0700 Message-ID: <87ip88mpxa.fsf@gmail.com> References: <50C66343.2010202@miszellen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiUGf-00011V-Gq for emacs-orgmode@gnu.org; Tue, 11 Dec 2012 13:09:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiUGZ-0007C9-Fo for emacs-orgmode@gnu.org; Tue, 11 Dec 2012 13:09:21 -0500 Received: from mail-pb0-f41.google.com ([209.85.160.41]:57279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiU6B-0004YR-1l for emacs-orgmode@gnu.org; Tue, 11 Dec 2012 12:58:31 -0500 Received: by mail-pb0-f41.google.com with SMTP id xa7so2846132pbc.0 for ; Tue, 11 Dec 2012 09:58:30 -0800 (PST) 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: Florian Beck Cc: emacs-orgmode@gnu.org Florian Beck writes: > 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. > Please go ahead and update the information on worg. Note that Emacs24 users need only do (require 'org) (org-babel-load-file "/path/to/your/org-init-file.org") while users of lesser Emacs will have to load a new version of Org-mode before calling org-babel-load-file. > > 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? > I disagree, I don't find a noticeable performance difference between compiled and un-compiled code. If this does pose a problem for you, perhaps an optional extra argument to be added to org-babel-load-file to enable compilation. > > 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"). > The `org-babel-load-file' function calls `org-tangle-file' so they are definitely working in concert. When a target file is passed to `org-tangle-file' then that is used as the value of the ":tangle" header argument, so the default behavior is to tangle. > > 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 =E2=80=A6 and loos= e 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? > Great idea. I don't have time to work on this right now, but it is definitely on my stack. I suppose this should be the default behavior for all tangled files (not just those written by org-babel-load-file). Thanks, > > Overall, very nice. Thank you. --=20 Eric Schulte http://cs.unm.edu/~eschulte