[Emacs] Defer the loading of a bunch of things

This commit is contained in:
Ivan Malison 2017-08-25 12:55:47 -07:00
parent 0f33923eea
commit 148dd9c4c1
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -652,7 +652,6 @@ This was taken from [[http://emacs.stackexchange.com/questions/7583/transiently-
(face-attribute 'default :height)) (face-attribute 'default :height))
(not (imalison:acceptable-default-font-size (not (imalison:acceptable-default-font-size
imalison:default-font-size-pt))) imalison:default-font-size-pt)))
(message "default font size was set using hack")
(setq imalison:default-font-size-pt (face-attribute 'default :height)))) (setq imalison:default-font-size-pt (face-attribute 'default :height))))
(advice-add 'set-face-attribute :after 'imalison:set-default-font-size) (advice-add 'set-face-attribute :after 'imalison:set-default-font-size)
@ -1682,7 +1681,7 @@ I use helm for almost all emacs completion
#+BEGIN_SRC emacs-lisp -n -r #+BEGIN_SRC emacs-lisp -n -r
(use-package helm-config (use-package helm-config
:ensure helm :ensure helm
:demand t :defer 1
:bind (("M-y" . helm-show-kill-ring) :bind (("M-y" . helm-show-kill-ring)
("M-x" . helm-M-x) ("M-x" . helm-M-x)
("C-x C-i" . helm-imenu) ("C-x C-i" . helm-imenu)
@ -1691,8 +1690,12 @@ I use helm for almost all emacs completion
:diminish helm-mode :diminish helm-mode
:config :config
(progn (progn
(require 'helm-org) (use-package helm-org
(setq helm-split-window-default-side 'same) (ref:helm split window) :ensure nil
:defer 1
:config
(progn
(setq helm-split-window-default-side 'same)
(cl-defun helm-org-headings-in-buffer () (cl-defun helm-org-headings-in-buffer ()
(interactive) (interactive)
@ -1701,7 +1704,7 @@ I use helm for almost all emacs completion
"File to look at headings from: " "File to look at headings from: "
(projectile-all-project-files)))) (projectile-all-project-files))))
:candidate-number-limit 99999 :candidate-number-limit 99999
:buffer "*helm org inbuffer*")) :buffer "*helm org inbuffer*"))))
(use-package helm-descbinds (use-package helm-descbinds
:demand t :demand t
@ -1821,19 +1824,15 @@ I use helm for almost all emacs completion
ido-create-new-buffer 'always) ido-create-new-buffer 'always)
(ido-everywhere 1) (ido-everywhere 1)
(setq ido-enable-flex-matching t) (setq ido-enable-flex-matching t)
(use-package flx)
(use-package flx-ido (use-package flx-ido
:commands flx-ido-mode :defer 1
:init (flx-ido-mode 1)
:config :config
(progn (progn
;; disable ido faces to see flx highlights. ;; disable ido faces to see flx highlights.
;; This makes flx-ido much faster. ;; This makes flx-ido much faster.
(setq gc-cons-threshold 20000000) (setq gc-cons-threshold 20000000)
(flx-ido-mode 1)
(setq ido-use-faces nil))) (setq ido-use-faces nil)))
(use-package ido-ubiquitous
:disabled t
:commands (ido-ubiquitous-mode))
(use-package ido-vertical-mode (use-package ido-vertical-mode
:config :config
(progn (progn
@ -2970,6 +2969,8 @@ Intero seems to be causing hangs, so it has been disabled
(add-to-list (add-to-list
'org-src-lang-modes '("plantuml" . plantuml)) 'org-src-lang-modes '("plantuml" . plantuml))
(add-hook 'org-mode-hook 'imalison:load-babel-languages)
(defun imalison:load-babel-languages ()
(org-babel-do-load-languages (org-babel-do-load-languages
'org-babel-load-languages 'org-babel-load-languages
'((sh . t) '((sh . t)
@ -2977,7 +2978,7 @@ Intero seems to be causing hangs, so it has been disabled
(ruby . t) (ruby . t)
(octave . t) (octave . t)
(sqlite . t) (sqlite . t)
(plantuml . t))) (plantuml . t))))
(setq org-log-into-drawer t (setq org-log-into-drawer t
org-log-reschedule t org-log-reschedule t
@ -3403,6 +3404,7 @@ alphanumeric characters only."
**** org-super-agenda **** org-super-agenda
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package org-super-agenda (use-package org-super-agenda
:defer t
:config :config
(setq org-super-agenda-groups (setq org-super-agenda-groups
'((:order-multi (-1 (:name "High priority" '((:order-multi (-1 (:name "High priority"
@ -3682,7 +3684,7 @@ I've disabled magithub because it causes magit to be super slow
** gitolite-clone ** gitolite-clone
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package gitolite-clone (use-package gitolite-clone
:demand t :defer 4
:preface :preface
(progn (progn
(defun gitolite-clone-force-refresh () (defun gitolite-clone-force-refresh ()
@ -3807,6 +3809,7 @@ in term-mode. This makes term-mode 1000% more useful
(especially having M-x and C-y available). (especially having M-x and C-y available).
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package term (use-package term
:after helm
:preface :preface
(progn (progn
(defun imalison:avy-term (arg) (defun imalison:avy-term (arg)
@ -3818,11 +3821,23 @@ in term-mode. This makes term-mode 1000% more useful
(interactive) (interactive)
(process-send-string (process-send-string
(get-buffer-process (current-buffer)) (get-buffer-process (current-buffer))
(if string string (current-kill 0)))) (if string string (current-kill 0)))))
:bind
(:map term-mode-map
("C-c C-k" . imalison:term-char-mode)
:map term-raw-escape-map
("M-x" . helm-M-x)
("C-j" . imalison:avy-term)
:map term-raw-map
("M-x" . helm-M-x)
("C-j" . imalison:avy-term)
("M-:" . eval-expression)
("C-y" . imalison:term-paste)
("M-y" . helm-show-kill-ring-for-term))
:config
(progn
(require 'helm) (require 'helm)
(require 'helm-ring) (require 'helm-ring)
(defvar helm-kill-ring-for-term-actions (defvar helm-kill-ring-for-term-actions
'(("Yank" . imalison:term-paste) '(("Yank" . imalison:term-paste)
("Delete" . (lambda (_candidate) ("Delete" . (lambda (_candidate)
@ -3855,20 +3870,7 @@ First call open the kill-ring browser, next calls move to next line."
(defun imalison:term-char-mode () (defun imalison:term-char-mode ()
(interactive) (interactive)
(term-char-mode) (term-char-mode)
(goto-char (point-max)))) (goto-char (point-max)))
:bind (:map term-mode-map
("C-c C-k" . imalison:term-char-mode)
:map term-raw-escape-map
("M-x" . helm-M-x)
("C-j" . imalison:avy-term)
:map term-raw-map
("M-x" . helm-M-x)
("C-j" . imalison:avy-term)
("M-:" . eval-expression)
("C-y" . imalison:term-paste)
("M-y" . helm-show-kill-ring-for-term))
:config
(progn
(define-key term-raw-map (kbd "C-h") help-map) (define-key term-raw-map (kbd "C-h") help-map)
(add-hook 'term-mode-hook 'imalison:disable-linum-mode) (add-hook 'term-mode-hook 'imalison:disable-linum-mode)
(add-hook 'term-mode-hook 'imalison:disable-yas-minor-mode) (add-hook 'term-mode-hook 'imalison:disable-yas-minor-mode)
@ -4825,7 +4827,6 @@ For some reason, loading certain themes can cause colors in
the original ~ansi-term-color-vector~ state. The code is exectued in a the original ~ansi-term-color-vector~ state. The code is exectued in a
load-theme hook (See the heading below). load-theme hook (See the heading below).
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'term)
(defvar imalison:ansi-term-color-vector ansi-term-color-vector) (defvar imalison:ansi-term-color-vector ansi-term-color-vector)
(defun imalison:ansi-term-color-vector-broken? () (defun imalison:ansi-term-color-vector-broken? ()