From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Day Subject: Re: emacs initialization files in org mode Date: Sat, 12 Jan 2013 15:16:47 +1100 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtsWh-0003ZR-Ba for emacs-orgmode@gnu.org; Fri, 11 Jan 2013 23:17:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtsWb-0008W5-Hv for emacs-orgmode@gnu.org; Fri, 11 Jan 2013 23:16:59 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:42996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtsWb-0008W0-BX for emacs-orgmode@gnu.org; Fri, 11 Jan 2013 23:16:53 -0500 Received: by mail-pa0-f51.google.com with SMTP id fb11so1350842pad.24 for ; Fri, 11 Jan 2013 20:16:52 -0800 (PST) In-Reply-To: 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: Alan Schmitt Cc: emacs-orgmode On 7 Jan 2013, at 04:41, Alan Schmitt = wrote: > The bare minimum one can do is: > - rename the current init.el into myinit.org > - add the lines "#+begin_src emacs-lisp" as the first line, and > "+end_src" as the last line > - adapt the init.el from emacs-starter-kit as follows > #+BEGIN_SRC emacs-lisp > (add-hook 'after-init-hook > `(lambda () > ;; remember this directory > (setq emacsd-dir > ,(file-name-directory (or load-file-name = (buffer-file-name)))) > ;; load up the starter kit > (require 'org) > (org-babel-load-file (expand-file-name "myinit.org" emacsd-dir)))) > #+END_SRC >=20 When emacs boots its expectations for an init.el are hardwired in. It = doesn't know about org-mode goodness yet. So my minimum init.el is: #+Begin_src emacs-lisp :tangle init.el :var = tangled-in=3D(buffer-file-name) (setq user-emacs-directory (file-name-directory (or load-file-name user-emacs-directory = "~/.emacs.d/"))) (defvar org-dir "site-lisp/org-mode/lisp" "location of the directory containing org-mode") (add-to-list 'load-path (expand-file-name org-dir = user-emacs-directory)) (defvar dotemacs-org-file "dotemacs.org" "Name of the org file containing the main startup code") (if (boundp 'tangled-in) (setq dotemacs-org-file tangled-in)) (org-babel-load-file (expand-file-name dotemacs-org-file = user-emacs-directory)) #+end_src And this has to be tangled before emacs loads or it will load the old = version of init.el. It's a good idea to tell emacs straight away where = your org directory is or you might end up with the nasty split org = version hassle where half of org is the old emacs version and half is = the shiny new repository. https://github.com/tonyday567/dotemacs.org for my messy orgish dot = files, which are mostly orgified https://github.com/jwiegley/dot-emacs, = or eric's orgified starter kit: https://github.com/eschulte/emacs24-starter-kit Tony