Commit graph

761 commits

Author SHA1 Message Date
Henrik Lissner
7d0d90ec50
revert: refactor(lib): remove doom-apply-ansi-color-to-compilation-buffer-h
ansi-color-compilation-filter wasn't introduced until Emacs 28, so this
removal was too hasty, but should be reconsidered when we drop 27.x
support.

Fix: #6515
Revert: 2f7171bf8a
2022-06-29 18:14:21 +02:00
Henrik Lissner
1402db5129
refactor: how Doom starts up
Restructures Doom's primary core files and entry points to prepare for
backports (from the new CLI) coming soon.

- Removes $EMACSDIR/init.el.
- Doom configures Emacs to ignore ~/.emacs and ~/_emacs files.
- Doom's bootstrapper for interactive sessions was moved out of core.el
  and doom-initialize into doom-start.el. This change is preparation for
  Doom's new profile system (coming soon™️), where this bootstrapper
  will be dynamically generated.
- core.el and early-init.el have been reorganized, comment headers moved
  around, and comments updated to reflect these changes.
2022-06-18 16:54:45 +02:00
Henrik Lissner
2f7171bf8a
refactor(lib): remove doom-apply-ansi-color-to-compilation-buffer-h
Is redundant with ansi-color-compilation-filter.

Ref: aec4fbe590
2022-06-17 18:21:23 +02:00
Henrik Lissner
76e6dcd550
refactor: replace yes-or-no-p advice w/ use-short-answers
This option was introduced in 28.1.
2022-05-27 00:35:37 +02:00
Henrik Lissner
8c03fa0e3d
fix: set face :font instead of frame font parameter
Information is lost when converting font-spec's to xlfd strings (mainly,
DPI), in order to make them compatible with the face frame parameter. To
avoid this, we set the faces' :font attribute instead, which natively
accept font specs, xlfd strings, font objects, and xft strings; no
conversion necessary.

Fix: #6131
2022-04-21 22:36:36 +02:00
Henrik Lissner
6185767c41
refactor(eshell,term): move hscroll-margin settings
...out of core and into their respective modules. A tiny step toward
thinning out core.
2022-03-31 14:05:45 +02:00
Anh T Nguyen
4eda9329aa
feat(dired): allow global hl-line in dired-mode 2022-03-19 16:41:05 +01:00
Henrik Lissner
4a6de2419c fix: run switch-buffer hooks on server-visit-hook
window-buffer-change-function does not trigger on the first buffer
displayed in a new client frame.

Fix: #6058
2022-01-29 19:41:16 +01:00
Henrik Lissner
eefa0ec0aa fix: global whitespace-mode never activating
Fix: #5856
Fix: #5854
2021-12-02 04:13:15 +01:00
Daanturo
d67060eda4 fix: use advise-add instead of fset to override yes-or-no-p
So that reverting it becomes easier.
2021-11-18 19:09:09 +01:00
Henrik Lissner
4eeb3c7a19 fix: wrong-number-of-args error on font init
set-frame-font's fourth argument was introduced in 28 and shouldn't be
used yet.

Fix 2614df72bd
2021-10-10 21:40:53 +02:00
Henrik Lissner
114841bfd2 refactor: defer UI init a little longer at startup
Fixes a regression introduced in 0bb4d4dfc, which changed how
doom-switch-buffer-hook works, but makes it fire too early during
startup, eagerly loading packages that wait for the first interactively
opened buffer. This moves doom-init-ui-h to
window-buffer-change-functions, which fires once at the end of startup,
when any buffer is displayed for the first time in the session.

Ref 0bb4d4dfcb
2021-10-10 18:58:32 +02:00
Henrik Lissner
0bb4d4dfcb refactor: switch buffer/frame/window hooks
Emacs 27 introduced a bunch of `window-*-change-functions` hooks,
including `window-selection-change-functions` and
`window-buffer-change-functions`, which handles 98% of the use case for
Doom's `doom-switch-{buffer,window,frame}-hook` hooks, so I've rewritten
them to use them under the hood, which amounts to simpler code and fewer
hacks.
2021-10-10 18:36:46 +02:00
Henrik Lissner
2614df72bd refactor: font, theme, & UI init
Use the new server-after-make-frame-hook, introduced in Emacs 27.1, to
clean up how we initialize fonts, themes, and the UI in general.

This may indirectly fix font issues in daemon sessions.
2021-10-10 18:36:46 +02:00
Henrik Lissner
f5c1332a31 refactor: minor refactors & nit picks across core 2021-10-10 18:36:46 +02:00
Henrik Lissner
1ebac6f798 fix: fonts not scaling in childframes
On doom/increase-font-size and doom/decrease-font-size.

Fix #5591
2021-10-06 23:38:11 +02:00
Henrik Lissner
fbfa144347 docs: update doom-theme variable docstring
This variable no longer accepts 'default to load no theme. Set it to nil
instead.

