Benchmarking improvements

This commit is contained in:
Ivan Malison 2016-06-17 11:28:54 -07:00
parent 84e5234f44
commit 3773923678

View File

@ -19,11 +19,19 @@ It's annoying to have emacs randomly add stuff to your init.el whenever you cust
custom-before.el is loaded before the rest of init.el, while custom-after.el is loaded afterwards. this-machine.el has customizations that should only apply to the current machine. custom-before and custom-after are not version controlled in the dotfiles repo but they are shared across machines elsewhere. custom-before.el is loaded before the rest of init.el, while custom-after.el is loaded afterwards. this-machine.el has customizations that should only apply to the current machine. custom-before and custom-after are not version controlled in the dotfiles repo but they are shared across machines elsewhere.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defvar machine-custom "~/.emacs.d/this-machine.el") (defvar machine-custom "~/.emacs.d/this-machine.el")
(defvar custom-after-file "~/.emacs.d/custom-after.el")
(setq custom-file "~/.emacs.d/custom-before.el") (setq custom-file "~/.emacs.d/custom-before.el")
(when (file-exists-p custom-file) (load custom-file)) (when (file-exists-p custom-file) (load custom-file))
(defvar custom-after-file "~/.emacs.d/custom-after.el")
(when (file-exists-p machine-custom) (load machine-custom)) (when (file-exists-p machine-custom) (load machine-custom))
#+END_SRC #+END_SRC
** Benchmarking
This appears here so that it can accurately benchmark as much of startup as possible.
#+BEGIN_SRC emacs-lisp
(defvar imalison:do-benchmark)
(when imalison:do-benchmark
(use-package benchmark-init
:if (and (boundp 'imalison:do-benchmark) imalison:do-benchmark)))
#+END_SRC
** GUI Disables ** GUI Disables
Death to any gui elements in emacs! Do this EARLY so that emacs doesn't redisplay in a way that is visually unpleasant on startup a bunch of times. Death to any gui elements in emacs! Do this EARLY so that emacs doesn't redisplay in a way that is visually unpleasant on startup a bunch of times.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -137,12 +145,6 @@ Ensure by default since most of the package for which I use use-package need to
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq use-package-always-ensure t) (setq use-package-always-ensure t)
#+END_SRC #+END_SRC
** Benchmarking
This appears here so that it can accurately benchmark as much of startup as possible.
#+BEGIN_SRC emacs-lisp
(use-package benchmark-init
:if (and (boundp 'imalison:do-benchmark) imalison:do-benchmark))
#+END_SRC
** Sane Defaults ** Sane Defaults
#+BEGIN_SRC emacs-lisp -n -r #+BEGIN_SRC emacs-lisp -n -r
(global-auto-revert-mode) (global-auto-revert-mode)
@ -225,6 +227,7 @@ Disable CJK coding/encoding (Chinese/Japanese/Korean characters)
#+END_SRC #+END_SRC
** Misc ** Misc
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defvar iedit-toggle-key-default nil)
(put 'set-goal-column 'disabled nil) (put 'set-goal-column 'disabled nil)
(auto-fill-mode -1) (auto-fill-mode -1)
(setq indent-tabs-mode nil) (setq indent-tabs-mode nil)
@ -241,13 +244,11 @@ Disable CJK coding/encoding (Chinese/Japanese/Korean characters)
(setq inhibit-startup-message t (setq inhibit-startup-message t
inhibit-startup-echo-area-message t) inhibit-startup-echo-area-message t)
;; This makes it so that emacs --daemon puts its files in ~/.emacs.d/server ;; This makes it so that emacs --daemon puts its files in ~/.emacs.d/server
;; (setq server-use-tcp t) ;; (setq server-use-tcp t)
;; Display line and column numbers in mode line. ;; Display line and column numbers in mode line.
;; Make buffer names unique. ;; Make buffer names unique.
(setq uniquify-buffer-name-style 'forward) (setq uniquify-buffer-name-style 'forward)
@ -330,6 +331,7 @@ The packages in this section provide no functionality on their own, but provide
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package gh (use-package gh
:ensure nil :ensure nil
:defer t
:load-path "~/Projects/gh.el") :load-path "~/Projects/gh.el")
#+END_SRC #+END_SRC
*** shut-up *** shut-up
@ -845,6 +847,7 @@ Sets environment variables by starting a shell
*** paradox *** paradox
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package paradox (use-package paradox
:commands paradox-upgrade-packages paradox-list-packages
:config :config
(progn (progn
(setq paradox-execute-asynchronously t))) (setq paradox-execute-asynchronously t)))
@ -955,6 +958,7 @@ Sets environment variables by starting a shell
:mode ("\\.org\\'" . org-mode) :mode ("\\.org\\'" . org-mode)
:bind (("C-c a" . org-agenda) :bind (("C-c a" . org-agenda)
("C-c c" . org-capture) ("C-c c" . org-capture)
:map org-mode-map
("C-c n t" . org-insert-todo-heading) ("C-c n t" . org-insert-todo-heading)
("C-c n s" . org-insert-todo-subheading) ("C-c n s" . org-insert-todo-subheading)
("C-c n h" . org-insert-habit) ("C-c n h" . org-insert-habit)
@ -1066,8 +1070,10 @@ Sets environment variables by starting a shell
;; (define-key org-agenda-mode-map "x" #'org-agenda-done) ;; TODO why does this cause an error ;; (define-key org-agenda-mode-map "x" #'org-agenda-done) ;; TODO why does this cause an error
;; org-mode add-ons ;; org-mode add-ons
(use-package org-present) (use-package org-present
(use-package org-pomodoro) :commands org-present)
(use-package org-pomodoro
:disabled t)
;; variable configuration ;; variable configuration
(add-to-list 'org-modules 'org-habit) (add-to-list 'org-modules 'org-habit)
@ -1702,7 +1708,11 @@ I use helm for almost all emacs completion
#+END_SRC #+END_SRC
*** gist *** gist
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package gist) (use-package gist
:commands (gist-region gist-region-private gist-buffer gist-buffer-private
gist-region-or-buffer gist-region-or-buffer-private
gist-list-user gist-list gist-fetch gist-star
gist-unstar gist-list-starred gist-fork))
#+END_SRC #+END_SRC
*** git-gutter *** git-gutter
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -1724,7 +1734,7 @@ I use helm for almost all emacs completion
*** github-clone *** github-clone
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package github-clone (use-package github-clone
:demand t) :commands github-clone)
#+END_SRC #+END_SRC
*** github-search *** github-search
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -1733,6 +1743,7 @@ I use helm for almost all emacs completion
(use-package github-search (use-package github-search
:ensure nil :ensure nil
:load-path imalison:github-search-load-path :load-path imalison:github-search-load-path
:commands github-search-clone-repo
:preface :preface
(progn (progn
(defun imalison:get-projects-directory-target-from-repo (repo) (defun imalison:get-projects-directory-target-from-repo (repo)
@ -1867,9 +1878,9 @@ I use helm for almost all emacs completion
(defun go-mode-install-current-project () (defun go-mode-install-current-project ()
(interactive) (interactive)
(start-process "go install" "go install log" "go" "install" (start-process
(concat (file-name-as-directory (go-mode-workspace-path)) "go install" "go install log" "go" "install"
"..."))) (concat (file-name-as-directory (go-mode-workspace-path)) "...")))
(defun go-mode-get-go-path () (defun go-mode-get-go-path ()
(file-name-as-directory (car (s-split ":" (getenv "GOPATH"))))) (file-name-as-directory (car (s-split ":" (getenv "GOPATH")))))
@ -1879,10 +1890,6 @@ I use helm for almost all emacs completion
(defun imalison:go-mode-hook () (defun imalison:go-mode-hook ()
(go-eldoc-setup) (go-eldoc-setup)
(setq imenu-create-index-function
(lambda ()
(imalison:flatten-imenu-index
(go-mode-create-imenu-index))))
(set (make-local-variable 'company-backends) '(company-go)))) (set (make-local-variable 'company-backends) '(company-go))))
:config :config
(progn (progn
@ -2039,6 +2046,7 @@ I use helm for almost all emacs completion
(add-hook 'js2-mode-hook 'js2-imenu-extras-mode))) (add-hook 'js2-mode-hook 'js2-imenu-extras-mode)))
(use-package js2-refactor (use-package js2-refactor
:after js2-mode
:config :config
(progn (progn
(js2r-add-keybindings-with-prefix "C-c C-m") (js2r-add-keybindings-with-prefix "C-c C-m")
@ -2105,18 +2113,17 @@ I use helm for almost all emacs completion
**** realgud **** realgud
realgud provides debugging support with many external debuggers in emacs realgud provides debugging support with many external debuggers in emacs
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package realgud) (use-package realgud
:defer 10)
#+END_SRC #+END_SRC
**** emr **** emr
emr (emacs refactor) provides support for refactoring in many programming languages emr (emacs refactor) provides support for refactoring in many programming languages
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package emr (use-package emr
:commands emr-initialize
:bind (:map prog-mode-map :bind (:map prog-mode-map
("M-RET" . emr-show-refactor-menu)) ("M-RET" . emr-show-refactor-menu))
:init (emr-initialize)) :config (emr-initialize))
#+END_SRC #+END_SRC
** Utility ** Utility
*** term *** term
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -2130,6 +2137,7 @@ emr (emacs refactor) provides support for refactoring in many programming langua
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package term-manager (use-package term-manager
:ensure nil :ensure nil
:defer t
:load-path "~/Projects/term-manager" :load-path "~/Projects/term-manager"
:preface :preface
(progn (progn
@ -2145,6 +2153,12 @@ emr (emacs refactor) provides support for refactoring in many programming langua
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package term-projectile (use-package term-projectile
:load-path "~/Projects/term-manager" :load-path "~/Projects/term-manager"
:bind ("C-c 7" . imalison:term-hydra/body)
:commands (term-projectile-forward term-projectile-backward
term-projectile-default-directory-forward
term-projectile-default-directory-backward
term-projectile-create-new
term-projectile-create-new-default-directory)
:config :config
(progn (progn
(imalison:prefix-alternatives imalison:term term-projectile-forward (imalison:prefix-alternatives imalison:term term-projectile-forward
@ -2155,7 +2169,7 @@ emr (emacs refactor) provides support for refactoring in many programming langua
("p" term-projectile-default-directory-backward) ("p" term-projectile-default-directory-backward)
("c" term-projectile-create-new-default-directory)) ("c" term-projectile-create-new-default-directory))
(defhydra imalison:term-hydra (global-map "C-c 7") (defhydra imalison:term-hydra ()
"term" "term"
("n" term-projectile-forward) ("n" term-projectile-forward)
("p" term-projectile-backward) ("p" term-projectile-backward)
@ -2228,9 +2242,7 @@ crux-reopen-as-root-mode makes it so that any file owned by root will automatica
I don't use iedit directly, but it is used by [[*emr][emr]] and I need to disable ~iedit-toggle-key-default~ or else a buffer pops up complaing that the key has been bound to something else I don't use iedit directly, but it is used by [[*emr][emr]] and I need to disable ~iedit-toggle-key-default~ or else a buffer pops up complaing that the key has been bound to something else
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package iedit (use-package iedit
:demand :defer t)
:preface
(defvar-setq iedit-toggle-key-default nil))
#+END_SRC #+END_SRC
*** tramp *** tramp
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -2340,12 +2352,14 @@ I don't use iedit directly, but it is used by [[*emr][emr]] and I need to disabl
#+END_SRC #+END_SRC
*** nodejs-repl *** nodejs-repl
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package nodejs-repl) (use-package nodejs-repl
:commands nodejs-repl)
#+END_SRC #+END_SRC
*** calc-mode *** calc-mode
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package calc-mode (use-package calc-mode
:ensure nil :ensure nil
:commands calc
:config :config
(progn (progn
(setq calc-context-sensitive-enter t))) (setq calc-context-sensitive-enter t)))
@ -2389,6 +2403,7 @@ Not really sure what this is
*** deft *** deft
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package deft (use-package deft
:commands deft
:config :config
(progn (progn
(setq deft-default-extension "org") (setq deft-default-extension "org")
@ -2578,10 +2593,10 @@ This is useful with server mode when editing gmail messages. I think that it is
(funcall notify-function "GMail" message)) (funcall notify-function "GMail" message))
(defun sauron:dispatch-notify (origin priority message &optional properties) (defun sauron:dispatch-notify (origin priority message &optional properties)
(let ((handler (cond ((string= origin "erc") 'sauron:erc-notify) (let ((handler (cond ((string= origin "erc") 'sauron:erc-notify)
((string= origin "jabber") 'sauron:jabber-notify) ((string= origin "jabber") 'sauron:jabber-notify)
((string= origin "mu4e") 'sauron:mu4e-notify) ((string= origin "mu4e") 'sauron:mu4e-notify)
((string= origin "dbus") 'sauron:dbus-notify) ((string= origin "dbus") 'sauron:dbus-notify)
(t (lambda (&rest r) nil))))) (t (lambda (&rest r) nil)))))
(funcall handler origin priority message properties))) (funcall handler origin priority message properties)))
;; Prefering alert.el for now ;; (add-hook 'sauron-event-added-functions 'sauron:dispatch-notify) ;; Prefering alert.el for now ;; (add-hook 'sauron-event-added-functions 'sauron:dispatch-notify)
(sauron-start-hidden) (sauron-start-hidden)
@ -2598,7 +2613,8 @@ This is useful with server mode when editing gmail messages. I think that it is
#+END_SRC #+END_SRC
*** wsd-mode *** wsd-mode
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package wsd-mode) (use-package wsd-mode
:commands (wsd-mode))
#+END_SRC #+END_SRC
*** libmpdee *** libmpdee
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -2812,7 +2828,8 @@ This is useful with server mode when editing gmail messages. I think that it is
#+END_SRC #+END_SRC
*** rinari *** rinari
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package rinari) (use-package rinari
:after ruby-mode)
#+END_SRC #+END_SRC
*** helm-gtags *** helm-gtags
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -2884,6 +2901,7 @@ This is useful with server mode when editing gmail messages. I think that it is
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package latex (use-package latex
:ensure auctex :ensure auctex
:after tex
:config :config
(progn (progn
(unbind-key "C-j" LaTeX-mode-map))) (unbind-key "C-j" LaTeX-mode-map)))
@ -2986,7 +3004,6 @@ Ensure all themes that I use are installed:
(ensure-packages-installed packages-appearance) (ensure-packages-installed packages-appearance)
#+END_SRC #+END_SRC
** spaceline ** spaceline
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package spaceline-config (use-package spaceline-config
@ -3009,7 +3026,8 @@ Ensure all themes that I use are installed:
#+END_SRC #+END_SRC
** window-number ** window-number
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package window-number) (use-package window-number
:defer t)
#+END_SRC #+END_SRC
** Whitespace Setup ** Whitespace Setup