PRAISE BE TO THE BYTE COMPILER FOR THY SHARP QUOTES

This commit is contained in:
Henrik Lissner 2017-04-17 02:17:10 -04:00
parent ef88d30b73
commit 5ae94b765c
79 changed files with 798 additions and 795 deletions

View file

@ -31,23 +31,23 @@
(def-package! all-the-icons :when (display-graphic-p))
(unless (display-graphic-p)
(defalias 'all-the-icons-octicon 'ignore)
(defalias 'all-the-icons-faicon 'ignore)
(defalias 'all-the-icons-fileicon 'ignore)
(defalias 'all-the-icons-wicon 'ignore)
(defalias 'all-the-icons-alltheicon 'ignore))
(defalias 'all-the-icons-octicon #'ignore)
(defalias 'all-the-icons-faicon #'ignore)
(defalias 'all-the-icons-fileicon #'ignore)
(defalias 'all-the-icons-wicon #'ignore)
(defalias 'all-the-icons-alltheicon #'ignore))
;;
(setq doom-fallback-buffer +doom-dashboard-name)
(add-hook 'after-make-frame-functions '+doom-dashboard-deferred-reload)
(add-hook 'after-make-frame-functions #'+doom-dashboard-deferred-reload)
(add-hook! 'window-setup-hook
(add-hook! 'kill-buffer-query-functions
(or (not (+doom-dashboard-p))
(ignore (ignore-errors (+doom-dashboard-force-reload))
(bury-buffer))))
(add-hook 'window-configuration-change-hook '+doom-dashboard-reload)
(add-hook 'window-configuration-change-hook #'+doom-dashboard-reload)
(+doom-dashboard-reload)
(when (equal (buffer-name) "*scratch*")
(switch-to-buffer (doom-fallback-buffer))))
@ -82,12 +82,12 @@
(setq +doom-dashboard-edited-p t
mode-line-format +doom-dashboard-old-modeline
fringe-indicator-alist +doom-dashboard--old-fringe-indicator)
(remove-hook 'evil-insert-state-entry-hook 'doom|mode-erase-on-insert t)))
(remove-hook 'evil-insert-state-entry-hook #'doom|mode-erase-on-insert t)))
(defun +doom-dashboard-deferred-reload (&rest _)
"Reload the dashboard after a brief pause. This is necessary for new frames,
whose dimensions may not be fully initialized by the time this is run."
(run-with-timer 0.1 nil '+doom-dashboard-reload))
(run-with-timer 0.1 nil #'+doom-dashboard-reload))
(defun +doom-dashboard-reload (&optional dir)
"Update the DOOM scratch buffer (or create it, if it doesn't exist)."
@ -104,8 +104,8 @@ whose dimensions may not be fully initialized by the time this is run."
(let ((old-pwd (or dir default-directory)))
(with-current-buffer (doom-fallback-buffer)
(+doom-dashboard-mode)
(add-hook 'evil-insert-state-entry-hook '+doom-dashboard|clear-on-insert nil t)
(add-hook 'after-change-major-mode-hook '+doom-dashboard|clear-on-insert nil t)
(add-hook 'evil-insert-state-entry-hook #'+doom-dashboard|clear-on-insert nil t)
(add-hook 'after-change-major-mode-hook #'+doom-dashboard|clear-on-insert nil t)
(setq +doom-dashboard-edited-p nil
fringe-indicator-alist (mapcar (lambda (i) (cons (car i) nil))
fringe-indicator-alist))

View file

@ -4,11 +4,11 @@
;; all-the-icons doesn't work in the terminal, so we "disable" it.
(unless (display-graphic-p)
(defalias 'all-the-icons-octicon 'ignore)
(defalias 'all-the-icons-faicon 'ignore)
(defalias 'all-the-icons-fileicon 'ignore)
(defalias 'all-the-icons-wicon 'ignore)
(defalias 'all-the-icons-alltheicon 'ignore))
(defalias 'all-the-icons-octicon #'ignore)
(defalias 'all-the-icons-faicon #'ignore)
(defalias 'all-the-icons-fileicon #'ignore)
(defalias 'all-the-icons-wicon #'ignore)
(defalias 'all-the-icons-alltheicon #'ignore))
(def-package! all-the-icons :demand t
:when (display-graphic-p))
@ -26,7 +26,7 @@
(force-mode-line-update)
(sit-for eldoc-show-in-mode-line-delay))))
(setq eldoc-in-minibuffer-show-fn '+doom-modeline--show-eldoc)
(setq eldoc-in-minibuffer-show-fn #'+doom-modeline--show-eldoc)
(eldoc-in-minibuffer-mode +1))
;; anzu and evil-anzu make it possible to display current/total in the
@ -44,20 +44,18 @@
(defun +doom-modeline|reset-anzu ()
(setq anzu--state nil))
;; Ensure anzu state is cleared when searches & iedit are done
(add-hook! '(kill-buffer-hook find-file-hook) '+doom-modeline|reset-anzu)
(add-hook! '(kill-buffer-hook find-file-hook) #'+doom-modeline|reset-anzu)
(after! evil
(advice-add 'evil-force-normal-state :after '+doom-modeline|reset-anzu)
(advice-add 'evil-ex-search-abort :after '+doom-modeline|reset-anzu)
(advice-add #'evil-force-normal-state :after #'+doom-modeline|reset-anzu)
(advice-add #'evil-ex-search-abort :after #'+doom-modeline|reset-anzu)
(after! evil-multiedit
(add-hook 'iedit-mode-end-hook '+doom-modeline|reset-anzu))))
(add-hook 'iedit-mode-end-hook #'+doom-modeline|reset-anzu))))
;;; Flash the mode-line on error
;; TODO More flexible colors (only suits dark themes)
;; FIXME fast key-repeat can make the mode-line bg get stuck (rare)
(defvar doom--visual-bell-old-bg nil)
(setq ring-bell-function 'doom-visual-bell
visible-bell nil)
(defun doom-visual-bell ()
"Blink the mode-line red briefly."
(unless doom--visual-bell-old-bg
@ -66,6 +64,8 @@
(run-with-timer
0.1 nil
(lambda () (set-face-attribute 'mode-line nil :background doom--visual-bell-old-bg))))
(setq ring-bell-function #'doom-visual-bell
visible-bell nil)
;; Keep `+doom-modeline-current-window' up-to-date
@ -76,10 +76,10 @@
(unless (minibuffer-window-active-p win)
(setq +doom-modeline-current-window win))))
(add-hook 'window-configuration-change-hook '+doom-modeline|set-selected-window)
(add-hook 'focus-in-hook '+doom-modeline|set-selected-window)
(advice-add 'handle-switch-frame :after '+doom-modeline|set-selected-window)
(advice-add 'select-window :after '+doom-modeline|set-selected-window)
(add-hook 'window-configuration-change-hook #'+doom-modeline|set-selected-window)
(add-hook 'focus-in-hook #'+doom-modeline|set-selected-window)
(advice-add #'handle-switch-frame :after #'+doom-modeline|set-selected-window)
(advice-add #'select-window :after #'+doom-modeline|set-selected-window)
@ -180,8 +180,8 @@ active."
;; Show version string for multi-version managers like rvm, rbenv, pyenv, etc.
(defvar-local +doom-modeline-env-version nil)
(defvar-local +doom-modeline-env-command nil)
(add-hook 'focus-in-hook '+doom-modeline|update-env)
(add-hook 'find-file-hook '+doom-modeline|update-env)
(add-hook 'focus-in-hook #'+doom-modeline|update-env)
(add-hook 'find-file-hook #'+doom-modeline|update-env)
(defun +doom-modeline|update-env ()
(when +doom-modeline-env-command
(let* ((default-directory (doom-project-root))
@ -220,7 +220,7 @@ active."
color)
(let ((len (length data))
(idx 0))
(apply 'concat
(apply #'concat
(mapcar #'(lambda (dl)
(setq idx (+ idx 1))
(concat
@ -578,4 +578,4 @@ with `evil-ex-substitute', and/or 4. The number of active `iedit' regions."
(defun +doom-modeline|set-special-modeline ()
(setq mode-line-format (doom-modeline 'special)))
(add-hook 'org-src-mode-hook '+doom-modeline|set-special-modeline)
(add-hook 'org-src-mode-hook #'+doom-modeline|set-special-modeline)

View file

@ -31,5 +31,5 @@ http://doom.wikia.com/wiki/Quit_messages and elsewhere.")
(y-or-n-p (format "%s Quit?" (nth (random (length +doom-quit-messages)) +doom-quit-messages)))
t))
(setq confirm-kill-emacs '+doom-quit)
(setq confirm-kill-emacs #'+doom-quit)

View file

@ -60,14 +60,14 @@
(when (and (not doom-buffer-mode)
(doom-real-buffer-p))
(doom-buffer-mode +1)))
(add-hook 'after-change-major-mode-hook '+doom|buffer-mode-on)
(add-hook 'after-change-major-mode-hook #'+doom|buffer-mode-on)
(defun +doom|buffer-mode-off ()
"Disable `doom-buffer-mode' in popup buffers."
(when (and doom-buffer-mode
(not (get-buffer-window-list)))
(doom-buffer-mode -1)))
(add-hook 'doom-popup-mode-hook '+doom|buffer-mode-off)
(add-hook 'doom-popup-mode-hook #'+doom|buffer-mode-off)
(when (featurep! :feature workspaces)
(defun +doom|restore-bright-buffers (&rest _)
@ -75,7 +75,7 @@
(dolist (buf (persp-buffer-list))
(with-current-buffer buf
(+doom|buffer-mode-on))))
(add-hook '+workspaces-load-session-hook '+doom|restore-bright-buffers))
(add-hook '+workspaces-load-session-hook #'+doom|restore-bright-buffers))
;; Add file icons to doom-neotree
(require 'doom-neotree)
@ -103,9 +103,9 @@
'doom/blink-cursor)
(after! evil
(advice-add 'evil-window-bottom :after 'doom/blink-cursor)
(advice-add 'evil-window-middle :after 'doom/blink-cursor)
(advice-add 'evil-window-top :after 'doom/blink-cursor)))
(advice-add #'evil-window-bottom :after #'doom/blink-cursor)
(advice-add #'evil-window-middle :after #'doom/blink-cursor)
(advice-add #'evil-window-top :after #'doom/blink-cursor)))
(after! hideshow

View file

@ -3,7 +3,7 @@
(def-package! hl-todo
:commands hl-todo-mode
:init
(add-hook 'prog-mode-hook 'hl-todo-mode)
(add-hook 'prog-mode-hook #'hl-todo-mode)
:config
(setq hl-todo-keyword-faces
`(("TODO" . ,(face-foreground 'warning))