Ref #5535
2021-09-29 18:34:21 +02:00
Henrik Lissner
06392a723f refactor: rename orig-fn arg in advice to fn
A minor tweak to our naming conventions for the first argument of an
:around advice.
2021-08-04 01:53:12 -04:00
Henrik Lissner
57026c4b70 Fix #5169: x-underline-at-descent-line = nil
Looks weird when line-spacing is non-zero.
2021-07-08 15:20:22 -04:00
Henrik Lissner
044a1a5f2b Drop Emacs 26.x support
Emacs 27.x has been the stable version of Emacs for nearly a year, and
introduces a litany of bugfixes, performance, and quality-of-life
improvements that significantly reduce Doom's maintenance burden (like
XDG support, early-init.el, image manipulation without imagemagick, a
native JSON library, harfbuzz support, pdumper, and others).

With so many big changes on Doom's horizon, I like having one less (big)
thing to worry about.

Also reverts bb677cf7a (#5232) as it is no longer needed.
2021-07-06 02:31:52 -04:00
Henrik Lissner
a2871e68ed Warn about :size in doom-unicode-font docstring 2021-06-05 13:12:00 -04:00
Henrik Lissner
19203a91a3 Unset :weight, :slant, :width on font faces
Setting a face's `:font` attribute implicitly sets a host of other faces
attributes (:family, :foundry, :width, :weight, :height, and :slant),
which is problematic in places where these faces are used in tandem with
other faces, like how EWW renders bold elements with both
variable-pitch+bold faces, with the expectation that their attributes
would cascade properly, but not so if variable-pitch sets :weight or
:slant.
2021-06-04 01:35:59 -04:00
Henrik Lissner
0d9b4a7da0 Trigger doom-switch-buffer-hook on kill-current-buffer
Fixes the dashboard not loading when killing a file opened at
startup, i.e. `emacs FILE1` and landing in *doom*.
2021-05-28 16:26:25 -04:00
Henrik Lissner
d99a102a6b rainbow-delimiters-max-face-count = 4 2021-05-26 16:19:07 -04:00
Henrik Lissner
3ba364ae10 Minor refactoring across the board 2021-05-23 22:09:07 -04:00
Henrik Lissner
5aea22ec31 Prevent custom from writing font settings to custom.el
Otherwise it tries to write unreadable forms to custom-file, causing
invalid-read errors at startup.
2021-05-22 16:01:01 -04:00
Henrik Lissner
4397f0123f Fix custom{,theme-}set-faces!, again
custom-theme-set-faces! depends on doom-theme's previous-theme property
being non-nil to determine if the theme has been set (and if so, apply
its changes immediately), but at startup custom-enabled-themes is empty,
so it was never non-nil.

Fixes #5009
Fixes #5000
2021-05-10 16:05:19 -04:00
Henrik Lissner
33e7f081a7 Restore hl-line-sticky-flag defaults
There are some modes that expect he highlight to be visible across
windows (like treemacs or mu4e). The performance benefit is negligible
anyhow.
2021-05-09 20:50:23 -04:00
Henrik Lissner
cebbd76f3d Revert to 'user theme
Trying to get 'doom to behave like 'user is too much trouble and causes
too many problems. The magic around 'user is too deeply woven into
custom.el. The whole custom.el fiasco needs to be dealt with another
way.

Fixes #5000
Fixes #5009
2021-05-09 20:50:23 -04:00
Henrik Lissner
8f3b798620 Fix #5000: ensure 'doom always has precedence
'doom is a pseudo theme used to store internal faces and variables, and
must have the highest precedence (like the 'user theme, but without the
risk of being written to custom-file).
2021-05-09 01:23:42 -04:00
Henrik Lissner
f3c496d295 Fix #5009: custom-{,theme-}set-faces\! at startup
An erroneous check preventing these macros from taking effect any other
time but before your doom-theme has loaded.
2021-05-08 13:53:55 -04:00
Henrik Lissner
f989bf60f0 Rewrite how themes are loaded, and fonts reloaded
A follow-up to 578dddd, which wasn't sufficient.

Fixes #5000 (again)
2021-05-08 00:42:06 -04:00
Henrik Lissner
578dddd3fe Fix #5000: bad load order for auxiliary fonts
doom-unicode-font, doom-variable-pitch-font, and the fontset settings
were loaded in the wrong order (before the theme, but should be after).
This means the psuedo 'doom' theme that stores these settings are being
loaded too early.
2021-05-07 14:17:04 -04:00
Henrik Lissner
e2a11d24fd core: minor refactors and comment revisions 2021-05-06 18:36:32 -04:00
Henrik Lissner
a98c2ece63 Fix #4992: set-fontset-font call when unavailable
Missed a guard on a set-fontset-font call in d4dec3565's refactors.
2021-05-06 18:36:32 -04:00
Henrik Lissner
d4dec35658 Improve unicode, emoji, & symbol font support
+ Adds doom-emoji-fallback-font-families
+ Adds doom-symbol-fallback-font-families
+ Gives doom-unicode-font higher precedence (and sets it to nil by
  default, since Emacs defaults to symbola already).
+ Store custom face settings in psuedo theme, rather than crowding the
  user theme (which may be immortalized to custom-file, which we want to
  avoid).
+ Now, after-setting-font-hook is guaranteed to fire after *all* fonts
  are set, giving you a more reliable interface to add your own
  font(set) modifications.

More testing is needed to ensure the patched fonts our ligatures modules
don't conflict with this change.
2021-05-06 04:27:33 -04:00
Henrik Lissner
ff64a9d106 Add doom-run-hooks
Produces more helpful (and harder-to-miss) error messages when a hook
emits an error. Also advises run-hook when doom-debug-mode is active, so
errors in hooks (generally, major mode hooks) don't quietly go
unnoticed.
2021-05-06 04:27:33 -04:00
Henrik Lissner
623127597f Disable minibuffer error silencer hack in Emacs 27+
In older versions of Emacs (26.3 and below), the minibuffer would
replace the whole minibuffer's contents just to display error messages.
This was very frustrating for mundane errors, like the "text is
read-only" error you get when you press backspace at BOL.

Later versions of Emacs now display errors at the end of the minibuffer,
so this hack will no longer be needed when we drop 26.x support later
this year.
2021-05-06 04:27:32 -04:00
Henrik Lissner
9ef11d0e31 Auto-truncate compilation buffers
To prevent memory issues in long lived processes.

Allows #4261 to be merged
Addresses (and mentioned in) asok/projectile-rails#148
2021-02-26 21:33:00 -05:00
Henrik Lissner
47925933df Fix "Can't set ASCII font to nil" error in daemon
Caused because the :ui unicode module sets doom-unicode-font to nil,
then doom-init-extra-fonts-h tries to use it.
2021-02-17 14:20:37 -05:00
Henrik Lissner
c3c001ad7d Bump core
domtronn/all-the-icons.el@c795d0f -> domtronn/all-the-icons.el@5fa7283
hlissner/emacs-so-long@ed666b0 -> emacs-straight/so-long@a5d445d
jwiegley/use-package@365c73d -> jwiegley/use-package@317137b
raxod502/straight.el@ac4df5c -> raxod502/straight.el@f2cb888

+ Complain if :no-byte-compile, :no-native-compile, or :no-build are
  used in package!. Straight replaced them with :build (and the old
  :build was renamed to :pre-build). See raxod502/straight.el@6a273d1
+ Update getting_started.org to mention :build
+ Switch to emacs-straight/so-long so I don't have to maintain my mirror
  anymore.
2021-02-04 07:32:26 -05:00
Henrik Lissner
3a4f182a3c Revise core docstrings & comments 2021-01-27 03:36:53 -05:00
Henrik Lissner
614dc93569 mouse-wheel-scroll-amount-horizontal = 2
Make hscrolling a little faster. Our windows and displays are large.
Scrolling one character at a time is too slow.
2021-01-27 02:50:39 -05:00
Henrik Lissner
454c4132d4 Slower mouse-wheel and re-enable acceleration
This improves the illusion of faster scrolling.
2021-01-27 02:50:36 -05:00
Henrik Lissner
6d2b9ff100 Enable hl-line-mode in org-agenda-mode
Closes #4567
2021-01-27 02:50:19 -05:00
Henrik Lissner
8cd7a1dbc6
Fix doom-unicode-font 2021-01-11 02:41:28 -05:00
Henrik Lissner
8c258c272d
Update comments 2021-01-11 02:41:14 -05:00
Henrik Lissner
5cb2395e08
Set custom-theme-directory in core-ui 2021-01-10 08:07:27 -05:00
Henrik Lissner
cfb8a866dc
Bump :core
Fuco1/smartparens@7f5825d -> Fuco1/smartparens@63695c6
bbatsov/projectile@d1cfad0 -> bbatsov/projectile@c31bd41
domtronn/all-the-icons.el@6917b08 -> domtronn/all-the-icons.el@9aa16ae
iqbalansari/restart-emacs@e570749 -> iqbalansari/restart-emacs@1607da2
jscheid/dtrt-indent@a7ade6d -> jscheid/dtrt-indent@854b9a1
justbur/emacs-which-key@ca268fd -> justbur/emacs-which-key@428aedf
jwiegley/use-package@caa92f1 -> jwiegley/use-package@365c73d
raxod502/straight.el@3277e1c -> raxod502/straight.el@a32c97c

+ Closes #4513
+ Fixes (wrong-number-of-arguments (3 . 4) 2) error for users on Emacs
  HEAD (see bbatsov/projectile#1635).
+ package! :build semantics have changed due to upstream changes. What
  was :build is now :pre-build. What was :no-build is now :build nil.
+ Now we must be careful not to auto-disable the "use-package" psuedo
  theme. It is used as a place to store :custom assignments without them
  being saved to custom.el.
2021-01-09 02:55:09 -05:00
Henrik Lissner
5da3641aad
Move init.el to early-init.el
Our first step toward dropping 26.x support. Allows our optimizations to
reach a little further into the startup.
2021-01-09 02:55:08 -05:00