From 06d5d5e6c0c595005c541cc6497a9b1df4d96120 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 23 Apr 2020 23:49:35 -0400 Subject: [PATCH] General refactors, reformatting & comment revision --- core/autoload/config.el | 2 +- core/core-projects.el | 3 -- core/core-ui.el | 3 -- init.example.el | 8 ++--- modules/completion/helm/config.el | 9 +----- modules/config/default/+evil-bindings.el | 26 +++++++++------ modules/editor/snippets/config.el | 1 + modules/email/mu4e/README.org | 2 +- modules/input/chinese/config.el | 5 +-- modules/lang/clojure/config.el | 40 ++++++++++++++---------- modules/lang/emacs-lisp/packages.el | 3 ++ modules/lang/java/config.el | 4 +-- modules/lang/org/contrib/dragndrop.el | 12 +++---- modules/term/eshell/config.el | 2 +- modules/tools/lookup/config.el | 9 +++--- 15 files changed, 65 insertions(+), 64 deletions(-) diff --git a/core/autoload/config.el b/core/autoload/config.el index eb3acac93..841a11b91 100644 --- a/core/autoload/config.el +++ b/core/autoload/config.el @@ -76,7 +76,7 @@ Runs `doom-reload-hook' afterwards." (interactive) (require 'core-cli) (when (and IS-WINDOWS (file-exists-p doom-env-file)) - (warn "Can't regenerate envvar file from within Emacs. Run 'doom env' from the console")) + (message "Can't regenerate envvar file from within Emacs. Run 'doom env' from the console")) ;; In case doom/reload is run before incrementally loaded packages are loaded, ;; which could cause odd load order issues. (mapc #'require (cdr doom-incremental-packages)) diff --git a/core/core-projects.el b/core/core-projects.el index 8b65e1ee9..daca64c3a 100644 --- a/core/core-projects.el +++ b/core/core-projects.el @@ -15,9 +15,6 @@ Emacs.") "fd") "name of `fd-find' executable binary") -(defvar doom-projectile-cache-timer-file (concat doom-cache-dir "projectile.timers") - "Where to save project file cache timers.") - ;; ;;; Packages diff --git a/core/core-ui.el b/core/core-ui.el index 103404615..ebbe798a1 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -278,9 +278,6 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original (setq indicate-buffer-boundaries nil indicate-empty-lines nil) -;; remove continuation arrow on right fringe -(delq! 'continuation fringe-indicator-alist 'assq) - ;; ;;; Windows/frames diff --git a/init.example.el b/init.example.el index 06bae4712..370dd77d4 100644 --- a/init.example.el +++ b/init.example.el @@ -1,11 +1,11 @@ ;;; init.el -*- lexical-binding: t; -*- -;; This file controls what Doom modules are enabled and what order they load in. -;; Remember to run 'doom sync' after modifying it! +;; This file controls what Doom modules are enabled and what order they load +;; in. Remember to run 'doom sync' after modifying it! ;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's -;; documentation. There you'll find information about all of Doom's modules -;; and what flags they support. +;; documentation. There you'll find information about all of Doom's +;; modules and what flags they support. ;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or ;; 'C-c g k' for non-vim users) to view its documentation. This works on diff --git a/modules/completion/helm/config.el b/modules/completion/helm/config.el index c27d30113..66e8d7b9a 100644 --- a/modules/completion/helm/config.el +++ b/modules/completion/helm/config.el @@ -101,14 +101,7 @@ be negative.") :config (set-popup-rule! "^\\*helm" :vslot -100 :size 0.22 :ttl nil) - ;; HACK Doom doesn't support these commands, which invite the user to install - ;; the package via ELPA. Force them to use +helm/* instead, because they work - ;; out of the box. - (advice-add #'helm-projectile-rg :override #'+helm/project-search) - (advice-add #'helm-projectile-ag :override #'+helm/project-search) - (advice-add #'helm-projectile-grep :override #'+helm/project-search) - - ;; Hide the modeline + ;; Hide the modeline in helm windows as it serves little purpose. (defun +helm--hide-mode-line (&rest _) (with-current-buffer (helm-buffer-get) (unless helm-mode-line-string diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index ce615bb6f..43a3e3770 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -6,7 +6,8 @@ ;; Minibuffer (define-key! evil-ex-completion-map "C-a" #'evil-beginning-of-line - "C-b" #'evil-backward-char) + "C-b" #'evil-backward-char + "C-f" #'evil-forward-char) (define-key! :keymaps +default-minibuffer-maps [escape] #'abort-recursive-edit @@ -15,16 +16,21 @@ "C-u" #'evil-delete-back-to-indentation "C-v" #'yank "C-w" #'doom/delete-backward-word - "C-z" (λ! (ignore-errors (call-interactively #'undo))) - ;; Scrolling lines - "C-j" #'next-line - "C-k" #'previous-line - "C-S-j" #'scroll-up-command - "C-S-k" #'scroll-down-command) + "C-z" (λ! (ignore-errors (call-interactively #'undo)))) - (define-key! read-expression-map - "C-j" #'next-line-or-history-element - "C-k" #'previous-line-or-history-element)) + (when (featurep! :editor evil +everywhere) + (define-key! :keymaps +default-minibuffer-maps + "C-f" #'forward-word + "C-b" #'backward-word + "M-f" #'foward-char + "M-b" #'backward-char + "C-j" #'next-line + "C-k" #'previous-line + "C-S-j" #'scroll-up-command + "C-S-k" #'scroll-down-command) + (define-key! read-expression-map + "C-j" #'next-line-or-history-element + "C-k" #'previous-line-or-history-element))) ;; diff --git a/modules/editor/snippets/config.el b/modules/editor/snippets/config.el index d4b9728a8..2a337412f 100644 --- a/modules/editor/snippets/config.el +++ b/modules/editor/snippets/config.el @@ -21,6 +21,7 @@ (defvar yas-snippet-dirs nil) (if (daemonp) + ;; If in a daemon session, front-load this expensive work: (after! yasnippet (yas-reload-all)) ;; Ensure `yas-reload-all' is called as late as possible. Other modules ;; could have additional configuration for yasnippet. For example, diff --git a/modules/email/mu4e/README.org b/modules/email/mu4e/README.org index 9f4a95172..dcf51e24a 100644 --- a/modules/email/mu4e/README.org +++ b/modules/email/mu4e/README.org @@ -12,7 +12,7 @@ - [[#arch-linux][Arch Linux]] - [[#nixos][NixOS]] - [[#opensuse][openSUSE]] - - [[Debian/Ubuntu]] + - [[#debianubuntu][Debian/Ubuntu]] - [[#features][Features]] - [[#configuration][Configuration]] - [[#offlineimap][offlineimap]] diff --git a/modules/input/chinese/config.el b/modules/input/chinese/config.el index 666cfe395..ffa4e2669 100644 --- a/modules/input/chinese/config.el +++ b/modules/input/chinese/config.el @@ -2,9 +2,10 @@ (use-package! pyim :after-call after-find-file pre-command-hook + :init + (setq pyim-dcache-directory (concat doom-cache-dir "pyim/")) :config - (setq pyim-dcache-directory (concat doom-cache-dir "pyim/") - pyim-page-tooltip t + (setq pyim-page-tooltip t default-input-method "pyim")) diff --git a/modules/lang/clojure/config.el b/modules/lang/clojure/config.el index 36d8b0b75..7a091a3ae 100644 --- a/modules/lang/clojure/config.el +++ b/modules/lang/clojure/config.el @@ -11,21 +11,22 @@ ;; ;;; Packages -;;;###package clojure-mode -(add-hook 'clojure-mode-hook #'rainbow-delimiters-mode) -(when (featurep! +lsp) - (add-hook! '(clojure-mode-local-vars-hook - clojurec-mode-local-vars-hook - clojurescript-mode-local-vars-hook) - (defun +clojure-disable-lsp-indentation-h () - (setq-local lsp-enable-indentation nil)) - #'lsp!) - (after! lsp-clojure - (dolist (m '(clojure-mode - clojurec-mode - clojurescript-mode - clojurex-mode)) - (add-to-list 'lsp-language-id-configuration (cons m "clojure"))))) +(use-package! clojure-mode + :hook (clojure-mode . rainbow-delimiters-mode) + :config + (when (featurep! +lsp) + (add-hook! '(clojure-mode-local-vars-hook + clojurec-mode-local-vars-hook + clojurescript-mode-local-vars-hook) + (defun +clojure-disable-lsp-indentation-h () + (setq-local lsp-enable-indentation nil)) + #'lsp!) + (after! lsp-clojure + (dolist (m '(clojure-mode + clojurec-mode + clojurescript-mode + clojurex-mode)) + (add-to-list 'lsp-language-id-configuration (cons m "clojure")))))) (use-package! cider @@ -58,13 +59,18 @@ cider-repl-history-quit-action 'delete-and-restore cider-repl-history-highlight-inserted-item t cider-repl-history-size 1000 - cider-repl-pop-to-buffer-on-connect 'display-only cider-repl-result-prefix ";; => " cider-repl-print-length 100 cider-repl-use-clojure-font-lock t cider-repl-use-pretty-printing t cider-repl-wrap-history nil - cider-stacktrace-default-filters '(tooling dup)) + cider-stacktrace-default-filters '(tooling dup) + + ;; Don't focus the CIDER REPL when it starts. Since it can take so long + ;; to start up, you either wait for a minute doing nothing or be + ;; prepared for your cursor to suddenly change buffers without warning. + ;; See https://github.com/clojure-emacs/cider/issues/1872 + cider-repl-pop-to-buffer-on-connect 'display-only) ;; Error messages emitted from CIDER is silently funneled into *nrepl-server* ;; rather than the *cider-repl* buffer. How silly. We might want to see that diff --git a/modules/lang/emacs-lisp/packages.el b/modules/lang/emacs-lisp/packages.el index f953c3662..a72ea6124 100644 --- a/modules/lang/emacs-lisp/packages.el +++ b/modules/lang/emacs-lisp/packages.el @@ -4,6 +4,8 @@ (package! elisp-mode :built-in t) (package! highlight-quoted :pin "2410347815") + +;; Tools (package! macrostep :pin "424e3734a1") (package! overseer :pin "02d49f582e") (package! elisp-def :pin "368b04da68") @@ -11,4 +13,5 @@ (when (featurep! :checkers syntax) (package! flycheck-cask :pin "3457ae553c")) +;; Libraries (package! buttercup :pin "a91f282025") diff --git a/modules/lang/java/config.el b/modules/lang/java/config.el index 4b04f3dff..5e6dee5fd 100644 --- a/modules/lang/java/config.el +++ b/modules/lang/java/config.el @@ -22,7 +22,7 @@ If the depth is 2, the first two directories are removed: net.lissner.game.") ;; -;; java-mode +;;; java-mode (add-hook 'java-mode-hook #'rainbow-delimiters-mode) @@ -31,7 +31,7 @@ If the depth is 2, the first two directories are removed: net.lissner.game.") ;; -;; Common packages +;;; Common packages (use-package! android-mode :commands android-mode diff --git a/modules/lang/org/contrib/dragndrop.el b/modules/lang/org/contrib/dragndrop.el index 84e2671e1..28f3229dc 100644 --- a/modules/lang/org/contrib/dragndrop.el +++ b/modules/lang/org/contrib/dragndrop.el @@ -38,7 +38,7 @@ (defadvice! +org--dragndrop-insert-link-a (_link filename) "Produces and inserts a link to FILENAME into the document. -If FILENAME is an image, produce an attach:%s path, otherwise use file:%s (with +If FILENAME is an image, produce an download:%s path, otherwise use file:%s (with an file icon produced by `+org-attach-icon-for')." :override #'org-download-insert-link (if (looking-back "^[ \t]+" (line-beginning-position)) @@ -54,11 +54,9 @@ an file icon produced by `+org-attach-icon-for')." (if (= org-download-image-org-width 0) "" (format "#+attr_org: :width %dpx\n" org-download-image-org-width)) (format org-download-link-format - (cond ((file-in-directory-p filename org-attach-id-dir) - (file-relative-name filename org-attach-id-dir)) - ((file-in-directory-p filename org-directory) - (file-relative-name filename org-directory)) - (filename))))) + (if (file-in-directory-p filename org-attach-id-dir) + (file-relative-name filename org-attach-id-dir) + filename)))) (org-display-inline-images)) ((insert (format "%s [[./%s][%s]] " @@ -72,6 +70,6 @@ an file icon produced by `+org-attach-icon-for')." :filter-return #'org-download--fullname (let ((dir (or (if buffer-file-name (file-name-directory buffer-file-name)) default-directory))) - (if (file-in-directory-p dir org-directory) + (if (file-in-directory-p dir org-attach-id-dir) (file-relative-name path dir) path)))) diff --git a/modules/term/eshell/config.el b/modules/term/eshell/config.el index 412d69bdc..217fa6ff4 100644 --- a/modules/term/eshell/config.el +++ b/modules/term/eshell/config.el @@ -48,7 +48,7 @@ You should use `set-eshell-alias!' to change this.") ;; -;; Packages +;;; Packages (after! eshell ; built-in (setq eshell-banner-message diff --git a/modules/tools/lookup/config.el b/modules/tools/lookup/config.el index 35179e360..cd78596b3 100644 --- a/modules/tools/lookup/config.el +++ b/modules/tools/lookup/config.el @@ -172,11 +172,10 @@ See https://github.com/magit/ghub/issues/81" (let ((gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")) (funcall orig-fn url))) - (use-package! helm-dash - :when (featurep! :completion helm)) - - (use-package! counsel-dash - :when (featurep! :completion ivy))) + (cond ((featurep! :completion helm) + (require 'helm-dash nil t)) + ((featurep! :completion ivy) + (require 'counsel-dash nil t)))) ;;