From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Schmitt Newsgroups: gmane.emacs.help Subject: Re: porting crufty old init.el to package management Date: Mon, 24 Mar 2014 13:42:10 +0100 Message-ID: References: <8738i8pjux.fsf@pobox.com> <87txaovw90.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1395668956 10809 80.91.229.3 (24 Mar 2014 13:49:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Mar 2014 13:49:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 24 14:49:26 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WS5Fm-0007nl-41 for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Mar 2014 14:49:26 +0100 Original-Received: from localhost ([::1]:36445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS5Fl-0001N0-Jb for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Mar 2014 09:49:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS5F7-0008RH-3H for help-gnu-emacs@gnu.org; Mon, 24 Mar 2014 09:49:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WS4p2-0001NL-Bu for help-gnu-emacs@gnu.org; Mon, 24 Mar 2014 09:23:06 -0400 Original-Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:36364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS4p2-0001N8-4F for help-gnu-emacs@gnu.org; Mon, 24 Mar 2014 09:21:48 -0400 X-IronPort-AV: E=Sophos;i="4.97,720,1389740400"; d="scan'208";a="64446115" Original-Received: from top-wifi.irisa.fr (HELO top-wifi) ([131.254.66.192]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA; 24 Mar 2014 14:21:35 +0100 In-Reply-To: <87txaovw90.fsf@gmail.com> (Thorsten Jolitz's message of "Mon, 24 Mar 2014 09:25:31 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.134.164.83 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:96713 Archived-At: Thorsten Jolitz writes: > Tom Roche writes: > >> I'm wondering, would anyone care to recommend especially worthy docs >> for this process (guides, howto's, tutorials)? esp how best to >> accommodate snippets of elisp (gists?) > > If you think of your init file more as '(comment)text with code', > Org-Babel and the associated starter-kit > (http://eschulte.github.io/emacs-starter-kit/) are definitely worth a > try. This is the approach I'm following. To get you started, here is my configuration loading config file (init.el). It basically loads a current version of org, then tangles the "myconfig.org" file to create the configuration #+begin_src emacs-lisp ;; Turn off mouse interface early in startup to avoid momentary display (if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) ;; remember this directory (setq emacsd-dir (file-name-directory (or load-file-name (buffer-file-name)))) ;; org-setup (add-to-list 'load-path (concat emacsd-dir "org/emacs/site-lisp/org")) (require 'org) ;; Then tangle and load the file (org-babel-load-file (expand-file-name "myconfig.org" emacsd-dir)) #+end_src Here is a small snippet of the org file, to show you what it looks like: --8<---------------cut here---------------start------------->8--- * Setting up #+BEGIN_SRC emacs-lisp (add-to-list 'load-path emacsd-dir) (setq autoload-file (concat emacsd-dir "loaddefs.el")) (setq package-user-dir (concat emacsd-dir "elpa")) (setq custom-file (concat emacsd-dir "custom.el")) #+END_SRC ** System name #+BEGIN_SRC emacs-lisp (if (eq system-type 'darwin) (setq system-name (car (split-string system-name "\\.")))) #+END_SRC ** Internationalization Global environment #+BEGIN_SRC emacs-lisp (setenv "LANG" "en_US.UTF-8") #+END_SRC To make sure dates are in English #+BEGIN_SRC emacs-lisp (setq system-time-locale "C") #+END_SRC * Hush #+BEGIN_SRC emacs-lisp ;; Don't use messages that you don't read (setq initial-scratch-message "") (setq inhibit-startup-message t) #+END_SRC I'm also hiding the startup echo area message using this: (customize-option 'inhibit-startup-echo-area-message) --8<---------------cut here---------------end--------------->8--- Hope this helps, Alan