+;; Added by Package.el. This must come before configurations of
+;; installed packages. Don't delete this line. If you don't want it,
+;; just comment it out by adding a semicolon to the start of the line.
+;; You may delete these explanatory comments.
+;(package-initialize)
+
;; Ganneff's emacs config
;; Emacs can not read its config directly from org-mode files.
;; a config change takes longer, but as that only happens when I change
;; something in the .org files - I don't care.
+(let ((file-name-handler-alist nil))
+
;; Go go go
-(message "Emacs is powering up... Be patient, Master %s!" (getenv "USER"))
+(unless noninteractive
+(message "Emacs is powering up... Be patient, Master %s!" (getenv "USER")))
;; I like to see how long it takes to "boot" emacs (usually one or two
;; seconds), so save the start time
-(setq emacs-load-start-time (current-time))
-
-;; We will need a set of directories for stuff
-;; Lets define some variables for them
-
-;; I might have special configuration based on various states
-;; First we set an own variable, as system-type from emacs directly is
-;; useless. gnu/linux and gnu/kfreebsd have extra /, which is plenty annoying
-;; when you want to use them in a path entry.
-(defun jj-system-type ()
- "Return a string depending on the OS we use"
- (interactive)
- (cond
- ((eq system-type 'darwin) "macosx")
- ((eq system-type 'gnu/linux) "linux")
- ((eq system-type 'gnu/kfreebsd) "kfreebsd")
- ((eq system-type 'cygwin) "cygwin")
- ((eq system-type 'windows-nt) "windows")))
-
+(defvar emacs-load-start-time (current-time))
-(defvar jj-dir (file-name-directory (or load-file-name (buffer-file-name)))
- "The master directory for Ganneffs emacs configuration and storage.
-Usually ~/.emacs.d/")
-(defvar jj-config-dir
- (expand-file-name "config" jj-dir)
- "Ganneffs main emacs configuration can be found here.")
-(defvar jj-emacs-config
- (expand-file-name "emacs.org" jj-config-dir)
- "Ganneffs main emacs configuration file.")
-(defvar jj-elisp-dir
- (expand-file-name "elisp" jj-dir)
- "This directory stores subdirs for local packages in Ganneffs emacs config.")
-(defvar jj-elisp-local-dir
- (expand-file-name "local" jj-elisp-dir)
- "This directory stores extra elisp files for Ganneffs emacs config.")
-(defvar jj-custom-file
- (expand-file-name "customized.el" jj-config-dir)
- "Changes from the customization interface in Ganneffs emacs config.")
-(defvar jj-cache-dir
- (expand-file-name "cache" jj-dir)
- "This directory stores cache files and other volatile data.")
-(defvar jj-backup-directory
- (expand-file-name (concat "emacs-autosave-" user-login-name) jj-cache-dir)
- "This directory stores backup files.")
-(defvar jj-theme-dir
- (expand-file-name "themes" jj-dir)
- "This directory stores theme files for Ganneffs emacs config")
-(defvar jj-sys-config
- (expand-file-name (concat system-name ".org") jj-config-dir)
- "Ganneffs System/Host specific emacs configiraton file.")
-(defvar jj-os-config
- (expand-file-name (concat (jj-system-type) ".org") jj-config-dir)
- "Ganneffs Operating system specific emacs configuration file.")
-(defvar jj-user-config
- (expand-file-name (concat user-login-name ".org") jj-config-dir)
- "Ganneffs username specific emacs configuration file.")
-(defvar jj-ev-config (expand-file-name
- (concat "emacs"
- (number-to-string emacs-major-version) ".org")
- jj-config-dir)
- "Ganneffs emacs version specific configuration file.")
+; Much larger threshold for garbage collection prevents it to run too often.
+(setq gc-cons-threshold 480000000)
-;; Ensure that the cache directory hierarchy exists
-(if (not (file-exists-p jj-cache-dir))
- (make-directory jj-cache-dir))
-(if (not (file-exists-p jj-backup-directory))
- (make-directory jj-backup-directory))
+;; Set a high number of lines for the message buffer so stuff doesn't "scroll out"
+(setq message-log-max 16384)
;; Set path to (my, recent) Org-Mode version
-(add-to-list 'load-path (concat jj-elisp-dir "/org/"))
-;; Have use-package/bindkey in here wich are needed for startup
-(add-to-list 'load-path jj-elisp-local-dir)
-
-;; As we use org-mode/org-babel/org-tangle to extract the real emacs
-;; config out of the org-mode files, we have to load that first.
+(add-to-list 'load-path (concat (file-name-directory (or load-file-name (buffer-file-name))) "elisp/org/"))
+;; org-mode can load modules when it loads itself, lets tell it which ones we want.
+; org-checklist
(setq org-modules (quote
(org-bbdb org-bibtex org-crypt org-docview org-gnus
- org-id org-info org-jsinfo org-habit org-inlinetask
- org-irc org-protocol org-w3m org-mouse org-checklist
+ org-id org-info org-habit org-inlinetask
+ org-irc org-protocol org-w3m org-mouse
org-notmuch icalendar)))
-(require 'org-install)
-(require 'ob-tangle)
-
-;; Now read my config
-;; Note that those files *can* include further files.
-(defun jj-compile-and-load (&optional arg)
- "Use org-tangle to get the emacs-lisp parts from .org emacs
-config files into .el ones, byte-compile those and then load
-them."
- (let ((el-file (concat (file-name-sans-extension arg) ".el")))
- (cond
- ((file-newer-than-file-p arg el-file)
- (message "File %s newer than %s, recompiling, please wait" arg el-file)
- (org-babel-tangle-file arg el-file "emacs-lisp")
- (byte-compile-file el-file)
- ))
- (load-file el-file)
- ))
-;; The basic config is always loaded, no matter where we start emacs.
-(jj-compile-and-load jj-emacs-config)
-;(org-babel-load-file jj-emacs-config)
-
-;; All the others are optional. We try the order of os, system, user
-;; specific files and load them, should they be there
-(if (file-exists-p jj-os-config) (org-babel-load-file jj-os-config ))
-;(if (file-exists-p jj-sys-config) (org-babel-load-file jj-sys-config))
-(if (file-exists-p jj-sys-config) (jj-compile-and-load jj-sys-config))
-(if (file-exists-p jj-user-config) (org-babel-load-file jj-user-config))
-(if (file-exists-p jj-ev-config) (org-babel-load-file jj-emacs-version-config))
+;; And load org-mode
+(require 'org)
+;; Without this the whole config can't load
+(require 'ob-tangle)
+;; And finally, let org-babel do its work. All the rest of the emacs
+;; initialization comes from initjj.org
+(org-babel-load-file (expand-file-name "initjj.org" (file-name-directory (or load-file-name (buffer-file-name))))))
-;; Lets get a message about startup time out
-(when (require 'time-date nil t)
- (message "Emacs startup time: %d seconds."
- (time-to-seconds (time-since emacs-load-start-time)))
- )
+; And back done a bit with it, startup is over
+(setq gc-cons-threshold 100000000)