Commit Graph

57 Commits

Author SHA1 Message Date
87b616e5d8 refactor!: remove rainbow-delimiters
BREAKING CHANGE: parentheses will no longer be colored by depth. No
substitute is provided because it's trivial for users to install
themselves.

Ref: https://github.com/orgs/doomemacs/projects/5/views/1?pane=issue&itemId=117610828
2025-06-29 18:53:40 +02:00
5cb34fa151 refactor!: remove highlight-numbers
BREAKING CHANGE: Numerics will no longer be syntax highlighted in major
modes that don't already have their own (or provided by tree-sitter). No
substitute will be provided because it's trivial for the user to install
themselves.

Ref: https://github.com/orgs/doomemacs/projects/5/views/1?pane=issue&itemId=117610783
2025-06-29 18:53:40 +02:00
1681bfbaf0 refactor: move doom-highlight-non-default-indentation-h out of core
This functionality falls under the umbrella of "better defaults" rather
than essential defaults, and so belongs in :config default.

Whats more, the naming convention (+emacs-...) was intentional, because
this function (and the :config default module) will be moved to :doom
emacs in the near future.

This also indirectly fixes #8373.

Fix: #8373
2025-04-23 20:22:25 -04:00
d8b36d8b17 fix: use-dialog-box only on android
Accidentally negated the check in 6a44a2e.

