emacs.d

My emacs configuration, done in a literate programming fashion using org-mode

git clone git://git.shimmy1996.com/emacs.d.git

init.el (945B)

    1 ;;; init.el --- Kickstart Emacs -*- lexical-binding: t -*-
    2 ;;; Commentary:
    3 ;;; Bootstraps the configuration by loading specified org file.
    4 
    5 ;;; Code:
    6 (with-temp-buffer
    7   (insert-file-contents (expand-file-name "README.org" user-emacs-directory))
    8   (goto-char (point-min))
    9   (while (not (eobp))
   10     (forward-line 1)
   11     (cond
   12      ;; Skip DISABLED Subtrees
   13      ((looking-at "^\\(\\*+\\) \\(DISABLED\\).*$")
   14       (end-of-line)
   15       (message "%s" (match-string 0))
   16       (re-search-forward
   17        (format "^\\*\\{1,%d\\} " (length (match-string 1)))
   18        nil 1)
   19       (forward-line -1)
   20       (end-of-line))
   21      ;; Log ENABLED Subtrees
   22      ((looking-at "^\\*+ \\(ENABLED\\|\\).*$")
   23       (message "%s" (match-string 0)))
   24      ;; Evaluate Code Blocks
   25      ((looking-at "^#\\+BEGIN_SRC +emacs-lisp *$")
   26       (let ((l (match-end 0)))
   27         (search-forward "\n#+END_SRC")
   28         (eval-region l (match-beginning 0)))))))
   29 ;;; init.el ends here