diff --git a/core/autoload/ui.el b/core/autoload/ui.el index eecbde67e..a3056e886 100644 --- a/core/autoload/ui.el +++ b/core/autoload/ui.el @@ -1,6 +1,5 @@ ;;; core/autoload/ui.el -*- lexical-binding: t; -*- -(defvar doom--line-number-style doom-line-numbers-style) ;;;###autoload (defun doom/toggle-line-numbers () "Toggle line numbers. @@ -10,6 +9,7 @@ Cycles through regular, relative and no line numbers. The order depends on what Uses `display-line-numbers' in Emacs 26+ and `nlinum-mode' everywhere else." (interactive) + (defvar doom--line-number-style doom-line-numbers-style) (let* ((styles '(t relative nil)) (order (cons doom-line-numbers-style (delq doom-line-numbers-style styles))) (queue (memq doom--line-number-style order)) diff --git a/core/core-lib.el b/core/core-lib.el index 460c828f5..89008a283 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -225,7 +225,7 @@ Body forms can access the hook's arguments through the let-bound variable (,mode 1))) ,@(if (and modes (listp modes)) (cl-loop for hook in (doom--resolve-hook-forms modes) - collect `(add-hook ',hook ',hook-name)) + collect `(add-hook ',hook #',hook-name)) `((add-hook 'after-change-major-mode-hook ',hook-name)))))) (match `(map-put doom-auto-minor-mode-alist ,match ',mode)) diff --git a/core/core-packages.el b/core/core-packages.el index b05c2376e..f06e50e2b 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -419,11 +419,17 @@ added, if the file exists." ;; -;; Module config macros +;; Use-package modifications ;; (autoload 'use-package "use-package" nil nil 'macro) + + +;; +;; Module config macros +;; + (defmacro doom! (&rest modules) "Bootstraps DOOM Emacs and its modules. diff --git a/core/core.el b/core/core.el index 1c80302ca..20cb1c018 100644 --- a/core/core.el +++ b/core/core.el @@ -67,8 +67,7 @@ XDG directory conventions if ~/.config/doom exists.") (setq-default ad-redefinition-action 'accept ; silence advised function warnings apropos-do-all t ; make `apropos' more useful - debug-on-error (and (not noninteractive) doom-debug-mode) - load-prefer-newer noninteractive + debug-on-error doom-debug-mode ffap-machine-p-known 'reject ; don't ping things that look like domain names idle-update-delay 2 ; update ui less often ;; keep the point out of the minibuffer @@ -83,8 +82,9 @@ XDG directory conventions if ~/.config/doom exists.") auto-save-list-file-name (concat doom-cache-dir "autosave") backup-directory-alist (list (cons "." (concat doom-cache-dir "backup/"))) custom-file (concat doom-etc-dir "custom.el") - pcache-directory (concat doom-cache-dir "pcache/") mc/list-file (concat doom-etc-dir "mc-lists.el") + pcache-directory (concat doom-cache-dir "pcache/") + request-storage-directory (concat doom-cache-dir "request") server-auth-dir (concat doom-cache-dir "server/") shared-game-score-directory (concat doom-etc-dir "shared-game-score/") tramp-auto-save-directory (concat doom-cache-dir "tramp-auto-save/") diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index cf79298da..60a201d32 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -48,7 +48,7 @@ immediately runs it on the current candidate (ending the ivy session)." ivy-use-selectable-prompt t) (after! magit (setq magit-completing-read-function #'ivy-completing-read)) - (after! yasnippet (cl-pushnew #'+ivy-yas-prompt yas-prompt-functions :test #'eq)) + (after! yasnippet (add-to-list 'yas-prompt-functions #'+ivy-yas-prompt #'eq)) (map! [remap switch-to-buffer] #'ivy-switch-buffer [remap persp-switch-to-buffer] #'+ivy/switch-workspace-buffer @@ -94,6 +94,8 @@ immediately runs it on the current candidate (ending the ivy session)." (set! :popup "^\\*ivy-occur" '((size . 0.35)) '((transient . 0) (quit))) (setq counsel-find-file-ignore-regexp "\\(?:^[#.]\\)\\|\\(?:[#~]$\\)\\|\\(?:^Icon?\\)" + ;; Add smart-casing and compressed archive searching (-zS) to default + ;; command arguments: counsel-rg-base-command "rg -zS --no-heading --line-number --color never %s ." counsel-ag-base-command "ag -zS --nocolor --nogroup %s" counsel-pt-base-command "pt -zS --nocolor --nogroup -e %s") @@ -187,8 +189,7 @@ immediately runs it on the current candidate (ending the ivy session)." (def-package! ivy-posframe - :when EMACS26+ - :when (featurep! +childframe) + :when (and EMACS26+ (featurep! +childframe)) :hook (ivy-mode . ivy-posframe-enable) :preface ;; This function searches the entire `obarray' just to populate @@ -196,6 +197,12 @@ immediately runs it on the current candidate (ending the ivy session)." ;; wasteful, so... (advice-add #'ivy-posframe-setup :override #'ignore) :config + (setq ivy-height 16 + ivy-fixed-height-minibuffer nil + ivy-posframe-parameters `((min-width . 90) + (min-height . ,ivy-height) + (internal-border-width . 10))) + ;; ... let's do it manually (dolist (fn (list 'ivy-posframe-display-at-frame-bottom-left 'ivy-posframe-display-at-frame-center @@ -211,10 +218,4 @@ immediately runs it on the current candidate (ending the ivy session)." ;; posframe doesn't work well with async sources (dolist (fn '(swiper counsel-rg counsel-ag counsel-pt counsel-grep counsel-git-grep)) - (map-put ivy-display-functions-alist fn nil)) - - (setq ivy-height 16 - ivy-fixed-height-minibuffer nil - ivy-posframe-parameters `((min-width . 90) - (min-height . ,ivy-height) - (internal-border-width . 10)))) + (map-put ivy-display-functions-alist fn nil))) diff --git a/modules/feature/evil/config.el b/modules/feature/evil/config.el index 199c4d590..39c3830a7 100644 --- a/modules/feature/evil/config.el +++ b/modules/feature/evil/config.el @@ -311,7 +311,7 @@ the new algorithm is confusing, like in python or ruby." fn '((:default . evil-mc-execute-default-call)))) ;; disable evil-escape in evil-mc; causes unwanted text on invocation - (cl-pushnew 'evil-escape-mode evil-mc-incompatible-minor-modes :test #'eq) + (add-to-list 'evil-mc-incompatible-minor-modes 'evil-escape-mode #'eq) (defun +evil|escape-multiple-cursors () "Clear evil-mc cursors and restore state." diff --git a/modules/lang/clojure/config.el b/modules/lang/clojure/config.el index 7fdec8af1..53a18eded 100644 --- a/modules/lang/clojure/config.el +++ b/modules/lang/clojure/config.el @@ -14,10 +14,10 @@ :after clojure-mode :config ;; setup some extra namespace auto completion for great awesome - (nconc cljr-magic-require-namespaces - '(("re-frame" . "re-frame.core") - ("reagent" . "reagent.core") - ("str" . "clojure.string")))) + (dolist (ns '(("re-frame" . "re-frame.core") + ("reagent" . "reagent.core") + ("str" . "clojure.string"))) + (map-put cljr-magic-require-namespaces (car ns) (cdr ns)))) (def-package! cider diff --git a/modules/lang/crystal/config.el b/modules/lang/crystal/config.el index 738842bbe..f1b765e72 100644 --- a/modules/lang/crystal/config.el +++ b/modules/lang/crystal/config.el @@ -14,6 +14,7 @@ (def-package! flycheck-crystal + :when (featurep! :feature syntax-checker) :after crystal-mode :config (add-hook 'crystal-mode-hook #'flycheck-mode)) diff --git a/modules/lang/elixir/config.el b/modules/lang/elixir/config.el index a7f8044dc..590bb545a 100644 --- a/modules/lang/elixir/config.el +++ b/modules/lang/elixir/config.el @@ -32,7 +32,8 @@ :when (featurep! :completion company) :after elixir-mode :config - ;; Let Doom handle this + ;; Alchemist doesn't use hook symbols to add these backends, so we have to use + ;; the entire closure to get rid of it. (let ((fn (byte-compile (lambda () (add-to-list (make-local-variable 'company-backends) 'alchemist-company))))) (remove-hook 'alchemist-mode-hook fn) (remove-hook 'alchemist-iex-mode-hook fn)) diff --git a/modules/lang/emacs-lisp/config.el b/modules/lang/emacs-lisp/config.el index ef1dac765..20033e171 100644 --- a/modules/lang/emacs-lisp/config.el +++ b/modules/lang/emacs-lisp/config.el @@ -57,9 +57,7 @@ (defun +emacs-lisp|init-flycheck () "Initialize flycheck-mode if not in emacs.d." (when (and buffer-file-name - (not (cl-loop for dir in (append (list doom-emacs-dir) - doom-modules-dirs - doom-psuedo-module-dirs) + (not (cl-loop for dir in (list doom-emacs-dir doom-private-dir) if (file-in-directory-p buffer-file-name dir) return t))) (flycheck-mode +1)))) diff --git a/modules/lang/ess/config.el b/modules/lang/ess/config.el index c84e04ddc..e08657a08 100644 --- a/modules/lang/ess/config.el +++ b/modules/lang/ess/config.el @@ -31,7 +31,7 @@ ("\\.[Jj][Mm][Dd]\\'" . ess-jags-mode)) :init (unless (featurep! :lang julia) - (push (cons "\\.jl\\'" 'ess-julia-mode) auto-mode-alist)) + (map-put auto-mode-alist "\\.jl\'" 'ess-julia-mode)) :config (add-hook 'ess-mode-hook #'doom|enable-line-numbers) (setq ess-offset-continued 'straight diff --git a/modules/lang/markdown/config.el b/modules/lang/markdown/config.el index 921bd4768..b45cbe084 100644 --- a/modules/lang/markdown/config.el +++ b/modules/lang/markdown/config.el @@ -15,10 +15,11 @@ markdown-hide-urls nil) ; trigger with `markdown-toggle-url-hiding' :config + (defun +markdown|set-fill-column-and-line-spacing () + (setq-local line-spacing 2) + (setq-local fill-column 80)) + (add-hook 'markdown-mode-hook #'+markdown|set-fill-column-and-line-spacing) (add-hook 'markdown-mode-hook #'auto-fill-mode) - (setq-hook! 'markdown-mode-hook - line-spacing 2 - fill-column 80) (map! (:map markdown-mode-map [remap find-file-at-point] #'markdown-follow-thing-at-point diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index 4c7d62bd8..4c6fe44f1 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -102,7 +102,6 @@ environment variables." :after anaconda-mode :config (map! :map anaconda-mode-map - :n "gf" nil :localleader :prefix "f" :nv "d" #'anaconda-mode-find-definitions diff --git a/modules/lang/web/+html.el b/modules/lang/web/+html.el index 4e90eda69..a01979605 100644 --- a/modules/lang/web/+html.el +++ b/modules/lang/web/+html.el @@ -82,7 +82,6 @@ "M-/" #'web-mode-comment-or-uncomment :i "SPC" #'self-insert-command - :n "M-r" #'doom/web-refresh-browser :n "za" #'web-mode-fold-or-unfold :nv "]a" #'web-mode-attribute-next :nv "[a" #'web-mode-attribute-previous diff --git a/modules/ui/nav-flash/config.el b/modules/ui/nav-flash/config.el index 1fe7f2d31..a1519f993 100644 --- a/modules/ui/nav-flash/config.el +++ b/modules/ui/nav-flash/config.el @@ -11,10 +11,11 @@ counsel-grep-post-action-hook dumb-jump-after-jump-hook) #'+nav-flash/blink-cursor) + ;; `saveplace' (advice-add #'save-place-find-file-hook :after #'+nav-flash/blink-cursor) - (after! evil - (advice-add #'evil-window-top :after #'+nav-flash/blink-cursor) - (advice-add #'evil-window-middle :after #'+nav-flash/blink-cursor) - (advice-add #'evil-window-bottom :after #'+nav-flash/blink-cursor))) + ;; `evil' + (advice-add #'evil-window-top :after #'+nav-flash/blink-cursor) + (advice-add #'evil-window-middle :after #'+nav-flash/blink-cursor) + (advice-add #'evil-window-bottom :after #'+nav-flash/blink-cursor)) diff --git a/modules/ui/neotree/config.el b/modules/ui/neotree/config.el index ea3e752dd..2723ab273 100644 --- a/modules/ui/neotree/config.el +++ b/modules/ui/neotree/config.el @@ -38,8 +38,8 @@ `((side . ,neo-window-position) (size . ,neo-window-width)) '((quit . current) (select . t))) - (when (bound-and-true-p winner-mode) - (push neo-buffer-name winner-boring-buffers)) + (after! winner + (cl-pushnew neo-buffer-name winner-boring-buffers)) ;; The cursor always sits at bol. `+neotree*fix-cursor' and ;; `+neotree*indent-cursor' change that behavior, so that the cursor is always diff --git a/modules/ui/window-select/packages.el b/modules/ui/window-select/packages.el index fc1c5fd9f..30a4d7a92 100644 --- a/modules/ui/window-select/packages.el +++ b/modules/ui/window-select/packages.el @@ -2,10 +2,11 @@ ;;; ui/window-select/packages.el (cond ((featurep! +switch-window) - ;; Install switch-window if the user indicated the '+switch-window' module flag + ;; Install switch-window if the user indicated the '+switch-window' + ;; module flag (package! switch-window)) ((or (featurep! +ace-window) t) - ;; Install ace-window if the user selects the flag '+ace-window' or by default - ;; ... if the user did not specify a module flag + ;; Install ace-window if the user selects the flag '+ace-window' or by + ;; default ... if the user did not specify a module flag (package! ace-window)))