diff --git a/bin/doom b/bin/doom index 6f13b997a..600bf7b74 100755 --- a/bin/doom +++ b/bin/doom @@ -69,8 +69,8 @@ (setenv "YES" "1") (message "Auto-yes mode on")))) - (or (file-directory-p emacs-dir) - (error "%s does not exist" emacs-dir)) + (unless (file-directory-p emacs-dir) + (error "%s does not exist" emacs-dir)) ;; Bootstrap Doom (load (expand-file-name "init" emacs-dir) @@ -82,8 +82,8 @@ (member (car args) '("help" "h"))) (usage)) ((not args) - (message "No command detected, aborting!\n\nRun %s help for documentation." - (file-name-nondirectory load-file-name))) + (print! (error "No command detected.\n")) + (usage)) ((let ((default-directory emacs-dir)) (setq argv nil noninteractive 'doom) diff --git a/core/autoload/config.el b/core/autoload/config.el index 4251a99a0..1a7cca105 100644 --- a/core/autoload/config.el +++ b/core/autoload/config.el @@ -50,7 +50,7 @@ Runs `doom-reload-hook' afterwards." (message "Finished!")) ;;;###autoload -(defun doom/reload-autoloads (&optional force-p) +(defun doom/reload-autoloads (&optional _force-p) "Reload only `doom-autoload-file' and `doom-package-autoload-file'. This is much faster and safer than `doom/reload', but not as comprehensive. This @@ -60,6 +60,7 @@ not reload your private config. It is useful to only pull in changes performed by 'doom refresh' on the command line." (interactive "P") + ;; TODO regenerate autoloads (doom-initialize-autoloads doom-autoload-file) (doom-initialize-autoloads doom-package-autoload-file)) diff --git a/core/autoload/debug.el b/core/autoload/debug.el index 10dd3662d..f97a5b185 100644 --- a/core/autoload/debug.el +++ b/core/autoload/debug.el @@ -43,7 +43,7 @@ ready to be pasted in a bug report on github." (elc-files . ,(length (doom-files-in `(,@doom-modules-dirs ,doom-core-dir ,doom-private-dir) - :type 'files :match "\\.elc$" :sort nil))) + :type 'files :match "\\.elc$"))) (modules ,@(or (cl-loop with cat = nil for key being the hash-keys of doom-modules if (or (not cat) (not (eq cat (car key)))) diff --git a/core/autoload/files.el b/core/autoload/files.el index 7f7c8d2f3..ed84330c3 100644 --- a/core/autoload/files.el +++ b/core/autoload/files.el @@ -53,7 +53,7 @@ ;; -;; Commands +;;; Commands ;;;###autoload (defun doom/delete-this-file (&optional path force-p) diff --git a/core/autoload/format.el b/core/autoload/format.el index 7c986e9d4..534950bd6 100644 --- a/core/autoload/format.el +++ b/core/autoload/format.el @@ -184,13 +184,11 @@ transformative logic." (defmacro format! (message &rest args) "An alternative to `format' that understands (color ...) and converts them into faces or ANSI codes depending on the type of sesssion we're in." - (declare (debug t)) `(doom--format (format ,@(doom--format-apply `(,message ,@args))))) ;;;###autoload (defmacro print-group! (&rest body) "Indents any `print!' or `format!' output within BODY." - (declare (debug t)) `(let ((doom-format-indent (+ 2 doom-format-indent))) ,@body)) @@ -206,7 +204,6 @@ Can be colored using (color ...) blocks: (print! (green \"Great %s!\") \"success\") Uses faces in interactive sessions and ANSI codes otherwise." - (declare (debug t)) `(doom--format-print (format! ,message ,@args))) ;;;###autoload @@ -214,18 +211,15 @@ Uses faces in interactive sessions and ANSI codes otherwise." "Like `insert'; the last argument must be format arguments for MESSAGE. \(fn MESSAGE... ARGS)" - (declare (debug t)) `(insert (format! (concat ,message ,@(butlast args)) ,@(car (last args))))) ;;;###autoload (defmacro error! (message &rest args) "Like `error', but with the power of `format!'." - (declare (debug t)) `(error (format! ,message ,@args))) ;;;###autoload (defmacro user-error! (message &rest args) "Like `user-error', but with the power of `format!'." - (declare (debug t)) `(user-error (format! ,message ,@args))) diff --git a/core/autoload/help.el b/core/autoload/help.el index d7bac09d6..762c1c0c0 100644 --- a/core/autoload/help.el +++ b/core/autoload/help.el @@ -121,6 +121,7 @@ selection of all minor-modes, active or not." ;; ;;; Documentation commands +(defvar org-agenda-files) (defun doom--org-headings (files &optional depth include-files) "TODO" (require 'org) @@ -155,6 +156,7 @@ selection of all minor-modes, active or not." (mapc #'kill-buffer org-agenda-new-buffers) (setq org-agenda-new-buffers nil)))) +(defvar ivy-sort-functions-alist) ;;;###autoload (defun doom-completing-read-org-headings (prompt files &optional depth include-files initial-input) "TODO" @@ -197,8 +199,7 @@ selection of all minor-modes, active or not." "Find in News: " (nreverse (doom-files-in (expand-file-name "news" doom-docs-dir) :match "/[0-9]" - :relative-to doom-docs-dir - :sort t)) + :relative-to doom-docs-dir)) nil t initial-input)) ;;;###autoload diff --git a/core/autoload/packages.el b/core/autoload/packages.el index c26673ac2..0c24d787f 100644 --- a/core/autoload/packages.el +++ b/core/autoload/packages.el @@ -262,8 +262,7 @@ ones." (doom-files-in doom-modules-dir :depth 2 :full t - :match "/packages\\.el$" - :sort nil)) + :match "/packages\\.el$")) (cl-loop for key being the hash-keys of doom-modules for path = (doom-module-path (car key) (cdr key) "packages.el") for doom--current-module = key diff --git a/core/autoload/sessions.el b/core/autoload/sessions.el index 3474fc3e1..804abaa4c 100644 --- a/core/autoload/sessions.el +++ b/core/autoload/sessions.el @@ -1,5 +1,11 @@ ;;; core/autoload/sessions.el -*- lexical-binding: t; -*- +(defvar desktop-base-file-name) +(defvar desktop-dirname) +(defvar desktop-restore-eager) +(defvar desktop-file-modtime) + + ;; ;;; Helpers diff --git a/core/autoload/text.el b/core/autoload/text.el index c3ec2a0dd..8f26efa10 100644 --- a/core/autoload/text.el +++ b/core/autoload/text.el @@ -186,9 +186,10 @@ Respects `require-final-newline'." (setq indent-tabs-mode (not indent-tabs-mode)) (message "Indent style changed to %s" (if indent-tabs-mode "tabs" "spaces"))) +(defvar editorconfig-lisp-use-default-indent) ;;;###autoload (defun doom/set-indent-width (width) - "Change the indentation width of the current buffer." + "Change the indentation size to WIDTH of the current buffer." (interactive (list (if (integerp current-prefix-arg) current-prefix-arg diff --git a/core/cli/byte-compile.el b/core/cli/byte-compile.el index 9de5cfa4a..f08e7f1d4 100644 --- a/core/cli/byte-compile.el +++ b/core/cli/byte-compile.el @@ -185,9 +185,9 @@ module. This does not include your byte-compiled, third party packages.'" with success = nil for path in (append (doom-glob doom-emacs-dir "*.elc") - (doom-files-in doom-private-dir :match "\\.elc$" :depth 1 :sort nil) - (doom-files-in doom-core-dir :match "\\.elc$" :sort nil) - (doom-files-in doom-modules-dirs :match "\\.elc$" :depth 4 :sort nil)) + (doom-files-in doom-private-dir :match "\\.elc$" :depth 1) + (doom-files-in doom-core-dir :match "\\.elc$") + (doom-files-in doom-modules-dirs :match "\\.elc$" :depth 4)) if (file-exists-p path) do (delete-file path) and do (print! (success "Deleted %s") (relpath path)) diff --git a/core/core-editor.el b/core/core-editor.el index 2c56c2004..175e5a458 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -101,7 +101,7 @@ successfully sets indent_style/indent_size.") (def-package! recentf ;; Keep track of recently opened files - :defer-incrementally (easymenu tree-widget timer) + :defer-incrementally easymenu tree-widget timer :after-call after-find-file :commands recentf-open-files :config @@ -143,7 +143,7 @@ successfully sets indent_style/indent_size.") (def-package! savehist ;; persist variables across sessions - :defer-incrementally (custom) + :defer-incrementally custom :after-call post-command-hook :config (setq savehist-file (concat doom-cache-dir "savehist") @@ -163,7 +163,7 @@ successfully sets indent_style/indent_size.") (def-package! saveplace ;; persistent point location in buffers - :after-call (after-find-file dired-initial-position-hook) + :after-call after-find-file dired-initial-position-hook :config (setq save-place-file (concat doom-cache-dir "saveplace") save-place-forget-unreadable-files t @@ -177,7 +177,7 @@ successfully sets indent_style/indent_size.") (def-package! server :when (display-graphic-p) - :after-call (pre-command-hook after-find-file focus-out-hook) + :after-call pre-command-hook after-find-file focus-out-hook :init (when-let (name (getenv "EMACS_SERVER_NAME")) (setq server-name name)) @@ -190,7 +190,7 @@ successfully sets indent_style/indent_size.") ;;; Packages (def-package! better-jumper - :after-call (pre-command-hook) + :after-call pre-command-hook :init (global-set-key [remap evil-jump-forward] #'better-jumper-jump-forward) (global-set-key [remap evil-jump-backward] #'better-jumper-jump-backward) @@ -312,8 +312,8 @@ successfully sets indent_style/indent_size.") (def-package! smartparens ;; Auto-close delimiters and blocks as you type. It's more powerful than that, ;; but that is all Doom uses it for. - :after-call (doom-switch-buffer-hook after-find-file) - :commands (sp-pair sp-local-pair sp-with-modes sp-point-in-comment sp-point-in-string) + :after-call doom-switch-buffer-hook after-find-file + :commands sp-pair sp-local-pair sp-with-modes sp-point-in-comment sp-point-in-string :config (require 'smartparens-config) (setq sp-highlight-pair-overlay nil @@ -345,13 +345,13 @@ successfully sets indent_style/indent_size.") (def-package! so-long - :after-call (after-find-file) + :after-call after-find-file :config (global-so-long-mode +1)) (def-package! undo-tree ;; Branching & persistent undo - :after-call (doom-switch-buffer-hook after-find-file) + :after-call doom-switch-buffer-hook after-find-file :config (setq undo-tree-auto-save-history nil ; disable because unstable ;; undo-in-region is known to cause undo history corruption, which can @@ -378,11 +378,10 @@ successfully sets indent_style/indent_size.") (def-package! ws-butler ;; a less intrusive `delete-trailing-whitespaces' on save - :after-call (after-find-file) + :after-call after-find-file :config - (setq ws-butler-global-exempt-modes - (append ws-butler-global-exempt-modes - '(special-mode comint-mode term-mode eshell-mode))) + (appendq! ws-butler-global-exempt-modes + '(special-mode comint-mode term-mode eshell-mode)) (ws-butler-global-mode)) (provide 'core-editor) diff --git a/core/core-keybinds.el b/core/core-keybinds.el index 6daa8f245..7619a503b 100644 --- a/core/core-keybinds.el +++ b/core/core-keybinds.el @@ -74,7 +74,7 @@ If any hook returns non-nil, all hooks after it are ignored.") ;;; General + leader/localleader keys (use-package general - :config + :init ;; Convenience aliases (defalias 'define-key! #'general-def) (defalias 'unmap! #'general-unbind)) diff --git a/core/core-lib.el b/core/core-lib.el index 7efd60812..22c887724 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -193,7 +193,6 @@ at the values with which this function was called." &key filter map - sort ; TODO Allow a function for custom sorting? (full t) (follow-symlinks t) (type 'files) diff --git a/core/core-projects.el b/core/core-projects.el index 3f09b9de9..1192f7b5c 100644 --- a/core/core-projects.el +++ b/core/core-projects.el @@ -22,7 +22,7 @@ Emacs.") ;;; Packages (def-package! projectile - :after-call (after-find-file dired-before-readin-hook minibuffer-setup-hook) + :after-call after-find-file dired-before-readin-hook minibuffer-setup-hook :commands (projectile-project-root projectile-project-name projectile-project-p @@ -149,7 +149,7 @@ the command instead." ;; -;; Project-based minor modes +;;; Project-based minor modes (defvar doom-project-hook nil "Hook run when a project is enabled. The name of the project's mode and its diff --git a/core/core-ui.el b/core/core-ui.el index f6cc095bd..02385d411 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -418,14 +418,14 @@ treat Emacs as a non-application window." (def-package! winner ;; undo/redo changes to Emacs' window layout - :after-call (after-find-file doom-switch-window-hook) + :after-call after-find-file doom-switch-window-hook :preface (defvar winner-dont-bind-my-keys t) :config (winner-mode +1)) ; I'll bind keys myself (def-package! paren ;; highlight matching delimiters - :after-call (after-find-file doom-switch-buffer-hook) + :after-call after-find-file doom-switch-buffer-hook :config (setq show-paren-delay 0.1 show-paren-highlight-openparen t @@ -448,8 +448,12 @@ treat Emacs as a non-application window." ;;; Third party packages (def-package! all-the-icons - :commands (all-the-icons-octicon all-the-icons-faicon all-the-icons-fileicon - all-the-icons-wicon all-the-icons-material all-the-icons-alltheicon) + :commands (all-the-icons-octicon + all-the-icons-faicon + all-the-icons-fileicon + all-the-icons-wicon + all-the-icons-material + all-the-icons-alltheicon) :init (def-advice! doom--disable-all-the-icons-in-tty-a (orig-fn &rest args) "all-the-icons doesn't work in the terminal, so we \"disable\" them." diff --git a/core/core.el b/core/core.el index 9f24e28bb..6fc391a87 100644 --- a/core/core.el +++ b/core/core.el @@ -500,6 +500,9 @@ to least)." load-path doom--initial-load-path process-environment doom--initial-process-environment) + (require 'core-lib) + (require 'core-modules) + ;; `doom-autoload-file' tells Emacs where to load all its functions from. ;; This includes everything in core/autoload/*.el and autoload files in ;; enabled modules. @@ -530,26 +533,24 @@ to least)." ;; Load shell environment (when (and (not noninteractive) (file-exists-p doom-env-file)) - (doom-load-env-vars doom-env-file))) - - ;; In case we want to use package.el's API - (with-eval-after-load 'package - (require 'core-packages)) - ;; Or straight interactively - (with-eval-after-load 'straight - (require 'core-packages) - (doom-initialize-packages))) + (doom-load-env-vars doom-env-file)))) ;; ;;; Bootstrap Doom -(add-to-list 'load-path doom-core-dir) -(require 'core-lib) -(require 'core-modules) -(if noninteractive (require 'core-cli)) (doom-initialize noninteractive) -(unless noninteractive + +;; In case we want to use package.el's API +(with-eval-after-load 'package + (require 'core-packages)) +;; Or straight interactively +(with-eval-after-load 'straight + (require 'core-packages) + (doom-initialize-packages)) + +(if noninteractive + (require 'core-cli) (add-hook 'window-setup-hook #'doom-display-benchmark-h) (require 'core-keybinds) (require 'core-ui) diff --git a/init.test.el b/init.test.el index b59d71568..d7eee9799 100644 --- a/init.test.el +++ b/init.test.el @@ -1,4 +1,6 @@ -;;; init.test.el -- for automated unit tests -*- lexical-binding: t; -*- +;;; init.test.el -*- lexical-binding: t; -*- + +;; An init.el for our unit test suites. Do not use this! (doom! :completion company diff --git a/modules/completion/company/config.el b/modules/completion/company/config.el index 2dc0b4c96..421b42586 100644 --- a/modules/completion/company/config.el +++ b/modules/completion/company/config.el @@ -1,8 +1,8 @@ ;;; completion/company/config.el -*- lexical-binding: t; -*- (def-package! company - :commands (company-complete-common company-manual-begin company-grab-line) - :after-call (evil-insert-state-entry-hook evil-emacs-state-entry-hook) + :commands company-complete-common company-manual-begin company-grab-line + :after-call evil-insert-state-entry-hook evil-emacs-state-entry-hook :init (setq company-minimum-prefix-length 2 company-tooltip-limit 14 @@ -37,7 +37,6 @@ (def-package! company-tng :when (featurep! +tng) - :defer 2 :after-call post-self-insert-hook :config (add-to-list 'company-frontends 'company-tng-frontend) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index 0a425f3f7..3ff8f9287 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -324,5 +324,5 @@ evil-ex-specific constructs, so we disable it solely in evil-ex." (prescient-persist-mode +1)) -;; Used by `counsel-M-x' -(setq amx-save-file (concat doom-cache-dir "amx-items")) +;;;###package amx +(setq amx-save-file (concat doom-cache-dir "amx-items")) ; used by `counsel-M-x' diff --git a/modules/editor/evil/autoload/unimpaired.el b/modules/editor/evil/autoload/unimpaired.el index e2fcf4b52..25128bee4 100644 --- a/modules/editor/evil/autoload/unimpaired.el +++ b/modules/editor/evil/autoload/unimpaired.el @@ -44,7 +44,7 @@ (user-error "Must be called from a file-visiting buffer")) (let* ((directory (file-name-directory buffer-file-name)) (filename (file-name-nondirectory buffer-file-name)) - (files (doom-files-in directory :depth 0 :sort t :match "/[^._][^/]*$")) + (files (doom-files-in directory :depth 0 :match "/[^._][^/]*$")) (index (cl-position filename files :test #'string=))) (when (null index) (user-error "Couldn't find this file in current directory")) diff --git a/modules/editor/evil/config.el b/modules/editor/evil/config.el index 35a3a3f20..b1f080e05 100644 --- a/modules/editor/evil/config.el +++ b/modules/editor/evil/config.el @@ -184,7 +184,7 @@ directives. By default, this only recognizes C directives.") (def-package! evil-easymotion - :commands (evilem-create evilem-default-keybindings) + :commands evilem-create evilem-default-keybindings :config ;; Use evil-search backend, instead of isearch (evilem-make-motion evilem-motion-search-next #'evil-ex-search-next @@ -199,7 +199,7 @@ directives. By default, this only recognizes C directives.") (def-package! evil-embrace - :commands (embrace-add-pair embrace-add-pair-regexp) + :commands embrace-add-pair embrace-add-pair-regexp :hook (LaTeX-mode . embrace-LaTeX-mode-hook) :hook (org-mode . embrace-org-mode-hook) :hook ((ruby-mode enh-ruby-mode) . embrace-ruby-mode-hook) @@ -246,8 +246,8 @@ directives. By default, this only recognizes C directives.") (def-package! evil-escape - :commands (evil-escape) - :after-call (evil-normal-state-exit-hook) + :commands evil-escape + :after-call evil-normal-state-exit-hook :init (setq evil-escape-excluded-states '(normal visual multiedit emacs motion) evil-escape-excluded-major-modes '(neotree-mode treemacs-mode vterm-mode) @@ -272,8 +272,10 @@ directives. By default, this only recognizes C directives.") (def-package! evil-snipe - :commands (evil-snipe-mode evil-snipe-override-mode - evil-snipe-local-mode evil-snipe-override-local-mode) + :commands (evil-snipe-mode + evil-snipe-override-mode + evil-snipe-local-mode + evil-snipe-override-local-mode) :after-call pre-command-hook :init (setq evil-snipe-smart-case t @@ -306,7 +308,7 @@ directives. By default, this only recognizes C directives.") ;; -;; Text object plugins +;;; Text object plugins (def-package! exato - :commands (evil-outer-xml-attr evil-inner-xml-attr)) + :commands evil-outer-xml-attr evil-inner-xml-attr) diff --git a/modules/lang/data/config.el b/modules/lang/data/config.el index 38982b7cc..de77f6177 100644 --- a/modules/lang/data/config.el +++ b/modules/lang/data/config.el @@ -10,7 +10,7 @@ ;; -;; Third-party plugins +;;; Third-party plugins ;; `csv-mode' (map! :after csv-mode @@ -37,5 +37,3 @@ (def-project-mode! +data-vagrant-mode :files ("Vagrantfile")) - - diff --git a/modules/lang/emacs-lisp/autoload.el b/modules/lang/emacs-lisp/autoload.el index 17f5c0de4..d1d1846ed 100644 --- a/modules/lang/emacs-lisp/autoload.el +++ b/modules/lang/emacs-lisp/autoload.el @@ -71,6 +71,13 @@ library/userland functions" (throw 'matcher t))))))) nil)) +;; `+emacs-lisp-highlight-vars-and-faces' is a potentially expensive function +;; and should be byte-compiled, no matter what, to ensure it runs as fast as +;; possible: +(unless (byte-code-function-p (symbol-function '+emacs-lisp-highlight-vars-and-faces)) + (with-no-warnings + (byte-compile #'+emacs-lisp-highlight-vars-and-faces))) + ;;;###autoload (defun +emacs-lisp-lookup-documentation (thing) "Lookup THING with `helpful-variable' if it's a variable, `helpful-callable' @@ -79,13 +86,6 @@ if it's callable, `apropos' otherwise." (doom/describe-symbol thing) (call-interactively #'doom/describe-symbol))) -;; `+emacs-lisp-highlight-vars-and-faces' is a potentially expensive function -;; and should be byte-compiled, no matter what, to ensure it runs as fast as -;; possible: -(when (not (byte-code-function-p (symbol-function '+emacs-lisp-highlight-vars-and-faces))) - (with-no-warnings - (byte-compile #'+emacs-lisp-highlight-vars-and-faces))) - ;; ;;; Commands diff --git a/modules/lang/emacs-lisp/config.el b/modules/lang/emacs-lisp/config.el index a2d8d3fab..2d502be33 100644 --- a/modules/lang/emacs-lisp/config.el +++ b/modules/lang/emacs-lisp/config.el @@ -34,9 +34,6 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.") ("add-hook" "remove-hook") ("add-hook!" "remove-hook!"))) - ;; TODO - (put 'add-hook 'lisp-indent-function 'defun) - (setq-hook! 'emacs-lisp-mode-hook tab-width 2 ;; shorter name in modeline @@ -72,7 +69,7 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.") ;; `emacs-lisp' checker's verbosity. (add-hook 'flycheck-mode-hook #'+emacs-lisp-reduce-flycheck-errors-in-emacs-config-h) - ;; Special fontification for elisp + ;; Special syntax highlighting for elisp... (font-lock-add-keywords 'emacs-lisp-mode (append `(;; custom Doom cookies diff --git a/modules/lang/javascript/config.el b/modules/lang/javascript/config.el index 717cec403..d3f0ad365 100644 --- a/modules/lang/javascript/config.el +++ b/modules/lang/javascript/config.el @@ -36,8 +36,9 @@ :interpreter "node" :commands js2-line-break :config - (setq js2-skip-preprocessor-directives t - js-chain-indent t + (setq js-chain-indent t + ;; Don't mishighlight shebang lines + js2-skip-preprocessor-directives t ;; let flycheck handle this js2-mode-show-parse-errors nil js2-mode-show-strict-warnings nil diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index e809cda2f..0b3293337 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -270,14 +270,16 @@ Some commands of interest: + `+org-attach/file' + `+org-attach/url' + `+org-attach/sync'" - (setq org-attach-directory (expand-file-name org-attach-directory org-directory)) + (setq org-attach-directory (doom-dir org-directory org-attach-directory)) ;; A shorter link to attachments - (add-to-list 'org-link-abbrev-alist (cons "attach" (abbreviate-file-name org-attach-directory))) + (add-to-list 'org-link-abbrev-alist + (cons "attach" + (abbreviate-file-name org-attach-directory))) (org-link-set-parameters "attach" - :follow (lambda (link) (find-file (expand-file-name link org-attach-directory))) + :follow (lambda (link) (find-file (doom-path org-attach-directory link))) :complete (lambda (&optional _arg) (+org--relpath (+org-link-read-file "attach" org-attach-directory) org-attach-directory)) @@ -571,8 +573,8 @@ between the two." "e" #'org-table-edit-formulas "=" #'org-table-eval-formulas))) - ;; Fixes #1483: this messy hack fixes `org-agenda' or `evil-org-agenda' - ;; overriding SPC, breaking the localleader. TODO Improve me! + ;; HACK Fixes #1483: this messy hack fixes `org-agenda' or `evil-org-agenda' + ;; overriding SPC, breaking the localleader (define-minor-mode org-agenda-localleader-mode "TODO" :keymap (make-sparse-keymap)) (add-hook 'org-agenda-mode-hook #'org-agenda-localleader-mode) diff --git a/modules/lang/org/contrib/dragndrop.el b/modules/lang/org/contrib/dragndrop.el index 2faf26c00..4b226b032 100644 --- a/modules/lang/org/contrib/dragndrop.el +++ b/modules/lang/org/contrib/dragndrop.el @@ -4,10 +4,12 @@ (def-package! org-download :commands (org-download-dnd org-download-dnd-base64) :init - ;; Add these manually so that org-download is lazy-loaded... - (add-to-list 'dnd-protocol-alist '("^\\(https?\\|ftp\\|file\\|nfs\\):" . +org-dragndrop-download-dnd)) - (add-to-list 'dnd-protocol-alist '("^data:" . org-download-dnd-base64)) - + ;; HACK We add these manually so that org-download is truly lazy-loaded + (appendq! + dnd-protocol-alist + '("^\\(?:https?\\|ftp\\|file\\|nfs\\):" + . +org-dragndrop-download-dnd) + '("^data:" . org-download-dnd-base64)) (advice-add #'org-download-enable :override #'ignore) :config (setq org-download-image-dir org-attach-directory diff --git a/modules/lang/web/autoload/html.el b/modules/lang/web/autoload/html.el index cf205b79d..dbba73e60 100644 --- a/modules/lang/web/autoload/html.el +++ b/modules/lang/web/autoload/html.el @@ -61,13 +61,14 @@ character.") "HTML encode/decode TEXT. Based on Xah's replace HTML named entities function @ http://ergoemacs.org/emacs/elisp_replace_html_entities_command.html" (interactive "") - (seq-doseq (rep +web-entities-list) - (let ((from (elt rep (if decode-p 0 1))) - (to (elt rep (if decode-p 1 0))) - case-fold-search) - (when (and (not (equal from " ")) - (string-match-p (regexp-quote from) text)) - (setq text (replace-regexp-in-string (regexp-quote from) to text t t))))) + (mapc (lambda (rep) + (let ((from (elt rep (if decode-p 0 1))) + (to (elt rep (if decode-p 1 0))) + case-fold-search) + (when (and (not (equal from " ")) + (string-match-p (regexp-quote from) text)) + (setq text (replace-regexp-in-string (regexp-quote from) to text t t))))) + +web-entities-list) text) (defun +web--entities-region (beg end &optional decode-p) @@ -75,14 +76,15 @@ character.") function @ http://ergoemacs.org/emacs/elisp_replace_html_entities_command.html" (save-restriction (narrow-to-region beg end) - (seq-doseq (rep +web-entities-list) - (let ((from (elt rep (if decode-p 0 1))) - (to (elt rep (if decode-p 1 0))) - case-fold-search) - (unless (equal from " ") - (goto-char (point-min)) - (while (search-forward from nil t) - (replace-match to 'FIXEDCASE 'LITERAL))))))) + (mapc (lambda (rep) + (let ((from (elt rep (if decode-p 0 1))) + (to (elt rep (if decode-p 1 0))) + case-fold-search) + (unless (equal from " ") + (goto-char (point-min)) + (while (search-forward from nil t) + (replace-match to 'FIXEDCASE 'LITERAL))))) + +web-entities-list))) ;;;###autoload (defun +web-encode-entities (text) diff --git a/modules/tools/lsp/config.el b/modules/tools/lsp/config.el index 1a048d830..31d0c61b5 100644 --- a/modules/tools/lsp/config.el +++ b/modules/tools/lsp/config.el @@ -5,6 +5,7 @@ lsp-keep-workspace-alive nil lsp-groovy-server-install-dir (concat doom-etc-dir "groovy-langserver/")) + (after! lsp-mode (set-lookup-handlers! 'lsp-mode :async t :documentation 'lsp-describe-thing-at-point diff --git a/modules/tools/magit/config.el b/modules/tools/magit/config.el index e3d1ad860..3a50eee1a 100644 --- a/modules/tools/magit/config.el +++ b/modules/tools/magit/config.el @@ -106,8 +106,10 @@ ensure it is built when we actually use Forge." (def-package! magit-todos :after magit :config - (setq magit-todos-keyword-suffix "\\(?:([^)]+)\\)?:?") + (setq magit-todos-keyword-suffix "\\(?:([^)]+)\\)?:?") ; make colon optional (define-key magit-todos-section-map "j" nil) + ;; Warns that jT isn't bound. Well, yeah, you don't need to tell me, that was + ;; on purpose ya goose. (advice-add #'magit-todos-mode :around #'doom-shut-up-a) (magit-todos-mode +1))