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 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 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. 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/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)))) 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/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)) 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 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) diff --git a/modules/tools/lsp/+eglot.el b/modules/tools/lsp/+eglot.el index 5b56b600e..8bf7ed20f 100644 --- a/modules/tools/lsp/+eglot.el +++ b/modules/tools/lsp/+eglot.el @@ -16,14 +16,8 @@ (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) (when (and (modulep! :checkers syntax) (not (modulep! :checkers syntax +flymake))) @@ -38,7 +32,14 @@ :type-definition #'eglot-find-typeDefinition :documentation #'+eglot-lookup-documentation) - (add-to-list 'doom-debug-variables '(eglot-events-buffer-size . 2000000)) + ;; 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) "Defer server shutdown for a few seconds. 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)