Don't call package-initialize manually

It really isn't necessary if you just defer everything depending on it
until after emacs has started up.
This commit is contained in:
Tom Willemse 2013-06-01 01:13:14 +02:00
parent 0c91588eab
commit e039765be1

View file

@ -77,6 +77,7 @@
#+BEGIN_SRC emacs-lisp
(defmacro oni:eval-after-init (&rest body)
"Defer execution of BODY until after Emacs init."
(declare (indent 0))
`(add-hook 'emacs-startup-hook #'(lambda () ,@body)))
#+END_SRC
@ -1515,6 +1516,32 @@
(global-set-key (kbd "<f5>") 'ext:reload-buffer)
#+END_SRC
* Start auto-complete mode :autocomplete:
Initialize ~auto-complete~ after Emacs has finished starting up.
#+BEGIN_SRC emacs-lisp
(oni:eval-after-init
(require 'auto-complete-config)
(ac-config-default))
#+END_SRC
* Initialize smex :smex:
Initialize smex after Emacs has finished starting up.
#+BEGIN_SRC emacs-lisp
(add-hook 'emacs-startup-hook 'smex-initialize)
#+END_SRC
* Enable diff-hl
Enable =diff-hl= after Emacs has finished starting up.
#+BEGIN_SRC emacs-lisp
(add-hook 'emacs-startup-hook 'global-diff-hl-mode)
#+END_SRC
* All the rest
This still needs to be sorted out and documented, haven't had time
@ -1564,7 +1591,6 @@
(add-hook 'c-mode-hook 'oni:c-mode-func)
(add-hook 'css-mode-hook 'oni:css-mode-func)
(add-hook 'diary-display-hook 'oni:diary-display-func)
(add-hook 'emacs-startup-hook 'oni:emacs-startup-func)
(add-hook 'go-mode-hook 'oni:go-mode-func)
(add-hook 'gtags-mode-hook 'oni:gtags-mode-func)
(add-hook 'haskell-mode-hook 'oni:haskell-mode-func)
@ -1645,22 +1671,18 @@
(line-number-mode -1)
(tooltip-mode -1)
(package-initialize)
(auto-insert-mode)
(electric-indent-mode)
(savehist-mode)
(show-paren-mode)
(winner-mode)
(smex-initialize)
(help-at-pt-set-timer)
(windmove-default-keybindings)
(global-diff-hl-mode)
;;; Diminish lighter for a bunch of minor modes that should be on in
;;; certain modes and usually just clogg up the mode line.
(diminish 'auto-fill-function)
(oni:eval-after-init (diminish 'auto-fill-function))
(eval-after-load "auto-complete" '(diminish 'auto-complete-mode))
(eval-after-load "eldoc" '(diminish 'eldoc-mode))
@ -1838,11 +1860,6 @@
(interactive "p")
(oni:change-prev-case num 'down))
(defun oni:emacs-startup-func ()
"Function for `emacs-init-hook'."
(require 'auto-complete-config)
(ac-config-default))
(defun oni:go-mode-func ()
"Function for `go-mode-hook'."
(setq indent-tabs-mode nil)