Updating Doom Emacs.

This commit is contained in:
Derek Taylor
2020-06-19 22:43:40 -05:00
parent 0f664d532a
commit a5c86c514a
453 changed files with 13527 additions and 12455 deletions

View File

@@ -1,7 +1,7 @@
#+TITLE: ui/doom
#+DATE: October 9, 2019
#+SINCE: v1.3
#+STARTUP: inlineimages
#+STARTUP: inlineimages nofold
* Table of Contents :TOC_3:noexport:
- [[#description][Description]]

View File

@@ -1,36 +1,15 @@
;;; ui/doom/config.el -*- lexical-binding: t; -*-
(defvar +doom-solaire-themes
'((doom-challenger-deep . t)
(doom-city-lights . t)
(doom-dracula . t)
(doom-molokai)
(doom-nord . t)
(doom-nord-light . t)
(doom-nova)
(doom-one . t)
(doom-one-light . t)
(doom-opera . t)
(doom-snazzy . t)
(doom-solarized-dark . t)
(doom-solarized-light)
(doom-spacegrey . t)
(doom-tomorrow-day . t)
(doom-tomorrow-night . t)
(doom-vibrant))
"An alist of themes that support `solaire-mode'. If CDR is t, then
`solaire-mode-swap-bg' will be used automatically, when the theme is loaded.")
;;;###package pos-tip
(setq pos-tip-internal-border-width 6
pos-tip-border-width 1)
;;
;;; Packages
(use-package! doom-themes
:defer t
:init
(unless doom-theme
(setq doom-theme 'doom-one))
:config
;; improve integration w/ org-mode
(add-hook 'doom-load-theme-hook #'doom-themes-org-config)
;; more Atom-esque file icons for neotree/treemacs
@@ -45,52 +24,64 @@
(use-package! solaire-mode
:when (or (daemonp) (display-graphic-p))
:defer t
:init
(add-hook! 'doom-load-theme-hook :append
(defun +doom-solaire-mode-swap-bg-maybe-h ()
(pcase-let ((`(,_theme . ,swap) (assq doom-theme +doom-solaire-themes)))
(require 'solaire-mode)
(if swap (solaire-mode-swap-bg)))))
:hook (doom-load-theme . solaire-global-mode)
:config
;; fringe can become unstyled when deleting or focusing frames
(add-hook 'focus-in-hook #'solaire-mode-reset)
;; Prevent color glitches when reloading either DOOM or loading a new theme
(add-hook! '(doom-load-theme-hook doom-reload-hook) :append
#'solaire-mode-reset)
;; org-capture takes an org buffer and narrows it. The result is erroneously
;; considered an unreal buffer, so solaire-mode must be restored.
(add-hook 'org-capture-mode-hook #'turn-on-solaire-mode)
(when (daemonp)
(add-hook! '(doom-switch-frame-hook after-make-frame-functions)
(defun +doom-disable-solaire-mode-maybe-h (&optional frame)
(if (display-graphic-p frame)
(unless solaire-global-mode
(solaire-global-mode +1))
(when solaire-global-mode
(solaire-global-mode -1))))))
;; On Emacs 26+, when point is on the last line and solaire-mode is remapping
;; the hl-line face, hl-line's highlight bleeds into the rest of the window
;; after eob. On Emacs 27 this no longer happens.
(add-hook! 'solaire-global-mode-hook
(defun +doom-solaire-swap-bg-faces-maybe-h ()
(and solaire-global-mode
(string-prefix-p "doom-" (symbol-name doom-theme))
(solaire-mode-swap-bg))))
;; DEPRECATED No longer needed in Emacs 27+
(unless EMACS27+
;; HACK On Emacs <=26, when point is on the last (or second to last) line
;; and solaire-mode is remapping the hl-line face, hl-line's highlight
;; bleeds into the rest of the window after eob. On Emacs 27 this no
;; longer happens. This tries to fix it for 26 users, but it imposes
;; another problem: the 2nd-to-last line will only be highlighted up to
;; the (n-1)th character, but I think that is the lesser evil.
(defun +doom--line-range-fn ()
(cons (line-beginning-position)
(cond ((let ((eol (line-end-position)))
(and (= eol (point-max))
(/= eol (line-beginning-position))))
(1- (line-end-position)))
((or (eobp)
(= (line-end-position 2) (point-max)))
(line-end-position))
((line-beginning-position 2)))))
(setq hl-line-range-function #'+doom--line-range-fn))
(if solaire-mode
(let ((bol (line-beginning-position))
(eol (line-end-position))
(eob (point-max)))
(cond ((= bol eob)
nil)
((= (1+ eol) eob)
(cons bol (1- eob)))
((or (= eol eob) (eobp))
(cons bol eol))
((cons bol (line-beginning-position 2)))))
(cons (line-beginning-position)
(line-beginning-position 2))))
(setq hl-line-range-function #'+doom--line-range-fn)
;; Because fringes can't be given a buffer-local face, they can look odd, so
;; we remove them in the minibuffer and which-key popups (they serve no
;; purpose there anyway).
(add-hook! 'solaire-mode-hook
(defun +doom-disable-fringes-in-minibuffer-h (&rest _)
(set-window-fringes (minibuffer-window) 0 0 nil)))
;; HACK The fringe cannot have a buffer-local remapping on Emacs <= 26, so
;; we jump through hoops to reset it (globally) whenever it is likely
;; that the fringe will have lost its background color.
(add-hook! '(doom-load-theme-hook doom-reload-hook) :append
#'solaire-mode-reset)
(defadvice! +doom--no-fringes-in-which-key-buffer-a (&rest _)
:after 'which-key--show-buffer-side-window
(+doom-disable-fringes-in-minibuffer-h)
(set-window-fringes (get-buffer-window which-key--buffer) 0 0 nil))
;; fringe can become unstyled when deleting or focusing frames
(add-hook 'focus-in-hook #'solaire-mode-reset)
(add-hook! '(minibuffer-setup-hook window-configuration-change-hook)
#'+doom-disable-fringes-in-minibuffer-h)
(solaire-global-mode +1))
;; A global fringe color means the minibuffer (with its fringes) will always
;; stand out, so we remove them (in which-key popups too).
(add-hook! 'solaire-mode-hook
(defun +doom-disable-fringes-in-minibuffer-h (&rest _)
(set-window-fringes (minibuffer-window) 0 0 nil)))
(defadvice! +doom--no-fringes-in-which-key-buffer-a (&rest _)
:after 'which-key--show-buffer-side-window
(+doom-disable-fringes-in-minibuffer-h)
(set-window-fringes (get-buffer-window which-key--buffer) 0 0 nil))
(add-hook! '(minibuffer-setup-hook window-configuration-change-hook)
#'+doom-disable-fringes-in-minibuffer-h)))

View File

@@ -1,6 +1,5 @@
;; -*- no-byte-compile: t; -*-
;;; ui/doom/packages.el
(package! doom-themes)
(package! solaire-mode)
(package! doom-themes :pin "b1c43a324d3000bd9972030aecf98c9cc8376337")
(package! solaire-mode :pin "25d1aafc03e3c7f9487532464dbffacce10d0c5d")