diff --git a/modules/completion/corfu/config.el b/modules/completion/corfu/config.el index f368d1a69..46be4ad0f 100644 --- a/modules/completion/corfu/config.el +++ b/modules/completion/corfu/config.el @@ -56,7 +56,7 @@ TAB/S-TAB.") (corfu-mode +1)))) :config (setq corfu-auto t - corfu-auto-delay 0.18 + corfu-auto-delay 0.24 corfu-auto-prefix 2 global-corfu-modes '((not erc-mode circe-mode diff --git a/modules/editor/evil/init.el b/modules/editor/evil/init.el index 3b754c2d0..3b10badab 100644 --- a/modules/editor/evil/init.el +++ b/modules/editor/evil/init.el @@ -116,6 +116,7 @@ variable for an explanation of the defaults (in comments). See (csv "csv-mode") (custom cus-edit) cus-theme + dape dashboard daemons deadgrep @@ -175,6 +176,7 @@ variable for an explanation of the defaults (in comments). See helpful hg-histedit hungry-delete + hyrolo ibuffer (image image-mode) image-dired diff --git a/modules/editor/evil/packages.el b/modules/editor/evil/packages.el index 4b11e3582..41f09ff0e 100644 --- a/modules/editor/evil/packages.el +++ b/modules/editor/evil/packages.el @@ -1,7 +1,7 @@ ;; -*- no-byte-compile: t; -*- ;;; editor/evil/packages.el -(package! evil :pin "30ebe6df27c36fdf2ea3c82a916edec31acc2647") +(package! evil :pin "5db0bdc7dcd9300b983526d37cbe480f35e36211") (package! evil-args :pin "a8151556f63c9d45d0c44c8a7ef9e5a542f3cdc7") (package! evil-easymotion :pin "f96c2ed38ddc07908db7c3c11bcd6285a3e8c2e9") (package! evil-embrace :pin "3081d37811b6a3dfaaf01d578c7ab7a746c6064d") @@ -35,4 +35,4 @@ (package! neotree) (autoload 'neotree-make-executor "neotree" nil nil 'macro)) - (package! evil-collection :pin "e49d8e96ccc83d2bf7583c124582fc1ef076b15c")) + (package! evil-collection :pin "772571fc6762b6cd1d35cc869e266de9a5c6022b")) diff --git a/modules/editor/format/autoload/format.el b/modules/editor/format/autoload/format.el index 44498cfa2..fe78af107 100644 --- a/modules/editor/format/autoload/format.el +++ b/modules/editor/format/autoload/format.el @@ -68,14 +68,21 @@ (defalias '+format/buffer #'apheleia-format-buffer) ;;;###autoload -(defun +format/region (beg end &optional _arg) +(defun +format/region (beg end &optional _arg interactive) "Format the selected region. WARNING: if the formatter doesn't support partial formatting, this command tries to pretend the active selection is the contents of a standalone file, but this may not always work. Keep your undo keybind handy!" - (interactive "rP") - (+format-region beg end)) + (interactive (list (doom-region-beginning) + (doom-region-end) + current-prefix-arg + 'interactive)) + (+format-region + beg end + (lambda () + (when interactive + (message "Region reformatted!"))))) ;;;###autoload (defun +format/region-or-buffer () diff --git a/modules/editor/format/config.el b/modules/editor/format/config.el index cbd1ea30c..3b011cbee 100644 --- a/modules/editor/format/config.el +++ b/modules/editor/format/config.el @@ -102,5 +102,9 @@ This is controlled by `+format-on-save-disabled-modes'." ".prettierrc.toml") if (locate-dominating-file default-directory file) return t) - (assq 'prettier (+javascript-npm-conf))) + (when-let ((pkg (locate-dominating-file default-directory "package.json"))) + (require 'json) + (let ((json-key-type 'alist)) + (assq 'prettier + (json-read-file (expand-file-name "package.json" pkg)))))) (apheleia-formatters-indent "--use-tabs" "--tab-width")))))))) diff --git a/modules/emacs/dired/config.el b/modules/emacs/dired/config.el index 37cc5a292..c303ec911 100644 --- a/modules/emacs/dired/config.el +++ b/modules/emacs/dired/config.el @@ -143,7 +143,6 @@ Fixes #3939: unsortable dired entries on Windows." :n "F" #'dirvish-layout-toggle :n "z" #'dirvish-history-jump :n "gh" #'dirvish-subtree-up - :n "gl" #'dirvish-subtree-down :m "[h" #'dirvish-history-go-backward :m "]h" #'dirvish-history-go-forward :m "[e" #'dirvish-emerge-next-group @@ -199,18 +198,13 @@ Fixes #3939: unsortable dired entries on Windows." (if (and (file-directory-p (car args)) (eq (car-safe result) 'dired)) `(dired . (,@(butlast (cdr result)) - ,(format "(let ((enable-local-variables nil)) %s)" + ,(format "(let %s %s)" + (prin1-to-string + (mapcar (lambda (env) `(,(car env) ,(cdr env))) + (remove '(inhibit-message . t) dirvish-preview-environment))) (car (last (cdr result)))))) result))) - ;; HACK: Suppress mode hooks when previewing files, as they may contain - ;; expensive or disruptive functionality that isn't needed just for - ;; previewing them. - ;; REVIEW: Upstream this later? - (defadvice! +dired--suppress-hooks-in-previews-a (fn &rest args) - :around #'dirvish--find-file-temporarily - (delay-mode-hooks (apply fn args))) - ;; HACK: Dirvish will complain that pdf-tools is required to preview PDFs, ;; even if the package is installed, so I advise it to try autoloading it ;; before complaining, otherwise complain if epdfinfo hasn't been built yet. @@ -218,8 +212,8 @@ Fixes #3939: unsortable dired entries on Windows." (defadvice! +dired--autoload-pdf-tools-a (fn &rest args) :around #'dirvish-pdf-dp (when (equal (nth 1 args) "pdf") - (require 'pdf-tools nil t) - (if (file-exists-p pdf-info-epdfinfo-program) + (if (and (require 'pdf-tools nil t) + (file-exists-p pdf-info-epdfinfo-program)) (apply fn args) '(info . "`epdfinfo' program required to preview pdfs; run `M-x pdf-tools-install'"))))) diff --git a/modules/emacs/vc/config.el b/modules/emacs/vc/config.el index d0a4f2190..dd2f47c7c 100644 --- a/modules/emacs/vc/config.el +++ b/modules/emacs/vc/config.el @@ -92,6 +92,10 @@ info in the `header-line-format' is a more visible indicator." (propertize sha-or-subject 'face 'git-timemachine-minibuffer-detail-face) date-full date-relative)))) + ;; HACK: `delay-mode-hooks' suppresses font-lock-mode in later versions of + ;; Emacs, so git-timemachine buffers end up unfontified. + (add-hook 'git-timemachine-mode-hook #'font-lock-mode) + (after! evil ;; Rehash evil keybindings so they are recognized (add-hook 'git-timemachine-mode-hook #'evil-normalize-keymaps)) diff --git a/modules/emacs/vc/packages.el b/modules/emacs/vc/packages.el index 6fe091a4f..d471201e1 100644 --- a/modules/emacs/vc/packages.el +++ b/modules/emacs/vc/packages.el @@ -6,7 +6,7 @@ (package! smerge-mode :built-in t) (package! browse-at-remote :pin "76aa27dfd469fcae75ed7031bb73830831aaccbf") -(package! git-commit :pin "55656a31cc4fe6c8996c621f4cf14aa4a1bfe47d") +(package! git-commit :pin "2da34f1317c619ec2dfb9e0d969449261ca7f31f") (package! git-timemachine ;; The original lives on codeberg.org; which has uptime issues. :recipe (:host github :repo "emacsmirror/git-timemachine") diff --git a/modules/tools/biblio/packages.el b/modules/tools/biblio/packages.el index 968c31dac..9c140f415 100644 --- a/modules/tools/biblio/packages.el +++ b/modules/tools/biblio/packages.el @@ -10,7 +10,7 @@ (when (modulep! :completion vertico) (package! citar :pin "07d2a63c99fe35cbd468f8e6a322de05f1a29469") (package! citar-embark :pin "07d2a63c99fe35cbd468f8e6a322de05f1a29469") - (when (modulep! :lang org +roam) + (when (modulep! :lang org +roam2) (package! citar-org-roam :pin "82d47b5df1926627f56a09055c69b49b31cbbb9f"))) (package! parsebib :pin "ace9df707108b17759c004c7387655277122d4c1") diff --git a/modules/tools/magit/packages.el b/modules/tools/magit/packages.el index eae7e87f0..ea1a2db1b 100644 --- a/modules/tools/magit/packages.el +++ b/modules/tools/magit/packages.el @@ -1,9 +1,12 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/magit/packages.el -(package! magit :pin "cf94190410ef163fd102cdbcb67f28599d31eabc") +;; NOTE: Always bump this to HEAD~1, not HEAD, because the latest commit on +;; magit's melpa branch is auto-generated and moved to HEAD every time there's +;; a commit to its main branch. +(package! magit :pin "2da34f1317c619ec2dfb9e0d969449261ca7f31f") (when (modulep! +forge) - (package! forge :pin "a56eb3cbb27c61387d35cbff6b036a2c1bc1559d") + (package! forge :pin "1e7ee99c7f76034e40210a6fd6007015b1998f6d") (package! code-review :recipe (:host github :repo "doomelpa/code-review" diff --git a/modules/ui/vc-gutter/config.el b/modules/ui/vc-gutter/config.el index 342848be7..80b3f2314 100644 --- a/modules/ui/vc-gutter/config.el +++ b/modules/ui/vc-gutter/config.el @@ -77,13 +77,13 @@ Respects `diff-hl-disable-on-remote'." :config (set-popup-rule! "^\\*diff-hl" :select nil :size '+popup-shrink-to-fit) + (setq diff-hl-global-modes '(not image-mode pdf-view-mode)) ;; PERF: A slightly faster algorithm for diffing. (setq vc-git-diff-switches '("--histogram")) ;; PERF: Slightly more conservative delay before updating the diff (setq diff-hl-flydiff-delay 0.5) ; default: 0.3 ;; PERF: don't block Emacs when updating vc gutter (setq diff-hl-update-async t) - ;; UX: get realtime feedback in diffs after staging/unstaging hunks. (setq diff-hl-show-staged-changes nil) @@ -140,4 +140,56 @@ Respects `diff-hl-disable-on-remote'." :around #'diff-hl-revert-hunk (let ((pt (point))) (prog1 (apply fn args) - (goto-char pt))))) + (goto-char pt)))) + + ;; FIX: `global-diff-hl-mode' enables `diff-hl-mode' *everywhere*, which calls + ;; `diff-hl-update'. If `diff-hl-update-async' is non-nil, this means a new + ;; thread is spawned for *every* buffer, whether they're visible or not. Not + ;; only can this slow a lot down, but `kill-buffer' will silently refuse to + ;; kill buffers with a thread associated with it. Chaos ensues (see #7991 + ;; and #7954). + ;; REVIEW: Report this upstream. + (defun +vc-gutter--kill-thread (&optional block?) + (when-let ((th +vc-gutter--diff-hl-thread)) + (when (thread-live-p th) + (thread-signal th 'quit nil) + (when block? + (condition-case _ + (thread-join th) + ((quit error) nil)))))) + + (defvar-local +vc-gutter--diff-hl-thread nil) + (defadvice! +vc-gutter--debounce-threads-a (&rest _) + :override #'diff-hl-update + (unless (or inhibit-redisplay + non-essential + delay-mode-hooks + (null (buffer-file-name (buffer-base-buffer))) + (null (get-buffer-window (current-buffer)))) + (if (and diff-hl-update-async + (not + (run-hook-with-args-until-success 'diff-hl-async-inhibit-functions + default-directory))) + (progn + (+vc-gutter--kill-thread) + (setq +vc-gutter--diff-hl-thread + (make-thread (lambda () + (unwind-protect + (diff-hl--update-safe) + (setq +vc-gutter--diff-hl-thread nil))) + "diff-hl--update-safe"))) + (diff-hl--update)) + t)) + + (defadvice! +vc-gutter--only-tick-on-success-a (&rest _) + :override #'diff-hl-update-once + (unless (equal diff-hl--modified-tick (buffer-chars-modified-tick)) + (when (diff-hl-update) + (setq diff-hl--modified-tick (buffer-chars-modified-tick))))) + + ;; HACK: This advice won't work in *all* cases (it's a C function, and any + ;; calls to it from C won't trigger advice), but the thread issues above are + ;; triggered from Elisp's buffer API (from what I can tell). + (defadvice! +vc-gutter--kill-diff-hl-thread-a (buf) + :before #'kill-buffer + (with-current-buffer buf (+vc-gutter--kill-thread t))))