Amend: 6a44a2ea80
2025-04-15 19:03:31 -04:00
6a44a2ea80 tweak: use GUI dialogs on android
It's better UX on touch screens, at least.
2025-04-14 15:01:03 -04:00
5020d592da fix: tooltip-resize-echo-area = t
Since we disable tooltip-mode, the echo-area should expand to display
multi-line output, to be consistent with our default for
resize-mini-windows. This also fixes the truncation of annotations in
PDF buffers (#1615).

Fix: #1615
2025-04-05 02:14:54 -04:00
5fae69b7bf docs: docstring & comment revisions
For `undefadvice!`, `doom-load-theme-hook`, and the `ws-butler` package.
2025-04-02 19:04:11 -04:00
625b793218 fix: over-aggressive doom--run-switch-frame-hooks-fn
Due to a typo in the hook's self-removal, causing this function to
trigger many times per second. It isn't doing much thanks to the
debouncing, but was still legitimately triggering doom-switch-frame-hook
every ~2 seconds despite no change in frame focus.

Also removes the ineffectual inhibit-redisplay let-bind.

Amend: 653b465c74
2025-04-02 19:03:51 -04:00
98273b639b fix: recursive redisplay error from doom-switch-frame-hook
If a function on doom-switch-frame-hook triggered a redisplay, it could
cause infinite recursion.

Amend: 653b465c74
2025-04-02 06:36:27 -04:00
653b465c74 refactor: doom-switch-frame-hook
Redesign this hook around `after-focus-change-function`, along with
debouncing, to prevent it from triggering too aggressively (due to
misbehaving desktop environments, elisp packages that tinker with frame
focus, or accidental (and rapid) focus changes by the user).

`doom-switch-{window,buffer}-hook` have also been simplified, and
`doom-switch-window-hook` now will not trigger when focusing another
frame (only when you switch windows *within* any one frame).

This also fixes diff-hl not updating when refocusing an Emacs frame.
2025-04-02 03:17:29 -04:00
dac6e05b87 refactor: deprecate appendq!, prependq!, & delq! macros
In the interest of slimming down Doom's core (as we near v3), I've
deprecated these macros. They doesn't really need to exist. Sure, the
alternatives aren't as ergonomic or elegant, but they're good enough
that we don't need these trivial wrappers. Their local uses have been
refactored out as well.
2025-03-25 14:16:56 -04:00
38868c79f5 fix: ignore doom-theme if load-theme is used
Users shouldn't be using both, and `load-theme` should be higher
priority (because it's easier to do by accident).

Fix: #8257
Amend: #8119
Amend: 50b9afbb2d
2025-02-21 15:17:42 -05:00
93ef81bfd4 fix: don't prompt to save non-file buffers
Fix: #8241
2025-01-14 02:47:50 -05:00
311ad23fd4 fix: void-function (setf plist-get) error
Only affected users on Emacs 27, before a generalized setter was defined
for `plist-get`.

Amend: 50b9afbb2d
2025-01-13 12:36:05 -05:00
50b9afbb2d refactor: swap load-theme advice for enable-theme-functions
Instead of advising load-theme, which was more opinionated, and broke in
instances where users (relying on `custom-enabled-themes`s setter) or
packages (like auto-dark) were enabling themes with `enable-theme`
instead of `load-theme`.

This also adds support for enabling multiple themes with `doom-theme`.

Fix: #8119
2025-01-08 19:33:33 -05:00
9359a81e81 fix: gui frames fail to open from emacsclient
This was a tricky regression to track down. 9753bfb tries to fix an
issue where the `default` face's :foreground changes to `#000000` in any
new frames created after the initial one (by calling `make-frame`),
because those frames' `background-color` and `foreground-color`
parameters default to "#000000" (possibly a bug with `disable-theme` too
eagerly defaulting them to black).

240493a replaces that with new, seemingly cleaner approach: setting
`frame-inherited-parameters`, which instructs `make-frame` to copy those
parameters from the last open frame, however, those parameters in the
initial daemon frame will be set to "unspecified-bg" or
"unspecified-fg" (see the docstring for `face-{back,fore}ground`), which
are invalid color strings. `make-frame` crashes tries to create a frame
with those color values, causing #8059.

Fix: #8059
Amend: 240493ae92
Amend: 9753bfb775
2024-09-12 06:06:25 -04:00
771fccc52b nit: minor reformatting & revision
Also corrects the version string of obsolete variable `+mu4e-backend`.
2024-09-11 19:46:14 -04:00
a8515034de refactor: rename childframe predicate function
- The name reflected the opposite of what it detected.
- It should be treated as an internal (not public) function.
2024-09-11 19:46:14 -04:00
240493ae92 fix: face-* calls crashing new emacsclient frames
Those `face-*` calls sometimes returned nil, causing new frames spawned
from emacsclient to quietly crash sometimes. By instead relying on
`frame-inherited-parameters` we achieve the same but more stable result.

Amend: 9753bfb775
2024-09-11 19:46:14 -04:00
86b7bef512 fix: type error if default returns nil :foreground/:background
Ref: #8059
2024-09-10 17:20:16 -04:00
9753bfb775 fix: {back,fore}ground-color in subsequent frames
New frames created after the first get initialized with #000000 as their
{back,fore}ground-color parameters, for some reason, making text
unreadable in dark themes.
2024-09-07 01:05:57 -04:00
6d9a7e9a8f fix: over-aggressive deactivation of hl-line-mode
`(de?)activate-mark-hook` is triggered a little too often in too many
edge cases where the user isn't interactively selecting a region. One
annoying edge case has non-evil motions used on evil operators
activating but not deactivating the mark (e.g. #8047).

This leaves non-evil users without the nicety of hl-line auto-disabling
itself when the region is active, but I'll revisit that in v3.0, when
most of these package defaults are moved out to modules.

Fix: #8047
2024-09-05 15:30:22 -04:00
dc035a652f fix: reset inhibit-* vars a mote more aggressively
There are still a few edge cases where inhibit-redisplay is never
reset (usually involving errors at startup), leaving Emacs as a blank
screen until the user performs an action that forces it to redraw (e.g.
pressing M-x). This tries to address more of those.
2024-08-15 15:45:53 -04:00
12dc195774 fix: kill-current-buffer: respect kill-buffer-query-functions
This advice is intended to fake the death of buffers that are visible in
other windows, and prevent Emacs from switching to a non-real buffer
after it's killed/buried. It shouldn't even try to do any of this if
`kill-buffer-query-functions` fails, even if it is a fake death.
2024-07-11 15:22:12 -04:00
fe0548e820 tweak: unbind SPC in y-or-n-p prompts
SPC is equivalent to y when y-or-n-p prompts you, which seems way too
easy to hit by accident, especially with our leader key being (or
involving) SPC by default.
2024-07-09 21:53:50 -04:00
a24ff58a5a fix(lib): don't kill buffers visible in another frame
For Doom's kill-current-buffer advice.
2024-06-26 23:21:06 -04:00
b405225b90 refactor!(vc-gutter): drop git-gutter for diff-hl
BREAKING CHANGE: This removes git-gutter as an implementation for the
`:ui vc-gutter` module, leaving only the diff-hl implementation. There
are no longer any +git-gutter or +diff-hl flags for this module. Users
don't have to do anything to keep the vc gutter, unless they prefer
git-gutter for any reason (in which case they'll need to install and set
it up themselves).

This has been planned for some time, because of a roadmap goal for Doom
to lean into native/built-in functionality where it's equal or better
than the third party alternatives. diff-hl relies on the built-in vc.el
library instead of talking to git directly (thus expanding support to
whatever VCS's vc.el supports, and not git alone), which also means it
can take advantage of its caching and other user configuration for
vc.el. Overall, it is faster and lighter.

What I've also been waiting for was a stage-hunk command, similar to
git-gutter:stage-hunk, which arrived in dgutov/diff-hl@a0560551cd and
dgutov/diff-hl@133538973b, and have evolved since.

Ref: dgutov/diff-hl@a0560551cd
Ref: dgutov/diff-hl@133538973b
Ref: https://github.com/orgs/doomemacs/projects/5/views/1?pane=issue&itemId=58747789
2024-06-22 18:14:04 -04:00
da3d0687c5 fix: doom-init-fonts-h: don't run more than needed
The face and theme-face manipulation only needs to happen once per
frame, and the `set-fontset-font` calls only need to happen once per
session (or whenever the user calls `M-x doom/reload-fonts`). This
change ensures this and saves Emacs some work when initializing new
frames, as well as resolves `set-fontset-font` related segfaults in some
edge cases (#7803).

Fix: #7803
2024-04-09 03:14:08 -04:00
8d370d5608 refactor: doom--last-frame: remove unused symbol
Its last reference was removed in e889b2c. Not sure why this stuck
around for so long.

Ref: 0bb4d4dfcb
2024-04-04 23:46:07 -04:00
6b55c6adc6 refactor: inline doom--make-font-specs
This function isn't (and won't be) used anywhere else. No reason for it
to be its own function.
2024-03-19 20:47:21 -04:00
c20c2aa36e 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
2024-03-13 11:02:12 -04:00
645c856de0 fix(popup): allow killing popup buffers
Currently, `SPC b k` does not allow us to kill popup buffers. If we are
say using a comint/eshell/eat buffer and we borked the state while
testing hooks or we sent EOF to the underlying process, our intention
with `SPC b k` is to kill the underlying buffer.
2024-03-05 01:14:38 -05:00
98d753e103 fix: blank frame on can't-find-font error during startup
Due to our inhibit-redisplay hack, a missing font could lead to a blank
Emacs after startup. This change fixes that so that not only is an error
emitted when Emacs can't find your font, but the error will be a little
more readable.

This is a stopgap solution until I finish a better one I'm preparing for
v3.

Fix: #7055
2024-02-20 05:37:28 -05:00
edd95854fd fix: premature use of emoji fontset in <=28.1
317cea5 assumed Emacs 28, but Doom still tries to support 27.
Attempting to use the undefined emoji script on 27 results in an error.
Prior to 28, emoji are part of the symbol script, which the following
`set-fontset-font` call already handles.

Amend: 317cea5eef
Ref: #7448
Fix: #7505
2023-11-23 18:17:52 -05:00
986398504d refactor: defvar -> defcustom
Ref: 8c442d84b9
2023-10-07 02:33:45 +02:00
b42882c545 refactor: make fallback font families constant
These are undocumented internal variables for basic platform-specific
fallbacks. Now that doom-symbol-font and doom-emoji-font exist, make
them constant.
2023-10-07 02:33:45 +02:00
7abed4dbf1 fix: fall back to emoji font for symbols
Symbols fonts vary widely in their coverage of Unicode symbols blocks.
Emoji fonts are generally guaranteed to cover the small subset of
symbols code points that have assigned emoji representations, so fall
back to them when symbols fonts are lacking.

Ref: https://en.wikipedia.org/w/index.php?title=Variant_form_(Unicode)&oldid=1175107681#Blocks_with_standardized_variation_sequences
2023-10-07 02:33:45 +02:00
37affa5cff feat: add doom-emoji-font
This parallels doom-symbol-font for emoji. In the process, refactor
symbol and emoji font setup to take advantage of these parallels.
2023-10-07 02:33:45 +02:00
4499ce7b0a refactor: doom-unicode-font -> doom-symbol-font
No font supports all of Unicode or anywhere near it. It’s not even
really possible with current font formats. Therefore, rename
`doom-unicode-font` to `doom-symbol-font`. Only set it as a fallback for
characters in the `symbol` and `mathematical` scripts.
2023-10-07 02:33:45 +02:00
1cc7b04059 docs: clarify doom-unicode-font default
d4dec35658 removed Apple Color Emoji, and it wasn’t clear how Symbola
was set if this variable was nil.
2023-10-07 02:33:45 +02:00
317cea5eef fix: assign emoji fallbacks directly to emoji script
Ref: https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=12d2fb58c416b557924174f57bfb1c9b9e7cf999
2023-10-07 02:33:45 +02:00
5e6430e9e6 fix: assign Nerd Fonts directly to Unicode PUAs
Nerd Fonts assign icons to code points in these Unicode Private Use
Areas. `doom-unicode-font` is now available again as a user-defined
fallback of last resort for non-PUA Unicode code points.

Ref: f12c615e4d (overview)
2023-10-07 02:33:45 +02:00
f5be3ec1e5 fix: use ansi-color-compilation-filter on emacs28+
I'm using Emacs30 and on my version,
doom-apply-ansi-color-to-compilation-buffer-h does not colorize all the
escape sequences. Using ansi-color-compilation-filter instead fixes this
for me.
2023-10-05 17:44:08 +02:00
9787022b83 refactor!: replace all-the-icons with nerd-icons
BREAKING CHANGE: This commit replaces all-the-icons with nerd-fonts. Any
all-the-icons-* function calls or variable references in your private
config will break and should be replaced with their nerd-icons-*
equivalent. That said, Doom will continue to install all-the-icons for
a while, so feel free to load it if you don't want to fully commit to
the change yet.

This change is happening because nerd-icon has wider support for GUI and
TUI Emacs; has a larger, more consistent selection of symbols; plus unicode
coverage.

Fix: #7368
Close: #6675
Close: #7364
2023-09-14 01:03:55 +02:00
f427c8a30e tweak: scroll-conservatively = 10
Forces the window to recenter if the cursor moves >=10 lines off-screen.
This makes some of our manual recentering elsewhere unnecessary.
2023-09-11 23:53:36 +02:00
a2b02942f8 fix: void-function set-fontset-font error
Due to some packages and modules using this in some (non-GUI) builds of
Emacs. display-graphic-p isn't enough here, so rather than police all
the possible offenders, I've defined it to no-op in those cases,
instead.

Close: #6876
2022-10-29 01:57:42 +02:00
ffad2bc49e perf: move doom-init-ui-h to window-setup-hook
This has little effect on startup time now, but seems to buy 100-200ms
with some 3.0 optimizations that will come soon.
2022-09-24 22:10:02 +02:00
c5de95f722 perf: defer init for frame's buffer-predicate
Ensures that it doesn't pull in the buffer library so early in the
startup process, or gets called prematurely.
2022-09-20 02:29:14 +02:00
195359cf99 fix: properly disable tooltip-mode
In 4a25375, it seemed that only setting the variables to nil early
enough would be sufficient, but this turned out not to be the case.
There's no avoiding calling the mode to disable it.

Ref: 58c0de6841
Amend: 4a253757cb
2022-09-18 10:36:00 +02:00
41051f4761 fix: disable UI elements earlier
Moves this from doom-ui to doom-start, since there is more savings to be
had if this is done early.

Also moves the menu-bar fix for macos out of the :os macos module into
doom-start, because it is a fix (and for a Doom optimization) and not a
feature, so it shouldn't be behind a module.
2022-09-16 01:14:23 +02:00