Minor refactors & comment revision

This commit is contained in:
Henrik Lissner 2019-05-13 14:37:00 -04:00
parent 646cba3f68
commit 7443669b1e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
5 changed files with 16 additions and 14 deletions

View file

@ -106,7 +106,7 @@ order of `doom-env-switches' determines priority."
"# that `doom env refresh` is executed. Alternatively, create your own env file\n" "# that `doom env refresh` is executed. Alternatively, create your own env file\n"
"# in your DOOMDIR and load that with `(load-env-vars FILE)`.\n" "# in your DOOMDIR and load that with `(load-env-vars FILE)`.\n"
"#\n" "#\n"
"# To auto-regenerate this file when `doom reload` is run, use `doom env enable'\n" "# To auto-regenerate this file when `doom reload` is run, use `doom env auto'\n"
"# or set DOOMENV=1 in your shell environment/config.\n" "# or set DOOMENV=1 in your shell environment/config.\n"
"# ---------------------------------------------------------------------------\n\n")) "# ---------------------------------------------------------------------------\n\n"))
(let ((env-point (point))) (let ((env-point (point)))

View file

@ -50,15 +50,16 @@ This is used by `associate!', `file-exists-p!' and `project-file-exists-p!'."
(defun doom--resolve-hook-forms (hooks) (defun doom--resolve-hook-forms (hooks)
"Converts a list of modes into a list of hook symbols. "Converts a list of modes into a list of hook symbols.
If a mode is quoted, it is left as is." If a mode is quoted, it is left as is. If the entire HOOKS list is quoted, the
list is returned as-is."
(declare (pure t) (side-effect-free t)) (declare (pure t) (side-effect-free t))
(cl-loop with quoted-p = (eq (car-safe hooks) 'quote) (let ((hook-list (doom-enlist (doom-unquote hooks))))
for hook in (doom-enlist (doom-unquote hooks)) (if (eq (car-safe hooks) 'quote)
if (eq (car-safe hook) 'quote) hook-list
collect (cadr hook) (cl-loop for hook in hook-list
else if quoted-p if (eq (car-safe hook) 'quote)
collect hook collect (cadr hook)
else collect (intern (format "%s-hook" (symbol-name hook))))) else collect (intern (format "%s-hook" (symbol-name hook)))))))
(defun doom--assert-stage-p (stage macro) (defun doom--assert-stage-p (stage macro)
(unless (bound-and-true-p byte-compile-current-file) (unless (bound-and-true-p byte-compile-current-file)

View file

@ -98,9 +98,9 @@ c) are not valid projectile projects."
(advice-add #'projectile-locate-dominating-file :around #'doom*projectile-locate-dominating-file) (advice-add #'projectile-locate-dominating-file :around #'doom*projectile-locate-dominating-file)
(cond (cond
;; If fd exists, use it for git and generic projects fd is a rust program ;; If fd exists, use it for git and generic projects. fd is a rust program
;; that is significantly faster. It also respects .gitignore. This is ;; that is significantly faster and respects .gitignore. This is recommended
;; recommended in the projectile docs ;; in the projectile docs
((executable-find doom-projectile-fd-binary) ((executable-find doom-projectile-fd-binary)
(setq projectile-git-command (concat (setq projectile-git-command (concat
doom-projectile-fd-binary doom-projectile-fd-binary

View file

@ -504,7 +504,8 @@ Fonts are specified by `doom-font', `doom-variable-pitch-font',
(add-hook 'doom-init-ui-hook #'doom|init-theme)) (add-hook 'doom-init-ui-hook #'doom|init-theme))
;; Apply `doom-font' et co ;; Apply `doom-font' et co
(add-hook 'doom-after-init-modules-hook #'doom|init-fonts) (add-hook 'doom-after-init-modules-hook #'doom|init-fonts)
;; Setup `doom-load-theme-hook' ;; Setup `doom-load-theme-hook' and ensure `doom-theme' is always set to the
;; currently loaded theme
(advice-add #'load-theme :after #'doom*run-load-theme-hooks) (advice-add #'load-theme :after #'doom*run-load-theme-hooks)
(add-hook 'window-setup-hook #'doom|init-ui) (add-hook 'window-setup-hook #'doom|init-ui)

View file

@ -14,6 +14,6 @@
(defun +indent-guides|disable-maybe () (defun +indent-guides|disable-maybe ()
(when highlight-indent-guides-mode (when highlight-indent-guides-mode
(highlight-indent-guides-mode -1))) (highlight-indent-guides-mode -1)))
;; `highlight-indent-guides' breaks in `visual-line-mode' ;; `highlight-indent-guides' breaks in these modes
(add-hook 'visual-line-mode-hook #'+indent-guides|disable-maybe) (add-hook 'visual-line-mode-hook #'+indent-guides|disable-maybe)
(add-hook 'org-indent-mode-hook #'+indent-guides|disable-maybe)) (add-hook 'org-indent-mode-hook #'+indent-guides|disable-maybe))