dev: merge branch 'master'

This commit is contained in:
Matt Nish-Lapidus 2024-08-16 10:23:12 -04:00
commit 4cfb00a0e5
23 changed files with 111 additions and 111 deletions

View file

@ -165,10 +165,10 @@ EXIT CODES:
3 Unrecognized user input error
4 Command not found, or is incorrect/deprecated
5 Invalid, missing, or extra options/arguments
6-49 Reserved for Doom
50-200 Reserved for custom user codes
6-15 Reserved for Doom
16-192 Reserved for the user's extensions
254 Successful run (but then execute `doom-cli-restart-script')
255 Uncaught internal errors
255 Uncaught critical errors
SEE ALSO:
https://doomemacs.org Homepage

View file

@ -300,7 +300,8 @@ list remains lean."
(and (eq (car-safe build) :not)
(setq want-byte-compile (not want-byte-compile)
want-native-compile (not want-native-compile)))
(unless (featurep 'native-compile)
(when (or (not (featurep 'native-compile))
(not straight--native-comp-available))
(setq want-native-compile nil))
(and (or want-byte-compile want-native-compile)
(or (file-newer-than-file-p repo-dir build-dir)

View file

@ -36,14 +36,14 @@ This is the equivalent of running autoremove, install, autoloads, then
recompile. Run this whenever you:
1. Modify your `doom!' block,
2. Add or remove `package!' blocks to your config,
3. Add or remove autoloaded functions in module autoloaded files,
4. Update Doom outside of Doom (e.g. with git),
2. Add, remove, or modify `package!' blocks to your config,
3. Add, remove, or modify autoloaded functions in module autoloaded files,
4. Update Doom manually (e.g. with git),
5. Move your Doom config (either $EMACSDIR or $DOOMDIR) to a new location.
6. When you up (or down) grade Emacs itself.
6. Up or downgrade Emacs itself (e.g. 29.1 -> 29.4).
It will ensure that unneeded packages are removed, all needed packages are
installed, autoloads files are up-to-date and no byte-compiled files have gone
Sync'ing ensures that unneeded packages are removed, needed packages are
installed, autoloads files are up-to-date, and no byte-compiled files have gone
stale.
OPTIONS:

View file

@ -450,6 +450,8 @@ files, so this replace calls to `pp' with the much faster `prin1'."
;; REVIEW Suppress byte-compiler warning spawning a *Compile-Log* buffer at
;; startup. This can be removed once gilbertw1/better-jumper#2 is merged.
(defvar better-jumper-local-mode nil)
;; REVIEW: Remove if/when gilbertw1/better-jumper#26 is addressed.
(defvaralias 'evil--jumps-jump-command 'evil--jumps-jumping-backard)
:init
(global-set-key [remap evil-jump-forward] #'better-jumper-jump-forward)
(global-set-key [remap evil-jump-backward] #'better-jumper-jump-backward)
@ -575,8 +577,8 @@ files, so this replace calls to `pp' with the much faster `prin1'."
(lambda (button)
(helpful-variable (button-get button 'apropos-symbol))))))
(when (> emacs-major-version 28)
;; REVIEW This should be reported upstream to Emacs.
;; DEPRECATED: Remove when support for 29 is dropped.
(when (= emacs-major-version 29)
(defadvice! doom--find-function-search-for-symbol-save-excursion-a (fn &rest args)
"Suppress cursor movement by `find-function-search-for-symbol'.

View file

@ -64,12 +64,13 @@
;; usage, however!
(setq inhibit-compacting-font-caches t)
;; PGTK builds only: this timeout adds latency to frame operations, like
;; `make-frame-invisible', which are frequently called without a guard because
;; it's inexpensive in non-PGTK builds. Lowering the timeout from the default
;; 0.1 should make childframes and packages that manipulate them (like `lsp-ui',
;; `company-box', and `posframe') feel much snappier. See emacs-lsp/lsp-ui#613.
(eval-when! (boundp 'pgtk-wait-for-event-timeout)
;; PGTK builds only: there's a timeout that adds latency to frame operations,
;; like `make-frame-invisible', which Emacs frequently calls without a guard
;; because it's inexpensive in non-PGTK builds. Lowering the timeout from the
;; default 0.1 should make childframes and packages that manipulate them (like
;; `lsp-ui', `company-box', and `posframe') feel much snappier. See
;; emacs-lsp/lsp-ui#613.
(when (boundp 'pgtk-wait-for-event-timeout)
(setq pgtk-wait-for-event-timeout 0.001))
;; Increase how much is read from processes in a single chunk (default is 4kb).
@ -82,7 +83,7 @@
;; Performance on Windows is considerably worse than elsewhere. We'll need
;; everything we can get.
(eval-when! (boundp 'w32-get-true-file-attributes)
(when (boundp 'w32-get-true-file-attributes)
(setq w32-get-true-file-attributes nil ; decrease file IO workload
w32-pipe-read-delay 0 ; faster IPC
w32-pipe-buffer-size (* 64 1024))) ; read more at a time (was 4K)
@ -90,8 +91,8 @@
;; The GC introduces annoying pauses and stuttering into our Emacs experience,
;; so we use `gcmh' to stave off the GC while we're using Emacs, and provoke it
;; when it's idle. However, if the idle delay is too long, we run the risk of
;; runaway memory usage in busy sessions. If it's too low, then we may as well
;; not be using gcmh at all.
;; runaway memory usage in busy sessions. And if it's too low, then we may as
;; well not be using gcmh at all.
(setq gcmh-idle-delay 'auto ; default is 15s
gcmh-auto-idle-delay-factor 10
gcmh-high-cons-threshold (* 16 1024 1024)) ; 16mb
@ -124,11 +125,10 @@
;; disabling Emacs' menu-bar also makes MacOS treat Emacs GUI frames like
;; non-application windows (e.g. it won't capture focus on activation, among
;; other things), so the menu-bar should be preserved there.
;;
(when doom--system-macos-p
;; NOTE: The correct way to disable this hack is to toggle `menu-bar-mode' (or
;; put it on a hook). Don't try to undo the hack below, as it may change
;; without warning, but will always respect `menu-bar-mode'.
;; NOTE: Don't try to undo the hack below, as it may change without warning.
;; Instead, toggle `menu-bar-mode' (or put it on a hook) as normal. This
;; hack will always try to respect the state of `menu-bar-mode'.
(setcdr (assq 'menu-bar-lines default-frame-alist) 'tty)
(add-hook! 'after-make-frame-functions
(defun doom--init-menu-bar-on-macos-h (&optional frame)
@ -357,8 +357,8 @@ If RETURN-P, return the message as a string instead of displaying it."
;; and ~/_emacs) -- and spare us the IO of searching for them, and allows
;; savvy hackers to use $EMACSDIR as their $DOOMDIR, if they wanted.
;; 3. Cut down on unnecessary logic in Emacs' bootstrapper.
;; 4. Offer a more user-friendly error state/screen, especially for errors
;; emitted from Doom's core or the user's config.
;; 4. TODO Offer a more user-friendly error state/screen, especially for
;; errors emitted from Doom's core or the user's config.
(define-advice startup--load-user-init-file (:override (&rest _) init-doom 100)
(let ((debug-on-error-from-init-file nil)
(debug-on-error-should-be-set nil)

View file

@ -537,7 +537,6 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
(nreverse 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))))))

View file

@ -148,8 +148,9 @@
(push 'harfbuzz features))
;; The `native-compile' feature exists whether or not it is functional (e.g.
;; libgcc is available or not). This seems silly, so pretend it doesn't exist if
;; it isn't functional.
;; libgcc is available or not). This seems silly, as some packages will blindly
;; use the native-comp API if it's present, whether or not it's functional. so
;; pretend it doesn't exist if that's the case.
(if (featurep 'native-compile)
(if (not (native-comp-available-p))
(delq 'native-compile features)))
@ -193,7 +194,7 @@
;;; Core globals
(defgroup doom nil
"An Emacs framework for the stubborn martian hacker."
"A development framework for Emacs configurations and Emacs Lisp projects."
:link '(url-link "https://doomemacs.org")
:group 'emacs)
@ -205,7 +206,7 @@
"Current version of Doom Emacs.")
(defvar doom-init-time nil
"The time it took, in seconds, for Doom Emacs to initialize.")
"The time it took, in seconds (as a float), for Doom Emacs to start up.")
(defconst doom-profile
(if-let (profile (getenv-internal "DOOMPROFILE"))
@ -306,11 +307,11 @@ For profile-local cache files, use `doom-profile-cache-dir' instead.")
(file-name-concat doom-local-dir "state/"))
"Where Doom stores its global state files.
State files contain unessential, unportable, but persistent data which, if lost
won't cause breakage, but may be inconvenient as they cannot be automatically
regenerated or restored. For example, a recently-opened file list is not
essential, but losing it means losing this record, and restoring it requires
revisiting all those files.
State files contain unessential, non-portable, but persistent data which, if
lost won't cause breakage, but may be inconvenient as they cannot be
automatically regenerated or restored. For example, a recently-opened file list
is not essential, but losing it means losing this record, and restoring it
requires revisiting all those files.
Use this for: history, logs, user-saved data, autosaves/backup files, known
projects, recent files, bookmarks.
@ -332,7 +333,7 @@ For profile-local state files, use `doom-profile-state-dir' instead.")
(defconst doom-profile-dir
(file-name-concat doom-profile-data-dir "@" (cdr doom-profile))
"Where generated files for the active profile are kept.")
"Where generated files for the active profile (for Doom's core) are kept.")
;; DEPRECATED: Will be moved to cli/env
(defconst doom-env-file
@ -393,10 +394,10 @@ users).")
(unless noninteractive
;; PERF: Resizing the Emacs frame (to accommodate fonts that are smaller or
;; larger than the system font) appears to impact startup time
;; larger than the default system font) can impact startup time
;; dramatically. The larger the delta, the greater the delay. Even trivial
;; deltas can yield up to a ~1000ms loss, depending on font size and
;; `window-system'. PGTK seems least affected and NS/MAC the most.
;; deltas can yield up to a ~1000ms loss, depending also on
;; `window-system' (PGTK builds seem least affected and NS/MAC the most).
(setq frame-inhibit-implied-resize t)
;; PERF: A fair bit of startup time goes into initializing the splash and
@ -432,14 +433,14 @@ users).")
(selected-frame) nil t))))
;; PERF: `load-suffixes' and `load-file-rep-suffixes' are consulted on each
;; `require' and `load'. Doom won't load any modules this early, so omit
;; .so for a tiny startup boost. Is later restored in doom-start.
;; `require' and `load'. Doom won't load any modules this early, so I omit
;; *.so for a tiny startup boost. Is later restored in `doom-start'.
(put 'load-suffixes 'initial-value (default-toplevel-value 'load-suffixes))
(put 'load-file-rep-suffixes 'initial-value (default-toplevel-value 'load-file-rep-suffixes))
(set-default-toplevel-value 'load-suffixes '(".elc" ".el"))
(set-default-toplevel-value 'load-file-rep-suffixes '(""))
;; COMPAT: Undo any problematic startup optimizations; from this point, I
;; make no assumptions about what might be loaded in userland.
;; COMPAT: Undo any problematic startup optimizations eventually, to prevent
;; incompatibilities with anything loaded in userland.
(add-hook! 'doom-before-init-hook
(defun doom--reset-load-suffixes-h ()
(setq load-suffixes (get 'load-suffixes 'initial-value)
@ -458,10 +459,10 @@ users).")
(setq custom-dont-initialize nil)))
;; PERF: The mode-line procs a couple dozen times during startup, before the
;; user can even see the first mode-line. This is normally fast, but we
;; can't predict what the user (or packages) will put into the mode-line.
;; Also, mode-line packages have a bad habit of throwing performance to
;; the wind, so best we just disable the mode-line until we can see one.
;; user even sees the first mode-line. This is normally fast, but we can't
;; predict what the user (or packages) will put into the mode-line. Also,
;; mode-line packages have a bad habit of throwing performance to the
;; wind, so best we just disable the mode-line until we can see one.
(put 'mode-line-format 'initial-value (default-toplevel-value 'mode-line-format))
(setq-default mode-line-format nil)
(dolist (buf (buffer-list))
@ -475,10 +476,9 @@ users).")
;; garbled after startup (or in case of an startup error).
(defun doom--reset-inhibited-vars-h ()
(setq-default inhibit-redisplay nil
;; Inhibiting `message' only prevents redraws and
inhibit-message nil)
(redraw-frame))
(add-hook 'after-init-hook #'doom--reset-inhibited-vars-h)
(remove-hook 'post-command-hook #'doom--reset-inhibited-vars-h))
(add-hook 'post-command-hook #'doom--reset-inhibited-vars-h -100)
;; PERF: Doom disables the UI elements by default, so that there's less for
;; the frame to initialize. However, `tool-bar-setup' is still called and
@ -497,9 +497,8 @@ users).")
(put 'site-run-file 'initial-value site-run-file)
(setq site-run-file nil)
(define-advice startup--load-user-init-file (:around (fn &rest args) undo-hacks)
(define-advice startup--load-user-init-file (:around (fn &rest args) undo-hacks 95)
"Undo Doom's startup optimizations to prep for the user's session."
(let (init)
(unwind-protect
(progn
(when (setq site-run-file (get 'site-run-file 'initial-value))
@ -508,18 +507,15 @@ users).")
(defun load (file &optional noerror _nomessage &rest args)
(apply load file noerror t args)))
(load site-run-file t t))))
(apply fn args) ; start up as normal
(setq init t))
(when (or (not init) init-file-had-error)
;; If we don't undo our inhibit-{message,redisplay} and there's an
;; error, we'll see nothing but a blank Emacs frame.
(doom--reset-inhibited-vars-h))
(apply fn args))
;; Now it's safe to be verbose.
(setq-default inhibit-message nil)
;; COMPAT: Once startup is sufficiently complete, undo our earlier
;; optimizations to reduce the scope of potential edge cases.
(advice-remove #'tool-bar-setup #'ignore)
(add-transient-hook! 'tool-bar-mode (tool-bar-setup))
(unless (default-toplevel-value 'mode-line-format)
(setq-default mode-line-format (get 'mode-line-format 'initial-value))))))
(setq-default mode-line-format (get 'mode-line-format 'initial-value)))))
;; PERF: Unset a non-trivial list of command line options that aren't
;; relevant to this session, but `command-line-1' still processes.
@ -540,14 +536,14 @@ empty. Each context describes what phase Doom is in, and may respond to.
All valid contexts:
cli -- while executing a Doom CLI
compile -- while byte-compilation is in progress
eval -- during inline evaluation of elisp
compile -- while byte-compiling packages
eval -- during interactive evaluation of elisp
init -- while doom is formally starting up for the first time, after its
core libraries are loaded, but before user config is.
modules -- while loading modules and their files
sandbox -- This session was launched from Doom's sandbox.
packages -- when packagedefs are being read
reload -- while reloading doom")
core libraries are loaded, but before $DOOMDIR is
modules -- while loading modules configuration files (but not packages)
sandbox -- This session was launched from Doom's sandbox
packages -- while a module's packages.el's file is being evaluated
reload -- while reloading doom with `doom/reload'")
(put 'doom-context 'valid-values '(cli compile eval init modules packages reload doctor sandbox))
(put 'doom-context 'risky-local-variable t)
@ -558,7 +554,9 @@ All valid contexts:
(list context "Unrecognized context" valid)))))
(defun doom-context-p (context)
"Return t if CONTEXT is active (i.e. in `doom-context')."
"Return t if CONTEXT is active, nil otherwise.
See `doom-context' for possible values for CONTEXT."
(if (memq context doom-context) t))
(defun doom-context-push (context)

View file

@ -7,8 +7,5 @@
(when (modulep! +childframe)
(package! flycheck-posframe :pin "19896b922c76a0f460bf3fe8d8ebc2f9ac9028d8")))
;; Flymake
(when (modulep! +flymake)
;; NOTE: remove when straight bumped to support nonGnuELPA
(package! popon :recipe (:repo "https://codeberg.org/akib/emacs-popon"))
(package! flymake-popon :recipe (:repo "https://codeberg.org/akib/emacs-flymake-popon")))

View file

@ -28,8 +28,10 @@ TAB/S-TAB.")
"If non-nil, prefer navigating org tables over cycling candidates with
TAB/S-TAB.")
;;
;;; Packages
(use-package! corfu
:hook (doom-first-input . global-corfu-mode)
:init

View file

@ -2,7 +2,6 @@
;;;###if (modulep! :tools lsp)
(defvar +format-lsp--last nil)
;;;###autoload
(define-minor-mode +format-with-lsp-mode
"Toggles `lsp-mode'/`eglot' integration with `apheleia-mode' in this buffer.

View file

@ -1,8 +1,12 @@
;;; tools/dired/config.el -*- lexical-binding: t; -*-
;;; emacs/dired/config.el -*- lexical-binding: t; -*-
(defvar +dired-dirvish-icon-provider 'nerd-icons
"Icon provider to use for dirvish when the module is enabled.")
;;
;;; Packages
(use-package! dired
:commands dired-jump
:init

View file

@ -18,7 +18,7 @@
;; HACK: The intro message changed in newer versions of Fava, plus, the output
;; could contain ANSI codes, causing the `beancount-fava' command to not
;; open the server in the browser after the server has started.
;; REVIEW: PR this uptsream!
;; REVIEW: PR this upstream!
(defadvice! +beancount--open-in-browser-after-starting-fix-a (_process output)
:override #'beancount--fava-filter
(save-match-data

View file

@ -255,11 +255,7 @@ If rtags or rdm aren't available, fail silently instead of throwing a breaking e
c++-mode-local-vars-hook
objc-mode-local-vars-hook
cmake-mode-local-vars-hook
;; HACK Can't use cude-mode-local-vars-hook because cuda-mode
;; isn't a proper major mode (just a plain function
;; masquarading as one, so your standard mode hooks won't fire
;; from switching to cuda-mode).
cuda-mode-hook)
cuda-mode-local-vars-hook)
:append #'lsp!)
(map! :after ccls

View file

@ -4,12 +4,12 @@
(package! cmake-mode
:recipe (:host github :repo "emacsmirror/cmake-mode" :files (:defaults "*"))
:pin "b08b5d9045308362a623a4f576896d55ffecfd52")
(package! cuda-mode :pin "7f593518fd135fc6af994024bcb47986dfa502d2")
(package! cuda-mode :pin "7dd07a20c36b41c8cb38cdec989673b73d03e144")
(package! demangle-mode :pin "04f545adab066708d6151f13da65aaf519f8ac4e")
(package! disaster :pin "16bba9afb92aacf06c088c29ba47813b65a80d87")
(unless (modulep! +tree-sitter)
(package! modern-cpp-font-lock :pin "43c6b68ff58fccdf9deef11674a172e4eaa8455c"))
(package! opencl-mode :pin "10ae7742d57ae79d96cf52753800b3490589b3f6")
(package! opencl-mode :pin "204d5d9e0f5cb2cbe810f2933230eb08fe2c7695")
(when (package! glsl-mode :pin "9b2e5f28e489a1f73c4aed734105618ac0dc0c43")
(when (modulep! :completion company)
@ -20,7 +20,7 @@
(if (modulep! +lsp)
(unless (modulep! :tools lsp +eglot)
;; ccls package is necessary only for lsp-mode.
(package! ccls :pin "8648238a92e5fd1ca1b693c99d2824f8804736b0"))
(package! ccls :pin "41399b0eba03f9b80769ced71501ba702db4cd62"))
(when (package! irony :pin "40e0ce19eb850bdf1f77225f11713cc816250d95")
(package! irony-eldoc :pin "73e79a89fad982a2ba072f2fcc1b4e41f0aa2978")
(when (and (modulep! :checkers syntax)
@ -29,7 +29,7 @@
(when (modulep! :completion company)
(package! company-irony :pin "b44711dfce445610c1ffaec4951c6ff3882b216a")
(package! company-irony-c-headers :pin "72c386aeb079fb261d9ec02e39211272f76bbd97")))
(when (package! rtags :pin "bd1c818a993aebdfa22053cdd816ef0e3df7cfa1")
(when (package! rtags :pin "f472b5d0a05270d5c93945b6a71771ab69068147")
(when (modulep! :completion ivy)
(package! ivy-rtags))
(when (modulep! :completion helm)

View file

@ -10,6 +10,7 @@
(defvar +clojure-load-clj-refactor-with-lsp nil
"Whether or not to include clj-refactor along with clojure-lsp.")
;;
;;; Packages

View file

@ -69,6 +69,7 @@
(set-company-backend! 'go-mode 'company-go)
(setq company-go-show-annotation t))
(use-package! flycheck-golangci-lint
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))

View file

@ -6,7 +6,7 @@
;;
;;; Common packages
;;; Packages
(after! haskell-mode
(setq haskell-process-suggest-remove-import-lines t ; warnings for redundant imports etc

View file

@ -132,5 +132,5 @@
(opam-switch-set-switch (tuareg-opam-current-compiler)))
(eval-when! (modulep! +tree-sitter)
(when (modulep! +tree-sitter)
(add-hook 'tuareg-mode-local-vars-hook #'tree-sitter!))

View file

@ -18,7 +18,9 @@
;; Visit files opened outside of Emacs in existing frame, not a new one
(setq ns-pop-up-frames nil)
;; sane trackpad/mouse scroll settings
;; Sane trackpad/mouse scroll settings. Also disables smooth scrolling because
;; it's disturbingly clunky and slow without something like
;; jdtsmith/ultra-scroll-mac.
(setq mac-redisplay-dont-reset-vscroll t
mac-mouse-wheel-smooth-scroll nil)

View file

@ -4,15 +4,6 @@
:commands eglot eglot-ensure
:hook (eglot-managed-mode . +lsp-optimization-mode)
:init
(defadvice! +eglot--ensure-available-mode-a (fn)
"Run `eglot-ensure' if the current mode has support."
:around #'eglot-ensure
(when (alist-get major-mode eglot-server-programs nil nil
(lambda (modes key)
(if (listp modes)
(member key modes)
(eq key modes))))
(funcall fn)))
(setq eglot-sync-connect 1
eglot-autoshutdown t
;; NOTE: We disable eglot-auto-display-help-buffer because :select t in

View file

@ -5,6 +5,9 @@
"Dispatch to call the currently used lsp client entrypoint"
(interactive)
(if (modulep! +eglot)
(when (require 'eglot nil t)
(if (eglot--lookup-mode major-mode)
(eglot-ensure)
(eglot--message "No client defined for %s" major-mode)))
(unless (bound-and-true-p lsp-mode)
(lsp-deferred))))

View file

@ -227,7 +227,10 @@ Only has an effect in GUI Emacs.")
(:map magit-status-mode-map
:nv "gz" #'magit-refresh)
(:map magit-diff-mode-map
:nv "gd" #'magit-jump-to-diffstat-or-diff))
:nv "gd" #'magit-jump-to-diffstat-or-diff)
;; Don't open recursive process buffers
(:map magit-process-mode-map
:nv "`" #'ignore))
;; A more intuitive behavior for TAB in magit buffers:
(define-key! 'normal

View file

@ -163,6 +163,7 @@ used.
\(fn PREDICATE &key IGNORE ACTIONS SIDE SIZE WIDTH HEIGHT SLOT VSLOT TTL QUIT SELECT MODELINE AUTOSAVE PARAMETERS)"
(declare (indent defun))
(push (+popup-make-rule predicate plist) +popup--display-buffer-alist)
;; TODO: Don't overwrite user entries in `display-buffer-alist'
(when (bound-and-true-p +popup-mode)
(setq display-buffer-alist +popup--display-buffer-alist))
+popup--display-buffer-alist)