Config-wide code clean up

This commit is contained in:
Henrik Lissner
2015-11-27 03:40:10 -05:00
parent e85615e7fd
commit 436ca26a4e
7 changed files with 42 additions and 61 deletions

View File

@@ -8,6 +8,7 @@
;; narf:... An ex command
;; narf|... A hook
;; narf*... An advising function
;; narf.... Custom hooks
;; ...! Macro
;;
;;;
@@ -128,6 +129,17 @@
async-wait
async-inject-variables))
;; Custom Hooks ;;;;;;;;;;;;;;;;;;;;;;;;
(defvar narf.window-switch-hook '()
"Hooks run before switching windows. Hooks take two arguments (one is
optional): WINDOW and NORECORD. WINDOW is the window being switched to. Use
`current-buffer' to get the buffer being switched from. See `select-window' for
details on NORECORD.")
(defun narf*run-window-switch-hooks (window &optional norecord)
(run-hook-with-args 'narf.window-switch-hook window norecord))
(advice-add 'select-window :before 'narf*run-window-switch-hooks)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun narf-init ()
@@ -153,7 +165,7 @@
(unless (server-running-p)
(server-start))
(add-hook! after-init (setq gc-cons-threshold 800000)))
(add-hook! after-init (setq gc-cons-threshold 850000)))
(provide 'core)
;;; core.el ends here