all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: help-gnu-emacs@gnu.org
Subject: Re: porting crufty old init.el to package management
Date: Mon, 24 Mar 2014 13:42:10 +0100	[thread overview]
Message-ID: <m2zjkfzs2l.fsf@polytechnique.org> (raw)
In-Reply-To: <87txaovw90.fsf@gmail.com> (Thorsten Jolitz's message of "Mon, 24 Mar 2014 09:25:31 +0100")

Thorsten Jolitz <tjolitz@gmail.com> writes:

> Tom Roche <Tom_Roche@pobox.com> 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



  reply	other threads:[~2014-03-24 12:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-23 23:37 porting crufty old init.el to package management Tom Roche
2014-03-24  3:01 ` Marcin Borkowski
2014-03-24  8:25 ` Thorsten Jolitz
2014-03-24 12:42   ` Alan Schmitt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-03-24 22:30 Barry OReilly
2014-03-25 18:10 ` Zhen Sun
     [not found] <mailman.17994.1395617870.10748.help-gnu-emacs@gnu.org>
2014-03-24 10:10 ` Fabrice Niessen
2014-03-24 12:41   ` Guido Van Hoecke
     [not found]   ` <mailman.18031.1395664909.10748.help-gnu-emacs@gnu.org>
2014-03-24 14:13     ` Fabrice Niessen
2014-03-24 20:01       ` Guido Van Hoecke
     [not found]       ` <mailman.18082.1395691327.10748.help-gnu-emacs@gnu.org>
2014-03-24 20:05         ` Fabrice Niessen
2014-03-24 20:39           ` Guido Van Hoecke
     [not found]           ` <mailman.18086.1395693586.10748.help-gnu-emacs@gnu.org>
2014-03-24 22:38             ` Fabrice Niessen
2014-03-25  2:01               ` Stefan
2014-03-25 10:27                 ` Guido Van Hoecke
2014-04-18  6:57   ` Brady Trainor
2014-03-26  3:42 ` Rusi
2014-03-26 11:22   ` Neal Becker
2014-03-26 17:55   ` jpkotta
2014-04-18  6:47   ` Brady Trainor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2zjkfzs2l.fsf@polytechnique.org \
    --to=alan.schmitt@polytechnique.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.