dev: updating from latest

This commit is contained in:
Matt Nish-Lapidus 2024-03-13 12:16:01 -04:00
commit 1f966c2250
11 changed files with 64 additions and 46 deletions

View file

@ -406,6 +406,11 @@ the unwritable tidbits."
(unless doom-large-file-p (unless doom-large-file-p
(apply fn args))) (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) (defadvice! doom--dont-prettify-saveplace-cache-a (fn)
"`save-place-alist-to-file' uses `pp' to prettify the contents of its cache. "`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 `pp' can be expensive for longer lists, and there's no reason to prettify cache

View file

@ -498,7 +498,7 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
(cons 'custom-theme-directory (cons 'custom-theme-directory
(delq 'custom-theme-directory custom-theme-load-path))) (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)))) (let* ((base-specs (cadr (assq 'user (get face 'theme-face))))
(base-specs (or base-specs '((t nil)))) (base-specs (or base-specs '((t nil))))
(attrs '(:family :foundry :slant :weight :height :width)) (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)))) (plist (copy-tree (nth 1 spec))))
;; Alter only DISPLAY conditions matching this frame. ;; Alter only DISPLAY conditions matching this frame.
(when (or (memq display '(t default)) (when (or (memq display '(t default))
(face-spec-set-match-display display this-frame)) (face-spec-set-match-display display frame))
(dolist (attr attrs) (dolist (attr attrs)
(setq plist (plist-put plist attr (face-attribute face attr))))) (setq plist (plist-put plist attr (face-attribute face attr)))))
(push (list display plist) new-specs))) (push (list display plist) new-specs)))
(nreverse new-specs))) (nreverse new-specs)))
(defun doom-init-fonts-h (&optional reload) (defun doom-init-fonts-h (&optional _reload)
"Loads `doom-font'." "Loads `doom-font', `doom-serif-font', and `doom-variable-pitch-font'."
(dolist (map `((default . ,doom-font) (let ((this-frame (selected-frame)))
(fixed-pitch . ,doom-font) (dolist (map `((default . ,doom-font)
(fixed-pitch-serif . ,doom-serif-font) (fixed-pitch . ,doom-font)
(variable-pitch . ,doom-variable-pitch-font))) (fixed-pitch-serif . ,doom-serif-font)
(condition-case e (variable-pitch . ,doom-variable-pitch-font)))
(when-let* ((face (car map)) (condition-case e
(font (cdr map))) (when-let* ((face (car map))
(dolist (frame (frame-list)) (font (cdr map)))
(when (display-multi-font-p frame) (dolist (frame (frame-list))
(set-face-attribute face frame (when (display-multi-font-p frame)
:width 'normal :weight 'normal (set-face-attribute face frame
:slant 'normal :font font))) :width 'normal :weight 'normal
(let ((new-specs (doom--make-font-specs face font))) :slant 'normal :font font)))
;; Don't save to `customized-face' so it's omitted from `custom-file' (let ((new-specs (doom--make-font-specs face font this-frame)))
;;(put face 'customized-face new-specs) ;; Don't save to `customized-face' so it's omitted from `custom-file'
(custom-push-theme 'theme-face face 'user 'set new-specs) ;;(put face 'customized-face new-specs)
(put face 'face-modified nil))) (custom-push-theme 'theme-face face 'user 'set new-specs)
('error (put face 'face-modified nil)))
(ignore-errors (doom--reset-inhibited-vars-h)) ('error
(if (string-prefix-p "Font not available" (error-message-string e)) (ignore-errors (doom--reset-inhibited-vars-h))
(signal 'doom-font-error (list (font-get (cdr map) :family))) (if (string-prefix-p "Font not available" (error-message-string e))
(signal (car e) (cdr e)))))) (signal 'doom-font-error (list (font-get (cdr map) :family)))
(signal (car e) (cdr e)))))))
(when (fboundp 'set-fontset-font) (when (fboundp 'set-fontset-font)
(let* ((fn (doom-rpartial #'member (font-family-list))) (let* ((fn (doom-rpartial #'member (font-family-list)))
(symbol-font (or doom-symbol-font (symbol-font (or doom-symbol-font

View file

@ -3,6 +3,11 @@
#+created: October 11, 2019 #+created: October 11, 2019
#+since: 2.0.0 #+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: * Description :unfold:
Enjoy twitter from emacs. Enjoy twitter from emacs.

View file

@ -52,7 +52,7 @@ generate `completing-read' candidates."
;;;###autoload ;;;###autoload
(defun +default/diagnostics (&rest arg) (defun +default/diagnostics (&rest arg)
"List diagnostics for the current buffer/project. "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" current project. Otherwise list them for the current buffer"
(interactive) (interactive)
(cond ((and (modulep! :completion vertico) (cond ((and (modulep! :completion vertico)

View file

@ -116,7 +116,7 @@ the requested feature."
Does nothing if `+format-with-lsp' is nil or the active server doesn't support Does nothing if `+format-with-lsp' is nil or the active server doesn't support
the requested feature." the requested feature."
(and +format-with-lsp (and +format-with-lsp
(bound-and-true-p eglot-managed-mode) (bound-and-true-p eglot--managed-mode)
(pcase op (pcase op
('buffer (if (eglot--server-capable :documentFormattingProvider) ('buffer (if (eglot--server-capable :documentFormattingProvider)
(always (eglot-format-buffer)))) (always (eglot-format-buffer))))

View file

@ -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 You will get =No such file or directory, mu4e= errors if you don't run ~$ doom
sync~ after installing =mu= through your package manager. 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 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: can do that by:
#+begin_src emacs-lisp #+begin_src emacs-lisp

View file

@ -66,7 +66,7 @@ Intended to replace `lisp-outline-level'."
(re-search-backward (re-search-backward
"\\_<:\\(?:\\sw\\|\\s_\\)+\\_>" ;; Find a keyword. "\\_<:\\(?:\\sw\\|\\s_\\)+\\_>" ;; Find a keyword.
doom-start 'noerror)) doom-start 'noerror))
(unless (looking-back "(") (unless (looking-back "(" (bol))
(let ((kw-syntax (syntax-ppss))) (let ((kw-syntax (syntax-ppss)))
(when (and (= (ppss-depth kw-syntax) doom-depth) (when (and (= (ppss-depth kw-syntax) doom-depth)
(not (ppss-string-terminator kw-syntax)) (not (ppss-string-terminator kw-syntax))

View file

@ -4,7 +4,7 @@
(defun +latex-indent-item-fn () (defun +latex-indent-item-fn ()
"Indent LaTeX \"itemize\",\"enumerate\", and \"description\" environments. "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. of the environment.
See `LaTeX-indent-level-item-continuation' for the indentation strategy this See `LaTeX-indent-level-item-continuation' for the indentation strategy this

View file

@ -1368,7 +1368,7 @@ between the two."
#'doom-disable-show-trailing-whitespace-h #'doom-disable-show-trailing-whitespace-h
;; #'+org-enable-auto-reformat-tables-h ;; #'+org-enable-auto-reformat-tables-h
;; #'+org-enable-auto-update-cookies-h ;; #'+org-enable-auto-update-cookies-h
#'+org-make-last-point-visible-h) )
(add-hook! 'org-load-hook (add-hook! 'org-load-hook
#'+org-init-org-directory-h #'+org-init-org-directory-h
@ -1435,15 +1435,20 @@ between the two."
:references #'+org-lookup-references-handler :references #'+org-lookup-references-handler
:documentation #'+org-lookup-documentation-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 (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 (add-hook! 'after-change-major-mode-hook :local
;; The second check is necessary, in case of `org-edit-src-code' which ;; The second check is necessary, in case of `org-edit-src-code' which
;; clones a buffer and changes its major-mode. ;; clones a buffer and changes its major-mode.
(when (derived-mode-p 'org-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. ;; Save target buffer after archiving a node.
(setq org-archive-subtree-save-file-p t) (setq org-archive-subtree-save-file-p t)

View file

@ -16,14 +16,8 @@
(setq eglot-sync-connect 1 (setq eglot-sync-connect 1
eglot-autoshutdown t eglot-autoshutdown t
eglot-send-changes-idle-time 0.5 eglot-send-changes-idle-time 0.5
;; NOTE This setting disable the eglot-events-buffer enabling more ;; NOTE: We disable eglot-auto-display-help-buffer because :select t in
;; consistent performance on long running emacs instance. ;; its popup rule causes eglot to steal focus too often.
;; 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.
eglot-auto-display-help-buffer nil) eglot-auto-display-help-buffer nil)
(when (and (modulep! :checkers syntax) (when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake))) (not (modulep! :checkers syntax +flymake)))
@ -38,7 +32,14 @@
:type-definition #'eglot-find-typeDefinition :type-definition #'eglot-find-typeDefinition
:documentation #'+eglot-lookup-documentation) :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) (defadvice! +lsp--defer-server-shutdown-a (fn &optional server)
"Defer server shutdown for a few seconds. "Defer server shutdown for a few seconds.

View file

@ -84,6 +84,7 @@ This must be set before `treemacs' has loaded.")
:after treemacs :after treemacs
:config (treemacs-set-scope-type 'Perspectives)) :config (treemacs-set-scope-type 'Perspectives))
(use-package! lsp-treemacs (use-package! lsp-treemacs
:when (modulep! +lsp) :when (modulep! +lsp)
:after (treemacs lsp)) :after treemacs)