From 90070c639a1549a781720d97411be8b6d6eafdfe Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 26 Mar 2024 10:11:34 -0400 Subject: [PATCH 01/17] fix(workspaces): remove ivy integration Due to upstream changes in ivy-rich, +workspace/switch-to throws a `wrong-type-argument listp leaf` error. As I plan to phase out Ivy support (and the Ivy module) in the long term, I'll simply remove ivy (and ivy-rich) integration in the workspaces module, rather than update it. Fix: #7499 Fix: #7173 --- modules/ui/workspaces/autoload/ivy.el | 17 ----------------- modules/ui/workspaces/autoload/workspaces.el | 7 +------ modules/ui/workspaces/config.el | 7 ------- 3 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 modules/ui/workspaces/autoload/ivy.el diff --git a/modules/ui/workspaces/autoload/ivy.el b/modules/ui/workspaces/autoload/ivy.el deleted file mode 100644 index 97b84baf4..000000000 --- a/modules/ui/workspaces/autoload/ivy.el +++ /dev/null @@ -1,17 +0,0 @@ -;;; ui/workspaces/autoload/ivy.el -*- lexical-binding: t; -*- -;;;###if (modulep! :completion ivy) - -;;;###autoload -(defun +workspace--ivy-rich-preview (workspace) - (if-let (buffers (when-let (workspace (gethash workspace *persp-hash*)) - (cl-loop for (type . rest) in (persp-window-conf workspace) - if (eq type 'buffer) - collect (car leaf) - else if (eq type 'leaf) - append (cl-loop for (type . leaf) in rest - if (eq type 'buffer) - collect (car leaf))))) - (string-join buffers " ") - "*No buffers*")) - -;;; ivy.el ends here diff --git a/modules/ui/workspaces/autoload/workspaces.el b/modules/ui/workspaces/autoload/workspaces.el index 840ca1d5c..4cca0c7a8 100644 --- a/modules/ui/workspaces/autoload/workspaces.el +++ b/modules/ui/workspaces/autoload/workspaces.el @@ -318,12 +318,7 @@ workspace, otherwise the new workspace is blank." end of the workspace list." (interactive (list (or current-prefix-arg - (if (modulep! :completion ivy) - (ivy-read "Switch to workspace: " - (+workspace-list-names) - :caller #'+workspace/switch-to - :preselect (+workspace-current-name)) - (completing-read "Switch to workspace: " (+workspace-list-names)))))) + (completing-read "Switch to workspace: " (+workspace-list-names))))) (when (and (stringp index) (string-match-p "^[0-9]+$" index)) (setq index (string-to-number index))) diff --git a/modules/ui/workspaces/config.el b/modules/ui/workspaces/config.el index 68c5d9221..0fb223bf2 100644 --- a/modules/ui/workspaces/config.el +++ b/modules/ui/workspaces/config.el @@ -206,13 +206,6 @@ stored in `persp-save-dir'.") ("xt" counsel-projectile-switch-project-action-run-term "invoke term from project root") ("X" counsel-projectile-switch-project-action-org-capture "org-capture into project"))) - (when (modulep! :completion ivy) - (after! ivy-rich - (cl-callf plist-put ivy-rich-display-transformers-list - '+workspace/switch-to - '(:columns ((ivy-rich-candidate (:width 50)) - (+workspace--ivy-rich-preview)))))) - (when (modulep! :completion helm) (after! helm-projectile (setcar helm-source-projectile-projects-actions From 639fcc6a2e4dd3df9effef2da7b9d605aaf72214 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 26 Mar 2024 10:29:07 -0400 Subject: [PATCH 02/17] tweak(emacs-lisp): remove pin truncation This removes the truncation of `package!` `:pin`s. This was originally intended to make packages.el files easier to skim, but in hindsight it didn't really. It served little other purpose but to make it harder for folks to interact with the :pin string. --- modules/lang/emacs-lisp/autoload.el | 14 -------------- modules/lang/emacs-lisp/config.el | 2 -- 2 files changed, 16 deletions(-) diff --git a/modules/lang/emacs-lisp/autoload.el b/modules/lang/emacs-lisp/autoload.el index d2092fa9c..2fcd75a23 100644 --- a/modules/lang/emacs-lisp/autoload.el +++ b/modules/lang/emacs-lisp/autoload.el @@ -413,20 +413,6 @@ This generally applies to your private config (`doom-user-dir') or Doom's source ;; ;;; Fontification -;;;###autoload -(defun +emacs-lisp-truncate-pin () - "Truncates long SHA1 hashes in `package!' :pin's." - (save-excursion - (goto-char (match-beginning 0)) - (and (stringp (plist-get (sexp-at-point) :pin)) - (search-forward ":pin" nil t) - (let ((start (re-search-forward "\"[^\"\n]\\{12\\}" nil t)) - (finish (and (re-search-forward "\"" (line-end-position) t) - (match-beginning 0)))) - (when (and start finish) - (put-text-property start finish 'display "..."))))) - nil) - (defvar +emacs-lisp--face nil) ;;;###autoload (defun +emacs-lisp-highlight-vars-and-faces (end) diff --git a/modules/lang/emacs-lisp/config.el b/modules/lang/emacs-lisp/config.el index 389589689..4a7b532f8 100644 --- a/modules/lang/emacs-lisp/config.el +++ b/modules/lang/emacs-lisp/config.el @@ -115,8 +115,6 @@ See `+emacs-lisp-non-package-mode' for details.") 'emacs-lisp-mode (append `(;; custom Doom cookies ("^;;;###\\(autodef\\|if\\|package\\)[ \n]" (1 font-lock-warning-face t))) - ;; Shorten the :pin of `package!' statements to 10 characters - `(("(package!\\_>" (0 (+emacs-lisp-truncate-pin)))) ;; highlight defined, special variables & functions (when +emacs-lisp-enable-extra-fontification `((+emacs-lisp-highlight-vars-and-faces . +emacs-lisp--face))))) From 7acfb0c77cde54dd2cc6a5962735518fed1f43e3 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 26 Mar 2024 10:39:24 -0400 Subject: [PATCH 03/17] nit: minor comment reformatting & revision --- bin/doom | 6 +++--- modules/app/everywhere/config.el | 2 +- modules/lang/nix/config.el | 2 -- modules/ui/ligatures/config.el | 5 +++-- modules/ui/treemacs/config.el | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/bin/doom b/bin/doom index 8104260a8..32504f224 100755 --- a/bin/doom +++ b/bin/doom @@ -89,9 +89,9 @@ (user-error (message "Error: %s" (cadr e)) (kill-emacs 2))) -;; UX: Abort if the user is using 'doom' as root, unless ~/.config/emacs is -;; owned by root, in which case we assume the user genuinely wants root to be -;; their primary user account for Emacs. +;; UX: Abort if the user is using 'doom' as root, unless $EMACSDIR is owned by +;; root, in which case we can safely assume the user genuinely wants root to +;; be their primary user account for this session. (when (equal 0 (user-real-uid)) (unless (equal 0 (file-attribute-user-id (file-attributes doom-emacs-dir))) (message diff --git a/modules/app/everywhere/config.el b/modules/app/everywhere/config.el index 9f5052784..4e235b7af 100644 --- a/modules/app/everywhere/config.el +++ b/modules/app/everywhere/config.el @@ -8,7 +8,7 @@ :config (set-yas-minor-mode! 'emacs-everywhere-mode) - ;; HACK Inhibit MAJOR-MODE-local-vars-hook in emacs-everywhere buffers, + ;; HACK: Inhibit MAJOR-MODE-local-vars-hook in emacs-everywhere buffers, ;; because Doom commonly starts servers and other extraneous services on ;; this hook, which will rarely work well in emacs-everywhere's temporary ;; buffers anyway. diff --git a/modules/lang/nix/config.el b/modules/lang/nix/config.el index 5e6677220..10bfb1731 100644 --- a/modules/lang/nix/config.el +++ b/modules/lang/nix/config.el @@ -11,8 +11,6 @@ :interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode) :mode "\\.nix\\'" :init - ;; Treat flake.lock files as json. Fall back to js-mode because it's faster - ;; than js2-mode, and its extra features aren't needed there. (add-to-list 'auto-mode-alist (cons "/flake\\.lock\\'" (if (modulep! :lang json) diff --git a/modules/ui/ligatures/config.el b/modules/ui/ligatures/config.el index 6312493ba..9578be7da 100644 --- a/modules/ui/ligatures/config.el +++ b/modules/ui/ligatures/config.el @@ -161,8 +161,9 @@ and cannot run in." (fboundp 'mac-auto-operator-composition-mode)) (add-hook 'doom-init-ui-hook #'mac-auto-operator-composition-mode 'append)) - ;; NOTE: the module does not support Emacs 27 and less, but if we still try to enable ligatures, - ;; it will end up in catastrophic work-loss errors, so we leave the check here for safety. + ;; This module does not support Emacs 27 and less, but if we still try to + ;; enable ligatures, it will end up in catastrophic work-loss errors, so we + ;; leave the check here for safety. ((and (> emacs-major-version 27) (or (featurep 'ns) (string-match-p "HARFBUZZ" system-configuration-features)) diff --git a/modules/ui/treemacs/config.el b/modules/ui/treemacs/config.el index d232ec1b0..62e3e6ddb 100644 --- a/modules/ui/treemacs/config.el +++ b/modules/ui/treemacs/config.el @@ -26,7 +26,7 @@ This must be set before `treemacs' has loaded.") treemacs-persist-file (concat doom-cache-dir "treemacs-persist") treemacs-last-error-persist-file (concat doom-cache-dir "treemacs-last-error-persist")) :config - ;; Don't follow the cursor + ;; Don't follow the cursor (it's more disruptive/jarring than helpful as a default) (treemacs-follow-mode -1) (set-popup-rule! "^ ?\\*Treemacs" :ignore t) From 45fd893074f608cc1e40443345ce1a93010aeff8 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 26 Mar 2024 10:39:59 -0400 Subject: [PATCH 04/17] refactor(ligatures): test for harfbuzz feature A `harfbuzz` feature was introduced in 3e81655. Ref: 3e81655b0e49 --- modules/ui/ligatures/config.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ui/ligatures/config.el b/modules/ui/ligatures/config.el index 9578be7da..ad8baab5e 100644 --- a/modules/ui/ligatures/config.el +++ b/modules/ui/ligatures/config.el @@ -166,8 +166,8 @@ and cannot run in." ;; leave the check here for safety. ((and (> emacs-major-version 27) (or (featurep 'ns) - (string-match-p "HARFBUZZ" system-configuration-features)) - (featurep 'composite)) ; Emacs loads `composite' at startup + (featurep 'harfbuzz)) + (featurep 'composite)) ; Emacs loads `composite' at startup (use-package! ligature :config From d256b597f2c6768e759ac2b866b110ba580c6f9f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 26 Mar 2024 12:07:51 -0400 Subject: [PATCH 05/17] bump: :tools magit alphapapa/magit-todos@1e9acc0ba63f -> alphapapa/magit-todos@332ce763f733 magit/forge@68771ca4d53c -> magit/forge@2a3b41eb6235 magit/magit@0963697f24cf -> magit/magit@0e8f25a8d801 --- modules/tools/magit/packages.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/tools/magit/packages.el b/modules/tools/magit/packages.el index 7bebc3a57..c48e55650 100644 --- a/modules/tools/magit/packages.el +++ b/modules/tools/magit/packages.el @@ -1,12 +1,12 @@ ;; -*- no-byte-compile: t; -*- ;;; tools/magit/packages.el -(when (package! magit :pin "0963697f24cfbe80f92312044bd9ab28b914b053") +(when (package! magit :pin "0e8f25a8d8011328f2bf082232c720b24c2a12c2") (when (modulep! +forge) - (package! forge :pin "68771ca4d53c3aea5c860eeb888cee8e9cb5ca37") + (package! forge :pin "2a3b41eb6235b3f39c017c1f86b3928a45c5a64d") (package! code-review :recipe (:host github :repo "doomelpa/code-review" :files ("graphql" "code-review*.el")) :pin "e4c34fa284da25d8e0bafbae4300f1db5bdcda44")) - (package! magit-todos :pin "1e9acc0ba63fbc297001bf334d63cb4326be80df")) + (package! magit-todos :pin "332ce763f7336ea356964b92723678aa1ed4640f")) From 12a765c5099c4aab8165d1ee944b71f105e42fe1 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 26 Mar 2024 21:33:00 -0400 Subject: [PATCH 06/17] feat(cli): doom sync: change -B to suppress rebuilding Prior to this, -B would suppress the prompt for package rebuilding if your Emacs version or hostname changed. Now, it fully inhibits rebuilding in either case. Fix: #7760 Ref: cff091982e41 --- lisp/cli/sync.el | 23 +++++++++++++---------- lisp/cli/upgrade.el | 3 ++- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lisp/cli/sync.el b/lisp/cli/sync.el index f74a97923..54fbf0117 100644 --- a/lisp/cli/sync.el +++ b/lisp/cli/sync.el @@ -26,8 +26,8 @@ (noupdate? ("-U") "Don't update any packages") (purge? ("--gc") "Purge orphaned package repos & regraft them") (jobs ("-j" "--jobs" num) "How many threads to use for native compilation") - (rebuild? ("-b" "--rebuild") "Rebuild, compile, & symlink installed packages") - (auto? ("-B") "Rebuild packages, but only if necessary") + (rebuild? ("-b" "--rebuild") "Rebuild all installed packages, unconditionally") + (nobuild? ("-B") "Don't rebuild packages when hostname or Emacs version has changed") &context context) "Synchronize your config with Doom Emacs. @@ -52,8 +52,6 @@ OPTIONS: :benchmark t (when (doom-profiles-bootloadable-p) (call! '(profiles sync "--reload"))) - (when (doom-cli-context-suppress-prompts-p context) - (setq auto? t)) (when jobs (setq native-comp-async-jobs-number (truncate jobs))) (run-hooks 'doom-before-sync-hook) @@ -75,11 +73,14 @@ OPTIONS: (when (and old-host (not (equal old-host (system-name)))) (print! (warn "Your system has changed since last sync")) (setq to-rebuild t)) - (when (and to-rebuild (not auto?)) - (or (y-or-n-p - (format! " %s" "Your installed packages will need to be recompiled. Do so now?")) - (exit! 0)) - (setq rebuild? t))) + (when (and to-rebuild (not (doom-cli-context-suppress-prompts-p context))) + (if nobuild? + (print! (warn "Packages need to be recompiled, but -B has prevented it. Skipping...")) + (or (not (doom-cli-context-get context 'upgrading)) + (y-or-n-p + (format! " %s" "Your installed packages will need to be recompiled. Do so now?")) + (exit! 0)) + (setq rebuild? t)))) (when (and (not noenvvar?) (file-exists-p doom-env-file)) (call! '(env))) @@ -89,7 +90,9 @@ OPTIONS: (when (doom-profile-generate) (print! (item "Restart Emacs or use 'M-x doom/reload' for changes to take effect")) (run-hooks 'doom-after-sync-hook)) - (with-temp-file doom-cli-sync-info-file (prin1 (cons emacs-version (system-name)) (current-buffer))) + (when (and (not rebuild?) (not nobuild?)) + (with-temp-file doom-cli-sync-info-file + (prin1 (cons emacs-version (system-name)) (current-buffer)))) t) (remove-hook 'kill-emacs-hook #'doom-sync--abort-warning-h))) diff --git a/lisp/cli/upgrade.el b/lisp/cli/upgrade.el index 9f44d6e93..d42017caa 100644 --- a/lisp/cli/upgrade.el +++ b/lisp/cli/upgrade.el @@ -32,7 +32,7 @@ following shell commands: doom clean doom sync -u" (let* ((force? (doom-cli-context-suppress-prompts-p context)) - (sync-cmd (append '("sync" "-u" "-B") (if jobs `("-j" ,num))))) + (sync-cmd (append '("sync" "-u") (if jobs `("-j" ,num))))) (cond (packages? ;; HACK It's messy to use straight to upgrade straight, due to the @@ -53,6 +53,7 @@ following shell commands: ;; Reload Doom's CLI & libraries, in case there were any upstream changes. ;; Major changes will still break, however (print! (item "Reloading Doom Emacs")) + (doom-cli-context-put context 'upgrading t) (exit! "doom" "upgrade" "-p" (if force? "--force") (if jobs (format "--jobs=%d" jobs)))) From c0c52f0f610245df88391008972436f97ff2b5e3 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 26 Mar 2024 22:25:29 -0400 Subject: [PATCH 07/17] fix: ensure load-path et co are set on doom/reload This addresses a number of missing-package errors after running doom/reload. Fix: #7764 Fix: #7636 Fix: #7182 --- lisp/doom-profiles.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/doom-profiles.el b/lisp/doom-profiles.el index 94dd3dd09..26ae373d1 100644 --- a/lisp/doom-profiles.el +++ b/lisp/doom-profiles.el @@ -368,7 +368,8 @@ Defaults to the profile at `doom-profile-default'." ;; FIX: Make sure this only runs at startup to protect us Emacs' interpreter ;; re-evaluating this file when lazy-loading dynamic docstrings from the ;; byte-compiled init file. - `((when (doom-context-p 'init) + `((when (or (doom-context-p 'init) + (doom-context-p 'reload)) ,@(cl-loop for var in doom-autoloads-cached-vars if (boundp var) collect `(set-default ',var ',(symbol-value var))) From d5bad5b43061b6dfac6d2e8adf9d23f44d66ee5a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 26 Mar 2024 22:58:56 -0400 Subject: [PATCH 08/17] fix(cli): straight: regurgitate type errors as connection errors See included comment for explanation. --- lisp/cli/packages.el | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lisp/cli/packages.el b/lisp/cli/packages.el index 26018ae91..7933d692e 100644 --- a/lisp/cli/packages.el +++ b/lisp/cli/packages.el @@ -799,5 +799,31 @@ However, in batch mode, print to stdout instead of stderr." "/dev/null"))) (apply fn args))) +;; If the repo failed to clone correctly (usually due to a connection failure), +;; straight proceeds as normal until a later call produces a garbage result +;; (typically, when it fails to fetch the remote branch of the empty directory). +;; This causes Straight to throw an otherwise cryptic type error when it tries +;; to sanitize the result for its log buffer. +;; +;; This error is a common source of user confusion and false positive bug +;; reports, so this advice catches them to regurgitates a more cogent +;; explanation. +(defadvice! doom-cli--straight-throw-error-on-no-branch-a (fn &rest args) + :around #'straight--process-log + (letf! ((defun shell-quote-argument (arg &optional posix) + (when (null arg) + (error "Package was not properly cloned due to a connection failure, please try again later")) + (funcall shell-quote-argument arg posix))) + (apply fn args))) + +(defadvice! doom-cli--straight-regurgitate-empty-string-error-a (fn &rest args) + :around #'straight-vc-git-local-repo-name + (condition-case-unless-debug e + (apply fn args) + (wrong-type-argument + (if (eq (cadr e) 'stringp) + (error "Package was not properly cloned due to a connection failure, please try again later") + (signal (car e) (cdr e)))))) + (provide 'doom-cli-packages) ;;; packages.el ends here From aef2b12100d92b176bf6482826c03e5a7e6fe0ad Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 27 Mar 2024 00:23:41 -0400 Subject: [PATCH 09/17] feat(cli): doom upgrade: add -B option To mirror doom sync's -B option. --- lisp/cli/upgrade.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/cli/upgrade.el b/lisp/cli/upgrade.el index d42017caa..acaf37a3d 100644 --- a/lisp/cli/upgrade.el +++ b/lisp/cli/upgrade.el @@ -21,6 +21,7 @@ (defcli! ((upgrade up)) ((packages? ("-p" "--packages") "Only upgrade packages, not Doom") (jobs ("-j" "--jobs" num) "How many CPUs to use for native compilation") + (nobuild? ("-B") "Don't rebuild packages when hostname or Emacs version has changed") &context context) "Updates Doom and packages. @@ -32,7 +33,9 @@ following shell commands: doom clean doom sync -u" (let* ((force? (doom-cli-context-suppress-prompts-p context)) - (sync-cmd (append '("sync" "-u") (if jobs `("-j" ,num))))) + (sync-cmd (append '("sync" "-u") + (if nobuild? '("-B")) + (if jobs `("-j" ,num))))) (cond (packages? ;; HACK It's messy to use straight to upgrade straight, due to the @@ -55,6 +58,7 @@ following shell commands: (print! (item "Reloading Doom Emacs")) (doom-cli-context-put context 'upgrading t) (exit! "doom" "upgrade" "-p" + (if nobuild? "-B") (if force? "--force") (if jobs (format "--jobs=%d" jobs)))) From 201051c368cfdabf3f68c372939297380999e28d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 27 Mar 2024 00:23:54 -0400 Subject: [PATCH 10/17] fix(cli): doom sync: suppress rebuild prompt when upgrading 12a765c introduced suppression of package-rebuilding prompts on 'doom upgrade', but inadvertently reversed the check. This fixes that (and refactors the if/or tree into a `cond`). Amend: 12a765c5099c --- lisp/cli/sync.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lisp/cli/sync.el b/lisp/cli/sync.el index 54fbf0117..6b7274e0e 100644 --- a/lisp/cli/sync.el +++ b/lisp/cli/sync.el @@ -74,13 +74,14 @@ OPTIONS: (print! (warn "Your system has changed since last sync")) (setq to-rebuild t)) (when (and to-rebuild (not (doom-cli-context-suppress-prompts-p context))) - (if nobuild? - (print! (warn "Packages need to be recompiled, but -B has prevented it. Skipping...")) - (or (not (doom-cli-context-get context 'upgrading)) - (y-or-n-p - (format! " %s" "Your installed packages will need to be recompiled. Do so now?")) - (exit! 0)) - (setq rebuild? t)))) + (cond (nobuild? + (print! (warn "Packages must be rebuilt, but -B has prevented it. Skipping..."))) + ((doom-cli-context-get context 'upgrading) + (print! (warn "Packages will be rebuilt")) + (setq rebuild? t)) + ((y-or-n-p (format! " %s" "Installed packages must be rebuilt. Do so now?")) + (setq rebuild? t)) + ((exit! 0))))) (when (and (not noenvvar?) (file-exists-p doom-env-file)) (call! '(env))) From b6b755dea4546a7ae6d7dfb3fbfdbd71036a01fc Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 27 Mar 2024 09:39:05 -0400 Subject: [PATCH 11/17] fix(cli): doom install: $DOOMDIR paths in output Close: #7768 Co-authored-by: plajjan --- lisp/cli/install.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lisp/cli/install.el b/lisp/cli/install.el index 27dad9bc9..1836489e8 100644 --- a/lisp/cli/install.el +++ b/lisp/cli/install.el @@ -55,20 +55,19 @@ Change `$DOOMDIR' with the `--doomdir' option, e.g. (setq doom-user-dir (expand-file-name "doom/" xdg-config-dir))))) (if (file-directory-p doom-user-dir) - (print! (item "Skipping %s (already exists)") (relpath doom-user-dir)) + (print! (item "Skipping %s (already exists)") (path doom-user-dir)) (make-directory doom-user-dir 'parents) - (print! (success "Created %s") (relpath doom-user-dir))) + (print! (success "Created %s") (path doom-user-dir))) ;; Create init.el, config.el & packages.el (print-group! (mapc (lambda (file) (cl-destructuring-bind (filename . template) file - (if (file-exists-p! filename doom-user-dir) - (print! (item "Skipping %s (already exists)") - (path filename)) - (print! (item "Creating %s%s") (relpath doom-user-dir) filename) - (with-temp-file (doom-path doom-user-dir filename) - (insert-file-contents template)) + (setq filename (doom-path doom-user-dir filename)) + (if (file-exists-p filename) + (print! (item "Skipping %s (already exists)...") (path filename)) + (print! (item "Creating %s...") (path filename)) + (doom-file-write filename template) (print! (success "Done!"))))) (let ((template-dir (doom-path doom-emacs-dir "templates"))) `((,doom-module-init-file From d6a345091770bfc9078ace70c3c65daa805317cb Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 27 Mar 2024 10:23:54 -0400 Subject: [PATCH 12/17] fix(cli): shell-quote-argument: wrong-number-of-args error shell-quote-argument's second argument was introduced in 29.1. Users on older versions of Emacs will get an error. Amend: d5bad5b43061 --- lisp/cli/packages.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/cli/packages.el b/lisp/cli/packages.el index 7933d692e..527bfb31b 100644 --- a/lisp/cli/packages.el +++ b/lisp/cli/packages.el @@ -810,10 +810,10 @@ However, in batch mode, print to stdout instead of stderr." ;; explanation. (defadvice! doom-cli--straight-throw-error-on-no-branch-a (fn &rest args) :around #'straight--process-log - (letf! ((defun shell-quote-argument (arg &optional posix) - (when (null arg) + (letf! ((defun shell-quote-argument (&rest args) + (unless (car args) (error "Package was not properly cloned due to a connection failure, please try again later")) - (funcall shell-quote-argument arg posix))) + (apply shell-quote-argument args))) (apply fn args))) (defadvice! doom-cli--straight-regurgitate-empty-string-error-a (fn &rest args) From 3f966f49d8f97202ef018b51e24f65f629750182 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 27 Mar 2024 10:25:32 -0400 Subject: [PATCH 13/17] fix(cli): doom upgrade: remove doom-compile-clean call This function was removed in 63c470b. Amend: 63c470bff328 --- lisp/cli/upgrade.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/lisp/cli/upgrade.el b/lisp/cli/upgrade.el index acaf37a3d..78218de17 100644 --- a/lisp/cli/upgrade.el +++ b/lisp/cli/upgrade.el @@ -30,7 +30,6 @@ following shell commands: cd ~/.emacs.d git pull --rebase - doom clean doom sync -u" (let* ((force? (doom-cli-context-suppress-prompts-p context)) (sync-cmd (append '("sync" "-u") @@ -140,7 +139,6 @@ following shell commands: (ignore (print! (error "Aborted"))) (print! (start "Upgrading Doom Emacs...")) (print-group! - (doom-compile-clean) (doom-cli-context-put context 'straight-recipe (doom-upgrade--get-straight-recipe)) (or (and (zerop (car (sh! "git" "reset" "--hard" target-remote))) (equal (cdr (sh! "git" "rev-parse" "HEAD")) new-rev)) From 89c56a3393467d84ea4bf3d1aabf9ab4a9d0bed0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 27 Mar 2024 17:11:24 -0400 Subject: [PATCH 14/17] fix(cli): doom install: $DOOMDIR templates Caused by a regression introduced in b6b755d. Amend: b6b755dea454 --- lisp/cli/install.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/cli/install.el b/lisp/cli/install.el index 1836489e8..edb96cd2a 100644 --- a/lisp/cli/install.el +++ b/lisp/cli/install.el @@ -67,7 +67,7 @@ Change `$DOOMDIR' with the `--doomdir' option, e.g. (if (file-exists-p filename) (print! (item "Skipping %s (already exists)...") (path filename)) (print! (item "Creating %s...") (path filename)) - (doom-file-write filename template) + (with-temp-file template (insert-file-contents template)) (print! (success "Done!"))))) (let ((template-dir (doom-path doom-emacs-dir "templates"))) `((,doom-module-init-file From b44337198171bf612047d78f99968e17054cf48c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 28 Mar 2024 00:23:17 -0400 Subject: [PATCH 15/17] fix(cli): doom install: $DOOMDIR templates (part 2) Caused by a regression originally introduced in b6b755d, but incorrectly fixed in 89c56a3. Don't code while sleep deprived, kids. Amend: 89c56a339346 Amend: b6b755dea454 --- lisp/cli/install.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/cli/install.el b/lisp/cli/install.el index edb96cd2a..3e1e4ef21 100644 --- a/lisp/cli/install.el +++ b/lisp/cli/install.el @@ -67,7 +67,7 @@ Change `$DOOMDIR' with the `--doomdir' option, e.g. (if (file-exists-p filename) (print! (item "Skipping %s (already exists)...") (path filename)) (print! (item "Creating %s...") (path filename)) - (with-temp-file template (insert-file-contents template)) + (with-temp-file filename (insert-file-contents template)) (print! (success "Done!"))))) (let ((template-dir (doom-path doom-emacs-dir "templates"))) `((,doom-module-init-file From 544e579c448e83b4600ded44f6f997bbfbee1b8b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 28 Mar 2024 09:43:43 -0400 Subject: [PATCH 16/17] fix(cli): doom upgrade: ensure upgrade remote is deleted It seems the temporary branch that 'doom upgrade' creates is sometimes left over after a 'doom upgrade', preventing the next 'git fetch' from completing. Ref: #7771 --- lisp/cli/upgrade.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/cli/upgrade.el b/lisp/cli/upgrade.el index 78218de17..13614c62a 100644 --- a/lisp/cli/upgrade.el +++ b/lisp/cli/upgrade.el @@ -99,6 +99,8 @@ following shell commands: (sh! "git" "reset" "--hard" (format "origin/%s" branch)) (sh! "git" "clean" "-ffd"))) + ;; In case of leftover state from a partial/incomplete 'doom upgrade' + (sh! "git" "branch" "-D" target-remote) (sh! "git" "remote" "remove" doom-upgrade-remote) (unwind-protect (let (result) From b533f5496c154bc35a9db80c58f64dda52b72a8e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 28 Mar 2024 10:19:46 -0400 Subject: [PATCH 17/17] tweak(corfu): corfu-auto-delay: 0.1 -> 0.18 At 0.1, Corfu pops up too aggressively and too often, even for fast typists. This is especially disruptive with slow backends that might block Emacs. I think 0.18-0.24 is the goldilocks zone, so I'll start with 0.18, and maybe increase it later. --- modules/completion/corfu/config.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/completion/corfu/config.el b/modules/completion/corfu/config.el index 7cd7b5173..442ce2d52 100644 --- a/modules/completion/corfu/config.el +++ b/modules/completion/corfu/config.el @@ -41,7 +41,7 @@ use the minibuffer such as `query-replace'.") (corfu-mode +1)))) :config (setq corfu-auto t - corfu-auto-delay 0.1 + corfu-auto-delay 0.18 corfu-auto-prefix 2 global-corfu-modes '((not erc-mode