From f838c1790d1946dff3cd275e053417964dd121c4 Mon Sep 17 00:00:00 2001 From: cuithon <65674308+cuithon@users.noreply.github.com> Date: Wed, 13 Mar 2024 08:16:29 +0800 Subject: [PATCH 01/11] docs(default,mu4e,latex): fix repetition of `the` in docs --- modules/config/default/autoload/default.el | 2 +- modules/email/mu4e/README.org | 2 +- modules/lang/latex/autoload.el | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/config/default/autoload/default.el b/modules/config/default/autoload/default.el index b63a0d749..f229f3b7c 100644 --- a/modules/config/default/autoload/default.el +++ b/modules/config/default/autoload/default.el @@ -52,7 +52,7 @@ generate `completing-read' candidates." ;;;###autoload (defun +default/diagnostics (&rest arg) "List diagnostics for the current buffer/project. -If the the vertico and lsp modules are active, list lsp diagnostics for the +If the vertico and lsp modules are active, list lsp diagnostics for the current project. Otherwise list them for the current buffer" (interactive) (cond ((and (modulep! :completion vertico) diff --git a/modules/email/mu4e/README.org b/modules/email/mu4e/README.org index 1c34794f3..9dde00d3d 100644 --- a/modules/email/mu4e/README.org +++ b/modules/email/mu4e/README.org @@ -280,7 +280,7 @@ mail retrieval/indexing, change the value of ~mu4e-update-interval~: You will get =No such file or directory, mu4e= errors if you don't run ~$ doom sync~ after installing =mu= through your package manager. -Some times the the ~mu~ package does not include ~mu4e~ (*cough Ubuntu*). if +Some times the ~mu~ package does not include ~mu4e~ (*cough Ubuntu*). if that's the case you will need to [[https://github.com/djcb/mu][install]] it and add it to your ~load-path~ you can do that by: #+begin_src emacs-lisp diff --git a/modules/lang/latex/autoload.el b/modules/lang/latex/autoload.el index 1f58bf2e8..e9bec7a35 100644 --- a/modules/lang/latex/autoload.el +++ b/modules/lang/latex/autoload.el @@ -4,7 +4,7 @@ (defun +latex-indent-item-fn () "Indent LaTeX \"itemize\",\"enumerate\", and \"description\" environments. -\"\\item\" is indented `LaTeX-indent-level' spaces relative to the the beginning +\"\\item\" is indented `LaTeX-indent-level' spaces relative to the beginning of the environment. See `LaTeX-indent-level-item-continuation' for the indentation strategy this From 90f90fb34d36a029bcd69f203dd52887d13013a0 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 Mar 2024 05:28:51 -0400 Subject: [PATCH 02/11] fix(treemacs): simplify lsp-treemacs load-order dec058f fixed the load order between treemacs-nerd-icons and lsp-treemacs, but lsp-treemacs still loads so late that folks will see a theme-less Treemacs until they visit their first lsp-mode-enabled file. This ensures that won't happen. Amend: dec058fabb5e Amend: #7519 --- modules/ui/treemacs/config.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ui/treemacs/config.el b/modules/ui/treemacs/config.el index 211e1f3bc..d232ec1b0 100644 --- a/modules/ui/treemacs/config.el +++ b/modules/ui/treemacs/config.el @@ -84,6 +84,7 @@ This must be set before `treemacs' has loaded.") :after treemacs :config (treemacs-set-scope-type 'Perspectives)) + (use-package! lsp-treemacs :when (modulep! +lsp) - :after (treemacs lsp)) + :after treemacs) From 4af536cde23b1cae50049f24546765fbe944d1f1 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 Mar 2024 19:14:14 -0400 Subject: [PATCH 03/11] fix(emacs-lisp): +emacs-lisp--module-at-point: wrong-number-of-arguments error --- modules/lang/emacs-lisp/autoload.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lang/emacs-lisp/autoload.el b/modules/lang/emacs-lisp/autoload.el index 8076a5cb2..d2092fa9c 100644 --- a/modules/lang/emacs-lisp/autoload.el +++ b/modules/lang/emacs-lisp/autoload.el @@ -66,7 +66,7 @@ Intended to replace `lisp-outline-level'." (re-search-backward "\\_<:\\(?:\\sw\\|\\s_\\)+\\_>" ;; Find a keyword. doom-start 'noerror)) - (unless (looking-back "(") + (unless (looking-back "(" (bol)) (let ((kw-syntax (syntax-ppss))) (when (and (= (ppss-depth kw-syntax) doom-depth) (not (ppss-string-terminator kw-syntax)) From 5f858bb142ccd1adb283d81cc6c703e872b36092 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 Mar 2024 20:39:38 -0400 Subject: [PATCH 04/11] refactor(lsp): obsolete eglot-events-buffer-size Ref: https://github.com/joaotavora/eglot/commit/88c46bd4dbaa82b4af46aed9b578b121f0edfe48 --- modules/tools/lsp/+eglot.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/tools/lsp/+eglot.el b/modules/tools/lsp/+eglot.el index 5b56b600e..5a06f2aae 100644 --- a/modules/tools/lsp/+eglot.el +++ b/modules/tools/lsp/+eglot.el @@ -16,15 +16,15 @@ (setq eglot-sync-connect 1 eglot-autoshutdown t eglot-send-changes-idle-time 0.5 - ;; NOTE This setting disable the eglot-events-buffer enabling more - ;; consistent performance on long running emacs instance. - ;; Default is 2000000 lines. After each new event the whole buffer - ;; is pretty printed which causes steady performance decrease over time. - ;; CPU is spent on pretty priting and Emacs GC is put under high pressure. - eglot-events-buffer-size 0 - ;; NOTE We disable eglot-auto-display-help-buffer because :select t in - ;; its popup rule causes eglot to steal focus too often. + ;; NOTE: We disable eglot-auto-display-help-buffer because :select t in + ;; its popup rule causes eglot to steal focus too often. eglot-auto-display-help-buffer nil) + ;; NOTE: This setting disable the eglot-events-buffer enabling more consistent + ;; performance on long running emacs instance. Default is 2000000 lines. + ;; After each new event the whole buffer is pretty printed which causes + ;; steady performance decrease over time. CPU is spent on pretty priting and + ;; Emacs GC is put under high pressure. + (cl-callf plist-put eglot-events-buffer-config :size 0) (when (and (modulep! :checkers syntax) (not (modulep! :checkers syntax +flymake))) (setq eglot-stay-out-of '(flymake))) @@ -38,7 +38,7 @@ :type-definition #'eglot-find-typeDefinition :documentation #'+eglot-lookup-documentation) - (add-to-list 'doom-debug-variables '(eglot-events-buffer-size . 2000000)) + (add-to-list 'doom-debug-variables '(eglot-events-buffer-size :size 2000000 :format full)) (defadvice! +lsp--defer-server-shutdown-a (fn &optional server) "Defer server shutdown for a few seconds. From 5cc4056abf30b0d9c5027b93a1022f8ee9e90f99 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 Mar 2024 20:46:02 -0400 Subject: [PATCH 05/11] fix(format): +format-with-eglot-fn: eglot detection --- modules/editor/format/autoload/format.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/editor/format/autoload/format.el b/modules/editor/format/autoload/format.el index 709855817..d0379c6a7 100644 --- a/modules/editor/format/autoload/format.el +++ b/modules/editor/format/autoload/format.el @@ -116,7 +116,7 @@ the requested feature." Does nothing if `+format-with-lsp' is nil or the active server doesn't support the requested feature." (and +format-with-lsp - (bound-and-true-p eglot-managed-mode) + (bound-and-true-p eglot--managed-mode) (pcase op ('buffer (if (eglot--server-capable :documentFormattingProvider) (always (eglot-format-buffer)))) From fec28a19e16cdd32364bf58e2c88699da514cb78 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 13 Mar 2024 00:05:26 -0400 Subject: [PATCH 06/11] fix: save-place: don't move point more than once In some contexts, like org-agenda-switch-to visiting a TODO in an agenda file, the visiting command will move the cursor after opening the file. If save-place moves the cursor yet again, the cursor will end up in an unpredictable place. --- lisp/doom-editor.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/doom-editor.el b/lisp/doom-editor.el index e9d460adc..2df2cbb66 100644 --- a/lisp/doom-editor.el +++ b/lisp/doom-editor.el @@ -406,6 +406,11 @@ the unwritable tidbits." (unless doom-large-file-p (apply fn args))) + (defadvice! doom--inhibit-saveplace-if-point-not-at-bol-a (&rest _) + "If something else has moved point, don't try to move it again." + :before-while #'save-place-find-file-hook + (bobp)) + (defadvice! doom--dont-prettify-saveplace-cache-a (fn) "`save-place-alist-to-file' uses `pp' to prettify the contents of its cache. `pp' can be expensive for longer lists, and there's no reason to prettify cache From 39db5de5709a0e4a3b1a88bfd58d7d0075b2d728 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 13 Mar 2024 00:07:01 -0400 Subject: [PATCH 07/11] fix(org): only reveal point on save-place-after-find-file-hook Prior to this change, whenever you enter an org-mode buffer, any invisible regions around the cursor (which had been moved by save-place) would be unfolded unconditionally. There may be cases where moving the cursor immediately after visiting the file could cause errors (e.g. when yasnippet tries to wrestle control over the cursor, org-agenda-switch-to moves the cursor before switching to the buffer, etc). This change ensures the expansion *only* happens when save-place does its thing (and successfully). --- modules/lang/org/config.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 549f38c10..ffbfbb19b 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -1368,7 +1368,7 @@ between the two." #'doom-disable-show-trailing-whitespace-h ;; #'+org-enable-auto-reformat-tables-h ;; #'+org-enable-auto-update-cookies-h - #'+org-make-last-point-visible-h) + ) (add-hook! 'org-load-hook #'+org-init-org-directory-h @@ -1435,15 +1435,20 @@ between the two." :references #'+org-lookup-references-handler :documentation #'+org-lookup-documentation-handler) - ;; HACK: Somehow, users/packages still find a way to modify tab-width in - ;; org-mode. Since org-mode treats a non-standerd tab-width as an error - ;; state, I use this hook to makes it much harder to change by accident. (add-hook! 'org-mode-hook + ;; HACK: Somehow, users/packages still find a way to modify tab-width in + ;; org-mode. Since org-mode treats a non-standerd tab-width as an error + ;; state, I use this hook to makes it much harder to change by accident. (add-hook! 'after-change-major-mode-hook :local ;; The second check is necessary, in case of `org-edit-src-code' which ;; clones a buffer and changes its major-mode. (when (derived-mode-p 'org-mode) - (setq tab-width 8)))) + (setq tab-width 8))) + + ;; HACK: `save-place' can position the cursor in an invisible region. This + ;; makes it visible unless `org-inhibit-startup' or + ;; `org-inhibit-startup-visibility-stuff' is non-nil. + (add-hook 'save-place-after-find-file-hook #'+org-make-last-point-visible-h nil t)) ;; Save target buffer after archiving a node. (setq org-archive-subtree-save-file-p t) From 0073c3d70db750db94c53e67e725d11c73bff3f3 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 13 Mar 2024 00:55:46 -0400 Subject: [PATCH 08/11] docs(twitter): add deprecation notice twittering-mode is non-functional and no known alternative exists. Close: #6383 --- modules/app/twitter/README.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/app/twitter/README.org b/modules/app/twitter/README.org index 970e2da09..e4912d364 100644 --- a/modules/app/twitter/README.org +++ b/modules/app/twitter/README.org @@ -3,6 +3,11 @@ #+created: October 11, 2019 #+since: 2.0.0 +#+begin_quote +  *This module is deprecated.* Changes upstream to Twitter's API has rendered + twittering-mode non-functional, and there is no known alternative. +#+end_quote + * Description :unfold: Enjoy twitter from emacs. From 193475cd644a5c7a441da1ec468d6d59c1436672 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 13 Mar 2024 01:08:56 -0400 Subject: [PATCH 09/11] fix(lsp): s/eglot-events-buffer-size/eglot-events-buffer-config/ Amend: 5f858bb142cc --- modules/tools/lsp/+eglot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tools/lsp/+eglot.el b/modules/tools/lsp/+eglot.el index 5a06f2aae..9281047a4 100644 --- a/modules/tools/lsp/+eglot.el +++ b/modules/tools/lsp/+eglot.el @@ -38,7 +38,7 @@ :type-definition #'eglot-find-typeDefinition :documentation #'+eglot-lookup-documentation) - (add-to-list 'doom-debug-variables '(eglot-events-buffer-size :size 2000000 :format full)) + (add-to-list 'doom-debug-variables '(eglot-events-buffer-config :size 2000000 :format full)) (defadvice! +lsp--defer-server-shutdown-a (fn &optional server) "Defer server shutdown for a few seconds. From 5280fb2855eef82d65ae7cc5bc0ca52d06fcf2ca Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 13 Mar 2024 06:51:35 -0400 Subject: [PATCH 10/11] fix(lsp): void-variable eglot-events-buffer-config The variable was modified too early (before the package was loaded). Amend: 5f858bb142cc --- modules/tools/lsp/+eglot.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/tools/lsp/+eglot.el b/modules/tools/lsp/+eglot.el index 9281047a4..8bf7ed20f 100644 --- a/modules/tools/lsp/+eglot.el +++ b/modules/tools/lsp/+eglot.el @@ -19,12 +19,6 @@ ;; NOTE: We disable eglot-auto-display-help-buffer because :select t in ;; its popup rule causes eglot to steal focus too often. eglot-auto-display-help-buffer nil) - ;; NOTE: This setting disable the eglot-events-buffer enabling more consistent - ;; performance on long running emacs instance. Default is 2000000 lines. - ;; After each new event the whole buffer is pretty printed which causes - ;; steady performance decrease over time. CPU is spent on pretty priting and - ;; Emacs GC is put under high pressure. - (cl-callf plist-put eglot-events-buffer-config :size 0) (when (and (modulep! :checkers syntax) (not (modulep! :checkers syntax +flymake))) (setq eglot-stay-out-of '(flymake))) @@ -38,6 +32,13 @@ :type-definition #'eglot-find-typeDefinition :documentation #'+eglot-lookup-documentation) + ;; NOTE: This setting disable the eglot-events-buffer enabling more consistent + ;; performance on long running emacs instance. Default is 2000000 lines. + ;; After each new event the whole buffer is pretty printed which causes + ;; steady performance decrease over time. CPU is spent on pretty priting and + ;; Emacs GC is put under high pressure. + (cl-callf plist-put eglot-events-buffer-config :size 0) + (add-to-list 'doom-debug-variables '(eglot-events-buffer-config :size 2000000 :format full)) (defadvice! +lsp--defer-server-shutdown-a (fn &optional server) From c20c2aa36ed0be93beca3fc63eea2724f57af6a7 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 13 Mar 2024 10:53:31 -0400 Subject: [PATCH 11/11] fix: tiny fonts in (daemon) GUI frames Due to a suppressed void-variable error, font initialization is short-circuited across daemon frames when the fonts are reloaded or changed (which is also triggered by changing themes), resulting in malformed (often tiny) fonts in GUI frames. Fix: #7730 --- lisp/doom-ui.el | 53 +++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/lisp/doom-ui.el b/lisp/doom-ui.el index 2bfdc3d8c..95d5b92ce 100644 --- a/lisp/doom-ui.el +++ b/lisp/doom-ui.el @@ -498,7 +498,7 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original (cons 'custom-theme-directory (delq 'custom-theme-directory custom-theme-load-path))) -(defun doom--make-font-specs (face font) +(defun doom--make-font-specs (face font frame) (let* ((base-specs (cadr (assq 'user (get face 'theme-face)))) (base-specs (or base-specs '((t nil)))) (attrs '(:family :foundry :slant :weight :height :width)) @@ -509,36 +509,37 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original (plist (copy-tree (nth 1 spec)))) ;; Alter only DISPLAY conditions matching this frame. (when (or (memq display '(t default)) - (face-spec-set-match-display display this-frame)) + (face-spec-set-match-display display frame)) (dolist (attr attrs) (setq plist (plist-put plist attr (face-attribute face attr))))) (push (list display plist) new-specs))) (nreverse new-specs))) -(defun doom-init-fonts-h (&optional reload) - "Loads `doom-font'." - (dolist (map `((default . ,doom-font) - (fixed-pitch . ,doom-font) - (fixed-pitch-serif . ,doom-serif-font) - (variable-pitch . ,doom-variable-pitch-font))) - (condition-case e - (when-let* ((face (car map)) - (font (cdr map))) - (dolist (frame (frame-list)) - (when (display-multi-font-p frame) - (set-face-attribute face frame - :width 'normal :weight 'normal - :slant 'normal :font font))) - (let ((new-specs (doom--make-font-specs face font))) - ;; Don't save to `customized-face' so it's omitted from `custom-file' - ;;(put face 'customized-face new-specs) - (custom-push-theme 'theme-face face 'user 'set new-specs) - (put face 'face-modified nil))) - ('error - (ignore-errors (doom--reset-inhibited-vars-h)) - (if (string-prefix-p "Font not available" (error-message-string e)) - (signal 'doom-font-error (list (font-get (cdr map) :family))) - (signal (car e) (cdr e)))))) +(defun doom-init-fonts-h (&optional _reload) + "Loads `doom-font', `doom-serif-font', and `doom-variable-pitch-font'." + (let ((this-frame (selected-frame))) + (dolist (map `((default . ,doom-font) + (fixed-pitch . ,doom-font) + (fixed-pitch-serif . ,doom-serif-font) + (variable-pitch . ,doom-variable-pitch-font))) + (condition-case e + (when-let* ((face (car map)) + (font (cdr map))) + (dolist (frame (frame-list)) + (when (display-multi-font-p frame) + (set-face-attribute face frame + :width 'normal :weight 'normal + :slant 'normal :font font))) + (let ((new-specs (doom--make-font-specs face font this-frame))) + ;; Don't save to `customized-face' so it's omitted from `custom-file' + ;;(put face 'customized-face new-specs) + (custom-push-theme 'theme-face face 'user 'set new-specs) + (put face 'face-modified nil))) + ('error + (ignore-errors (doom--reset-inhibited-vars-h)) + (if (string-prefix-p "Font not available" (error-message-string e)) + (signal 'doom-font-error (list (font-get (cdr map) :family))) + (signal (car e) (cdr e))))))) (when (fboundp 'set-fontset-font) (let* ((fn (doom-rpartial #'member (font-family-list))) (symbol-font (or doom-symbol-font