diff --git a/lisp/doom-cli.el b/lisp/doom-cli.el index cef7faab0..cf32f6505 100644 --- a/lisp/doom-cli.el +++ b/lisp/doom-cli.el @@ -23,8 +23,11 @@ doom-cache-dir doom-state-dir)) - ;; HACK: Load `cl' and site files manually to prevent polluting logs and - ;; stdout with deprecation and/or file load messages. + ;; HACK: bin/doom invokes Emacs with --no-site-lisp solely to allow us to load + ;; site-start manually, here, to suppress any output it produces, and they + ;; almost always produce some. This causes premature redraws of the Emacs + ;; frame during startup (to display those messages in the minibuffer), which + ;; -- as I mention in the comments of doom.el -- really hurts startup time. (quiet! (require 'cl nil t) (unless site-run-file diff --git a/lisp/doom-ui.el b/lisp/doom-ui.el index 6f4aa5eee..fa3bb02e9 100644 --- a/lisp/doom-ui.el +++ b/lisp/doom-ui.el @@ -212,7 +212,8 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original (cond ((eq buf (doom-fallback-buffer)) (message "Can't kill the fallback buffer.") t) - ((doom-real-buffer-p buf) + ((and (doom-real-buffer-p buf) + (run-hook-with-args-until-failure 'kill-buffer-query-functions)) (let ((visible-p (delq (selected-window) (get-buffer-window-list buf nil t)))) (unless visible-p (when (and (buffer-modified-p buf) @@ -221,8 +222,10 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original buf)))) (user-error "Aborted"))) (let ((inhibit-redisplay t) - buffer-list-update-hook) - (when (or ;; if there aren't more real buffers than visible buffers, + buffer-list-update-hook + kill-buffer-query-functions) + (when (or + ;; if there aren't more real buffers than visible buffers, ;; then there are no real, non-visible buffers left. (not (cl-set-difference (doom-real-buffer-list) (doom-visible-buffers nil t))) diff --git a/lisp/lib/themes.el b/lisp/lib/themes.el index 262db832f..8d681162b 100644 --- a/lisp/lib/themes.el +++ b/lisp/lib/themes.el @@ -3,14 +3,19 @@ ;;;###autoload (defconst doom-customize-theme-hook nil) +;;;###autoload +(defun doom--run-customize-theme-hook (fn) + "Run FN, but suppress any writes to `custom-file'." + (letf! (defun put (symbol prop value) + (unless (string-prefix-p "saved-" (symbol-name prop)) + (funcall put symbol prop value))) + (let (custom--inhibit-theme-enable) + (funcall fn)))) + (add-hook! 'doom-load-theme-hook (defun doom-apply-customized-faces-h () "Run `doom-customize-theme-hook'." - (letf! ((#'custom--should-apply-setting #'ignore) - (defun custom-push-theme (prop symbol theme mode &optional value) - (funcall custom-push-theme prop symbol theme mode value) - (if (facep symbol) (face-spec-set symbol value t)))) - (run-hooks 'doom-customize-theme-hook)))) + (run-hook-wrapped 'doom-customize-theme-hook #'doom--run-customize-theme-hook))) (defun doom--normalize-face-spec (spec) (cond ((listp (car spec)) @@ -42,7 +47,7 @@ all themes. It will apply to all themes once they are loaded." ;; macros on the fly and customize your faces iteratively. (when (or (get 'doom-theme 'previous-themes) (null doom-theme)) - (funcall #',fn)) + (doom--run-customize-theme-hook #',fn)) ;; FIXME Prevent clobbering this on-the-fly (add-hook 'doom-customize-theme-hook #',fn 100)))) diff --git a/lisp/packages.el b/lisp/packages.el index 92e54effb..571c86984 100644 --- a/lisp/packages.el +++ b/lisp/packages.el @@ -6,7 +6,7 @@ :pin "17cfa1b54800fdef2975c0c0531dad34846a5065") (package! compat :recipe (:host github :repo "emacs-compat/compat") - :pin "80dbd9bc5efee05a479663f8cfd0cc9e0a30dac5") + :pin "09dce8a193c5a70277512263782b82fa1cba84c0") (package! gcmh :pin "0089f9c3a6d4e9a310d0791cf6fa8f35642ecfd9") @@ -29,15 +29,15 @@ ;; doom-editor.el (package! better-jumper :pin "47622213783ece37d5337dc28d33b530540fc319") -(package! dtrt-indent :pin "939c5e374ac0175bb7d561542e22e47a72d04aa8") +(package! dtrt-indent :pin "339755e4fb5245862737babf7f2c1e3bae1c129c") (package! helpful :pin "4ba24cac9fb14d5fdc32582cd947572040e82b2c") -(package! smartparens :pin "f7cf316715e5018186c226aab8242c9e5ce131c8") +(package! smartparens :pin "ab475c78916d7b1666a495e3fe9c54b250195637") (package! ws-butler :pin "e3a38d93e01014cd47bf5af4924459bd145fd7c4") ;; doom-projects.el (package! projectile :pin "0163b335a18af0f077a474d4dc6b36e22b5e3274") -(package! project :pin "bf4c3cfcfbf3423d79170aa880a1abb332ed942e") +(package! project :pin "093f42a1b612eaae0d2bdd475663c14973fe0325") ;; doom-keybinds.el (package! general :pin "826bf2b97a0fb4a34c5eb96ec2b172d682fd548f") -(package! which-key :pin "ed389312170df955aaf10c2e120cc533ed5c509e") +(package! which-key :pin "38d4308d1143b61e4004b6e7a940686784e51500") diff --git a/modules/checkers/syntax/README.org b/modules/checkers/syntax/README.org index 80857885a..e2a3ff211 100644 --- a/modules/checkers/syntax/README.org +++ b/modules/checkers/syntax/README.org @@ -16,6 +16,8 @@ This module provides syntax checking and error highlighting, powered by *Requires GUI Emacs.* - +flymake :: Leverages the inbuilt [[doom-package:flymake]] for error and diagnostics highlighting. +- +icons :: Use unicode icons rather than ASCII prefixes in error tooltips or + childframes. ** Packages - [[doom-package:flycheck]] diff --git a/modules/checkers/syntax/config.el b/modules/checkers/syntax/config.el index 5108ba7ee..370c76c6d 100644 --- a/modules/checkers/syntax/config.el +++ b/modules/checkers/syntax/config.el @@ -50,7 +50,7 @@ :commands flycheck-popup-tip-show-popup flycheck-popup-tip-delete-popup :hook (flycheck-mode . +syntax-init-popups-h) :config - (setq flycheck-popup-tip-error-prefix "X ") + (setq flycheck-popup-tip-error-prefix (if (modulep! +icons) "⚠ " "[!] ")) ;; HACK: Only display the flycheck popup if we're in normal mode (for evil ;; users) or if no selection or completion is active. This popup can @@ -71,9 +71,13 @@ :unless (modulep! +flymake) :hook (flycheck-mode . +syntax-init-popups-h) :config - (setq flycheck-posframe-warning-prefix "! " - flycheck-posframe-info-prefix "··· " - flycheck-posframe-error-prefix "X ") + (if (modulep! +icons) + (setq flycheck-posframe-warning-prefix "⚠ " + flycheck-posframe-info-prefix "ⓘ " + flycheck-posframe-error-prefix "⚠ ") + (setq flycheck-posframe-warning-prefix "[?] " + flycheck-posframe-info-prefix "[i] " + flycheck-posframe-error-prefix "[!] ")) ;; HACK: Hide the flycheck posframe immediately on the next keypress/user ;; action, otherwise it lingers until the next time the user is idle. diff --git a/modules/lang/cc/README.org b/modules/lang/cc/README.org index bf4d3eac7..158b3fef8 100644 --- a/modules/lang/cc/README.org +++ b/modules/lang/cc/README.org @@ -35,7 +35,7 @@ This module adds support for the C-family of languages: C, C++, and Objective-C. - [[doom-package:demangle-mode]] - [[doom-package:disaster]] - [[doom-package:glsl-mode]] -- [[doom-package:modern-cpp-font-lock]] +- [[doom-package:modern-cpp-font-lock]] unless [[doom-module:+tree-sitter]] - [[doom-package:opencl-mode]] - if [[doom-module:+lsp]] - [[doom-package:ccls]] if [[doom-module::tools lsp -eglot]] diff --git a/modules/lang/cc/config.el b/modules/lang/cc/config.el index c4b0ce5ad..dbccd6d8a 100644 --- a/modules/lang/cc/config.el +++ b/modules/lang/cc/config.el @@ -135,6 +135,7 @@ This is ignored by ccls.") (use-package! modern-cpp-font-lock + :unless (modulep! +tree-sitter) :hook (c++-mode . modern-c++-font-lock-mode)) diff --git a/modules/lang/cc/packages.el b/modules/lang/cc/packages.el index fd86fe895..edd29fec0 100644 --- a/modules/lang/cc/packages.el +++ b/modules/lang/cc/packages.el @@ -7,7 +7,8 @@ (package! cuda-mode :pin "7f593518fd135fc6af994024bcb47986dfa502d2") (package! demangle-mode :pin "04f545adab066708d6151f13da65aaf519f8ac4e") (package! disaster :pin "16bba9afb92aacf06c088c29ba47813b65a80d87") -(package! modern-cpp-font-lock :pin "43c6b68ff58fccdf9deef11674a172e4eaa8455c") +(unless (modulep! +tree-sitter) + (package! modern-cpp-font-lock :pin "43c6b68ff58fccdf9deef11674a172e4eaa8455c")) (package! opencl-mode :pin "10ae7742d57ae79d96cf52753800b3490589b3f6") (when (package! glsl-mode :pin "9b2e5f28e489a1f73c4aed734105618ac0dc0c43") diff --git a/modules/lang/latex/packages.el b/modules/lang/latex/packages.el index 26d7b48fb..c511c81bb 100644 --- a/modules/lang/latex/packages.el +++ b/modules/lang/latex/packages.el @@ -3,41 +3,9 @@ (package! auctex :recipe (:files ("*.el" "*.info" "dir" - "doc" "etc" "images" "latex" "style") - ;; HACK: Auctex has a post-install step that generates tex-site.el - ;; and *.texi documentation files, which largely assumes the user - ;; is on a Linux system with various shell tools like sed, gnu - ;; make, tex, etc. -- an assumption I can't safely make about - ;; Doom's users, so reinvent its 'make tex-site.el' task in elisp: - :pre-build - (with-temp-file "tex-site.el" - (insert-file-contents "tex-site.el.in") - (while (re-search-forward "@\\(\\(?:AUCTEX\\|lisp\\)[^@]+\\)@" nil t) - (pcase (match-string 1) - ("AUCTEXVERSION" - (replace-match (with-temp-buffer - (insert-file-contents "auctex.el" nil 0 1024) - (save-match-data - (if (re-search-forward "^;; Version: \\([^\n-]+\\)" nil t) - (match-string-no-properties 1) - "Unknown"))) - t t)) - ("AUCTEXDATE" - (when-let* ((time (cdr (doom-call-process "git" "log" "-n1" "--pretty=tformat:%ct"))) - (time (string-to-number time))) - (replace-match (format-time-string "%Y-%m-%d %T" time) t t))) - ("lispautodir" - (replace-match - (prin1-to-string - `(if (file-writable-p "/usr/local/var/auctex") - "/usr/local/var/auctex" - ,(file-name-concat doom-data-dir "auctex"))) - t t)) - ((or "lisppackagedatadir" "lisppackagelispdir") - (replace-match "(directory-file-name (file-name-directory load-file-name))" t t)) - (it (error "Unknown substitution variable in tex-site.el.in: %s" it)))))) - :pin "764a53c8e93150f0edd169593a4d453810792abe") -(package! adaptive-wrap :pin "dea4e32c18d285a6ca9f72b1eadd61e27a555ed3") + "doc" "etc" "images" "latex" "style")) + :pin "451b0f08b04d66ff4ffd2a5fac4ee646730c0720") +(package! adaptive-wrap :pin "f5bc153273f4c3cd03966dbf568dd921b01323ec") (package! latex-preview-pane :pin "5297668a89996b50b2b62f99cba01cc544dbed2e") (when (modulep! :editor evil +everywhere) (package! evil-tex :pin "2a3177c818f106e6c11032ac261f8691f5e11f74")) diff --git a/modules/lang/markdown/config.el b/modules/lang/markdown/config.el index 63d5bd0f0..450341a70 100644 --- a/modules/lang/markdown/config.el +++ b/modules/lang/markdown/config.el @@ -67,9 +67,9 @@ capture, the end position, and the output buffer.") fill-nobreak-predicate (cons #'markdown-code-block-at-point-p fill-nobreak-predicate)) - ;; HACK Prevent mis-fontification of YAML metadata blocks in `markdown-mode' - ;; which occurs when the first line contains a colon in it. See - ;; jrblevin/markdown-mode#328. + ;; HACK: Prevent mis-fontification of YAML metadata blocks in `markdown-mode' + ;; which occurs when the first line contains a colon in it. See + ;; jrblevin/markdown-mode#328. (defadvice! +markdown-disable-front-matter-fontification-a (&rest _) :override #'markdown-match-generic-metadata (ignore (goto-char (point-max)))) diff --git a/modules/lang/markdown/doctor.el b/modules/lang/markdown/doctor.el index 6d7fe28ff..6a2d39231 100644 --- a/modules/lang/markdown/doctor.el +++ b/modules/lang/markdown/doctor.el @@ -4,9 +4,9 @@ (when (require 'markdown-mode nil t) (cond ((eq markdown-command #'+markdown-compile) (unless (cl-loop for (exe . cmd) in (list (cons "marked" '+markdown-compile-marked) - (cons "pandoc" '+markdown-compile-pandoc) - (cons "markdown" '+markdown-compile-markdown) - (cons "multimarkdown" '+markdown-compile-multimarkdown)) + (cons "pandoc" '+markdown-compile-pandoc) + (cons "markdown" '+markdown-compile-markdown) + (cons "multimarkdown" '+markdown-compile-multimarkdown)) if (and (memq cmd +markdown-compile-functions) (executable-find exe)) return t) diff --git a/modules/lang/markdown/packages.el b/modules/lang/markdown/packages.el index e2a16ddda..347df40cc 100644 --- a/modules/lang/markdown/packages.el +++ b/modules/lang/markdown/packages.el @@ -3,6 +3,9 @@ (package! markdown-mode :pin "8aab017f4790f7a1e0d8403239cce989c88412f6") (package! markdown-toc :pin "3d724e518a897343b5ede0b976d6fb46c46bcc01") + +;; Required by `markdown-mode', or it will install it via package.el if it isn't +;; present when you call `markdown-edit-code-block'. (package! edit-indirect :pin "82a28d8a85277cfe453af464603ea330eae41c05") (when (modulep! +grip) diff --git a/modules/lang/org/autoload/org-link.el b/modules/lang/org/autoload/org-link.el index ff29cac19..3ab615248 100644 --- a/modules/lang/org/autoload/org-link.el +++ b/modules/lang/org/autoload/org-link.el @@ -411,6 +411,15 @@ exist, and `org-link' otherwise." (delete-region (match-beginning 0) (match-end 0)) (insert label)))) +;;;###autoload +(defun +org/yank-link () + "Copy the url at point to the clipboard. +If on top of an Org link, will only copy the link component." + (interactive) + (let ((url (thing-at-point 'url))) + (kill-new (or url (user-error "No URL at point"))) + (message "Copied link: %s" url))) + ;;;###autoload (defun +org/play-gif-at-point () "TODO" diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 8e2fe5550..9b25796ee 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -814,7 +814,8 @@ via an indirect buffer." buf))) (defadvice! +org--fix-inconsistent-uuidgen-case-a (uuid) - "Ensure uuidgen is always lowercase (consistent) regardless of system." + "Ensure uuidgen is always lowercase (consistent) regardless of system. +See https://lists.gnu.org/archive/html/emacs-orgmode/2019-07/msg00081.html." :filter-return #'org-id-new (if (eq org-id-method 'uuid) (downcase uuid) @@ -988,6 +989,7 @@ between the two." "s" #'org-store-link "S" #'org-insert-last-stored-link "t" #'org-toggle-link-display + "y" #'+org/yank-link (:when (modulep! :os macos) "g" #'org-mac-link-get-link)) (:prefix ("P" . "publish") @@ -1125,6 +1127,15 @@ between the two." :hook (org-mode . org-eldoc-load) :init (setq org-eldoc-breadcrumb-separator " → ") :config + (defadvice! +org-eldoc--display-link-at-point-a (&rest _) + "Display help for doom-*: links in minibuffer when cursor/mouse is over it." + :before-until #'org-eldoc-documentation-function + (if-let ((url (thing-at-point 'url t))) + (format "LINK: %s" url) + (and (eq (get-text-property (point) 'help-echo) + #'+org-link-doom--help-echo-from-textprop) + (+org-link-doom--help-echo-from-textprop nil (current-buffer) (point))))) + ;; HACK Fix #2972: infinite recursion when eldoc kicks in 'org' or 'python' ;; src blocks. ;; TODO Should be reported upstream! diff --git a/modules/tools/ansible/config.el b/modules/tools/ansible/config.el index e107185d8..f7577a687 100644 --- a/modules/tools/ansible/config.el +++ b/modules/tools/ansible/config.el @@ -31,5 +31,5 @@ (def-project-mode! +ansible-yaml-mode :modes '(yaml-mode) - :add-hooks '(ansible ansible-auto-decrypt-encrypt ansible-doc-mode) + :add-hooks '(ansible-mode ansible-auto-decrypt-encrypt ansible-doc-mode) :files (or "roles/" "tasks/main.yml" "tasks/main.yaml")) diff --git a/modules/tools/lsp/packages.el b/modules/tools/lsp/packages.el index 2ee5cef08..41a428e52 100644 --- a/modules/tools/lsp/packages.el +++ b/modules/tools/lsp/packages.el @@ -3,13 +3,13 @@ (if (modulep! +eglot) (progn - (package! eglot :pin "850cbd043084d7cc571e1090a4812db6e3f7d0bc") + (package! eglot :pin "8008255edd74d8bda75e01ed747c2460e28404ac") (when (modulep! :completion vertico) (package! consult-eglot :pin "64262e72452f8fe6dd49d31bcdd4bd577b7d682d")) (when (and (modulep! :checkers syntax) (not (modulep! :checkers syntax +flymake))) - (package! flycheck-eglot :pin "114e1315aaf0dc3196da67da426bbe2b46384fe2"))) - (package! lsp-mode :pin "cec9e56390e90d7ced3b18a922ab954e782b8628") + (package! flycheck-eglot :pin "09e37f4c726d9b565b040ba9e89215158d3bd6b6"))) + (package! lsp-mode :pin "52987755175042b9569e32d72ae29eba119020d6") (package! lsp-ui :pin "00f1fecdfb41c30428734cf27e492f26f46627fb") (when (modulep! :completion ivy) (package! lsp-ivy :pin "9ecf4dd9b1207109802bd1882aa621eb1c385106")) diff --git a/modules/tools/tree-sitter/packages.el b/modules/tools/tree-sitter/packages.el index 89e55187c..3c740c8b5 100644 --- a/modules/tools/tree-sitter/packages.el +++ b/modules/tools/tree-sitter/packages.el @@ -2,7 +2,7 @@ ;;; tools/tree-sitter/packages.el (package! tree-sitter :recipe (:branch "master") :pin "02fe7b86d92b1aab954045146469b7893f0ab371") -(package! tree-sitter-langs :pin "a06804e13fc1d24d0099b44ce23d6ac5e6bac5b8") +(package! tree-sitter-langs :pin "b2739d07fadf45520a25862342a1790cd905cff9") (package! tree-sitter-indent :pin "4ef246db3e4ff99f672fe5e4b416c890f885c09e") (when (modulep! :editor evil +everywhere) diff --git a/modules/ui/vc-gutter/config.el b/modules/ui/vc-gutter/config.el index f88ff4567..ab5398d73 100644 --- a/modules/ui/vc-gutter/config.el +++ b/modules/ui/vc-gutter/config.el @@ -104,6 +104,16 @@ (add-hook 'magit-pre-refresh-hook #'diff-hl-magit-pre-refresh) (add-hook 'magit-post-refresh-hook #'diff-hl-magit-post-refresh)) + ;; FIX: Fixes dgutov/diff-hl#213, where `diff-hl-update-async' stops + ;; with-editor (and by extension, Magit COMMIT_EDITMSG buffers) buffers from + ;; getting properly cleaned up. + (defadvice! +vc-gutter--inhibit-async-update-in-with-editor-a (fn &rest args) + :around #'diff-hl-update + (let ((diff-hl-update-async + (unless (bound-and-true-p with-editor-mode) + diff-hl-update-async))) + (apply fn args))) + ;; FIX: The revert popup consumes 50% of the frame, whether or not you're ;; reverting 2 lines or 20. This resizes the popup to match its contents. (defadvice! +vc-gutter--shrink-popup-a (fn &rest args)