Commit graph

17686 commits

Author SHA1 Message Date
Henrik Lissner
4c9df9bfc6
fix: partially revert OS detection changes
These changes snuck into ad6a3d0, but have not been implemented yet, so
some OS-specific functionality was orphaned.

Amend: ad6a3d0f33
2022-08-18 17:08:16 +02:00
Henrik Lissner
8b4f722fa3
docs(lib): update after! to reflect changes upstream
It used to be that after! suppressed macro expansion, but at some point
around 28.1, the elisp interpreter started recognizing the
compiler-macro hint in eval-after-load's definition; implicitly wrapping
quoted forms in a function. Therefore, we can no longer rely on
eval-after-load to hide macros from the byte-compiler. Instead, modules
will need to take care to wrap macro calls in `eval` or similar, on a
case-by-case basis.
2022-08-18 16:27:57 +02:00
Henrik Lissner
a7e147088c
fix(cli): void-variable test error on Emacs 27.x
map.el integration for pcase wasn't introduced until 28.1; it was
premature to use it while we support 27.x.
2022-08-18 16:14:06 +02:00
Henrik Lissner
050624d475
fix(lib): nested interpolation & order of args for fn! macro
This fixes a couple bugs with this macro:

- Nested %-refs (in nested fn!'s) were interpolated as arguments of the
  outer-most fn!. E.g. (fn! (fn! %2)) would expand to:

  Before this fix:

    (lambda (_%1 %2)
      (lambda (_%1 %2)
        %2))

  After this fix:

    (lambda ()
      (lambda (_%1 %2)
        %2))

- Unused arguments were not only listed in the wrong order, they were
  off-by-one. E.g.

    (fn! %3 %5) expands to (lambda (_%4 _%3 %3 _%1 %5) %3 %5)

  This never caused any actual issues, but it was unexpected.

I've also moved the lookup table to `fn!`, and removed unnecessary
entries from it.
2022-08-15 22:12:45 +02:00
Henrik Lissner
e0385052a8
fix: void-function file-name-concat on Emacs 27
Amend: 05b344a852
2022-08-14 20:44:47 +02:00
Henrik Lissner
401a5aa530
refactor(docs): move doom-docs-dir to lib/docs.el
This is not an essential core variable, so it should be defined where it
used, instead.
2022-08-14 20:43:36 +02:00
Henrik Lissner
b943e4d73a
nit: add REVIEW tag for startup-redirect-eln-cache
startup-redirect-eln-cache adds the new directory and removes
$EMACSDIR/eln-cache from native-comp-eln-load-path, but it's not
available in 28.1, so we'll have to wait until Doom drops 28.1 support
to use it.
2022-08-14 20:43:36 +02:00
Henrik Lissner
aa54383b5d
refactor: deprecate doom-etc-dir for doom-data-dir
doom-etc-dir will be renamed to doom-data-dir, to better reflect its
purpose, and align it with XDG_DATA_HOME (where it will be moved to in
v3, where Doom will begin to obey XDG directory conventions more
closely).
2022-08-14 20:43:35 +02:00
Henrik Lissner
a5c80fcb4b
refactor: deprecate doom-private-dir for doom-user-dir
- Deprecates the doom-private-dir variable in favor of doom-user-dir.
- Renames the pseudo category for the user's module: :private -> :user.
- Renames the doom-private-error error type to doom-user-error.

Emacs uses the term "user" to refer to the "things" in user space (e.g.
user-init-file, user-emacs-directory, user-mail-address, xdg-user-dirs,
package-user-dir, etc), and I'd like to be consistent with that. It also
has the nice side-effect of being slightly shorter. I also hope
'doom-user-error' will be less obtuse to beginners than
'doom-private-error'.
2022-08-14 20:43:35 +02:00
Henrik Lissner
ad6a3d0f33
refactor: deprecate featurep! for modulep!
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.

featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
2022-08-14 20:43:35 +02:00
Henrik Lissner
0407621aff
refactor: deprecate EMACS2[89]+, NATIVECOMP, MODULES
To reduce redundancy, remove the maintenance hassle that version
constants would impose later on, and rely on built-in
facilities (featurep) more over global variables or doomisms, these
global constants have been deprecated in favor of Emacs "features":

- EMACS28+   -- replace with (> emacs-major-version 27)
- EMACS29+   -- replace with (> emacs-major-version 28)
- NATIVECOMP -- replace with (featurep 'native-compile)
- MODULES    -- replace with (featurep 'dynamic-modules)

(These constants will be formally removed when v3 is released. The IS-*
constants are likely next, but I haven't decided on their substitutes
yet)

I also decided to follow native-compile's example and provide features
for Emacs' system features (since system-configuration-features' docs
outs itself as a poor method to detect features):

- dynamic-modules
- jansson
- native-compile -- this one already exists, but will instead be removed
  if it's non-functional; i.e. (native-comp-available-p) returns nil.

These are now detectable using featurep, which is fast and built-in.
2022-08-14 20:43:35 +02:00
Henrik Lissner
c540f1b515
perf(lib): memoize doom-system-* functions 2022-08-14 20:43:35 +02:00
Henrik Lissner
3239ab8b2e
nit(mu4e): neutralize comments
Some of our comments/docs can come off as disparaging or snide. They're
glimpses of unfiltered frustration or snarky rubber ducking gone too
far, something I can totally sympathize with, as a scatterbrained
tinkerer, unwittingly made responsible for a lot of work that isn't mine
because of Doom's position as a middleman. But now that Doom has a
veritable userbase, I'd like to hold it to a higher standard.

Light-hearted banter and aired grievances in our source code,
documentation, or community are fine if focused on the problem or the
personal/shared experiences of the community (things that offer value or
amusement to others), but it is never acceptable to attack people or
their efforts. Especially not the very people on whose shoulders Doom
stands.

I sincerely apologize if these have offended you.

Amend: b07614037f
2022-08-14 20:36:42 +02:00
efim
02bb28dc82
fix(org): respect org-table-automatic-realign
Co-authored-by: efim <efim.nefedov@nordigy.ru>
2022-08-12 21:03:39 +02:00
joh13266
eb65ef169b fix(ocaml): ocaml tree-sitter function typo 2022-08-12 21:02:30 +02:00
Itai Y. Efrat
0e6682612f feat(default): use consult-flycheck when applicable 2022-08-12 21:01:56 +02:00
Henrik Lissner
12bf6baa21
fix: void-function doom-reset-file-handler-alist-h
A regression introduced in 1d8c61698b. Doom disables its
file-name-handler-alist optimization if in a daemon session or if debug
mode is active.

Fix: #6657
Amend: 1d8c61698b
2022-08-10 17:29:01 +02:00
Henrik Lissner
05b344a852
refactor: move nativecomp deny-list to doom-packages
Also removes $EMACSDIR/eln-cache from native-comp-eln-load-path, to
reduce any chance of this taking precedence later.
2022-08-10 14:13:46 +02:00
Henrik Lissner
61ff5a4421
refactor(cli): set __DOOMCONTEXT at runtime
Addresses the edge case where the user sets (or unsets) __DOOMCONTEXT in
their CLI config.
2022-08-10 14:10:08 +02:00
Henrik Lissner
de62c5449d
nit(vc-gutter): add summary tags to comments
A new convention I'm slowly rolling out to modules to help readers
quickly identify the purpose of a change. E.g.

  UX    - a change done to improve user experience
  STYLE - for aesthetics
  FIX   - addresses a perceived or potential issue
  PERF  - intended to improve performance

Combined tags will be delimited with commas. E.g. "UX,PERF:"

There may be more later, and these will be further documented in the new
docs about to come up.
2022-08-10 14:06:52 +02:00
Henrik Lissner
8191607093
refactor(cli): use more reliable means to assemble paths
Use filesystem to build or check paths, rather than regexps and string
concatenation.
2022-08-10 14:02:47 +02:00
Henrik Lissner
25ac752de2
fix(cli): file-missing error on comp-el-to-eln-filename
If you've moved $EMACSDIR, comp-el-to-eln-filename will throw errors
about missing directories/files, rendering 'doom sync' ineffective and
forcing the user to delete $EMACSDIR and reinstall Doom.
2022-08-10 13:18:34 +02:00
Henrik Lissner
7598485e1a
bump: :emacs vc
magit/magit@846d153a2e -> magit/magit@8a0cc83eff
magit/git-modes@62fbf2e5b8 -> magit/git-modes@eca3bb42ea
https://codeberg.org/pidu/git-timemachine@3381797bcbf9 -> emacsmirror/git-timemachine@ca09684e94

Moved to a git-timemachine mirror because codeberg.org has uptime
issues.
2022-08-10 13:18:34 +02:00
Henrik Lissner
118f0c416a
refactor(evil): replace evil-visual-update-x-selection advice
With the new evil-visual-update-x-selection-p setting.

Also adds a more descriptive comment to this design choice.
2022-08-10 13:18:34 +02:00
Henrik Lissner
bd597ffda4
docs(vc-gutter): document module's hacks 2022-08-10 13:18:34 +02:00
Henrik Lissner
99b0b70c49
fix(vc-gutter): remove advice removal for diff-hl-overlay-modified
Originally, this intended to *stop* diff-hl from too aggressively
deleting the diff overlays while editing. This is either no longer the
case or the old advice was mistaken; the intended behavior is achieved
without it.
2022-08-10 13:18:34 +02:00
Henrik Lissner
d55d7f3088
feat(vc-gutter): shrink revert-hunk popup to contents 2022-08-10 13:18:33 +02:00
Henrik Lissner
2ff8228133
fix(docs): handle missing autoloads file in core doctor
Instead of a long winded backtrace about a missing autoloads file, let
the user know a 'doom sync' is needed.
2022-08-10 13:18:08 +02:00
Henrik Lissner
a0a4aa81c1
fix(vterm): +vterm/toggle creating duplicates
If vterm-buffer-name-string is set to non-nil, then vterm will rename
the buffer after it is initialized. Since +vterm/toggle looks up buffers
by name, it will lose track of them, causing it to create a new one on
each invocation. With this, it will no longer lose track of them.

Fix: #6651
2022-08-09 17:18:35 +02:00
Henrik Lissner
4cf5ae8be1
fix(literate): tangling loop on 'doom sync'
Why the setenv call wasn't persisted into session restart (#6642) needs
further investigation, but for now this seems to solve the issue.

Fix: #6642
2022-08-09 17:12:56 +02:00
Henrik Lissner
24623f9959
refactor!(dired): move diff-hl config to :ui vc-gutter
BREAKING CHANGE: users who are used to diff-hl displaying diffs in dired
will notice they have vanished. diff-hl's conig has been moved to :ui
vc-gutter +diff-hl (added in 27a448b). Enable it to get it back.

Ref: 27a448b04b
2022-08-09 16:30:43 +02:00
Henrik Lissner
e76f327e0a
fix(vc-gutter): apply +pretty to diff-hl-dired-mode
Amend: cd9bc5a1fd
2022-08-09 16:30:43 +02:00
Henrik Lissner
e30eb03f83
refactor(vc-gutter): remove redundant hooks
The refresh hooks address the stage/unstage cases already.
2022-08-09 16:30:43 +02:00
Henrik Lissner
15b00b78fe
refactor(vc-gutter): use local modes instead of global 2022-08-09 16:30:43 +02:00
Bruce D'Arcus
b06fd63dcb bump: :tools biblio
andras-simonyi/citeproc-el@9f783967c1 -> andras-simonyi/citeproc-el@406bd9964f
emacs-citar/citar@b24b5b94b7 -> emacs-citar/citar@146f2cb5a3
tmalsburg/helm-bibtex@aa775340ba -> tmalsburg/helm-bibtex@ce8c17690d

Also add citar-embark, which now contains the embark functionality in a
separate minor mode package, and explicitly add parsebib, so we can pin
the precise version.
2022-08-08 23:41:06 +02:00
Henrik Lissner
13b3304c08
bump: :lang org
emacs-straight/org-mode@5a49cc5f4f -> emacs-straight/org-mode@00adad9357
hakimel/reveal.js@039972c730 -> hakimel/reveal.js@e219184f37
oer/org-re-reveal@f184e66e39 -> oer/org-re-reveal@6f78a0a228
org-roam/org-roam@e435581215 -> org-roam/org-roam@7f453f3fff

- Fixes "Variable binding depth exceeds max-specpdl-size" error when
  opening Doom's docs in doom-docs-org-mode. See 1abcf91.

Ref: 1abcf913aa
2022-08-08 22:28:14 +02:00
Henrik Lissner
b763c5b992
fix: file-name-handler-alist ignoring user changes
Unsetting file-name-handler-alist around a `load` call prevents any
change to this variable from surviving that file's evaluation (e.g. by
packages loaded therein). Since the user's config files are loaded with
this macro, this affects users' configs, which is unacceptable.

Since this optimization is already done in early-init.el, we can get
away with being more selective here.
2022-08-08 22:20:11 +02:00
Henrik Lissner
1d8c61698b
fix: "symbol's value as variable is void: \213" error (part 2)
See 6f1c0f7cc7 for part 1.

Turns out startup.elc likely exists on most Emacs installations (and,
since it's so integral to Emacs, it likely gets special treatment), so
it was a poor heuristic for this fix. Instead, a more variable target
would be calc-loaddefs.el.

On some systems, only calc-loaddefs.el.gz exists (in which case, we
should turn off the optimization). On others, calc-loaddefs.el
exists (so I'll assume it's safe to leave them on). I won't check for
calc-loaddefs.elc because it doesn't matter; calc.el explicitly
calls (load "calc-loaddefs.el") so it is never loaded.

Of course, you can sidestep the entire issue by building Emacs with
--without-compress-install, but it's not practical for users to
know/want to do that.

Amend: 6f1c0f7cc7
2022-08-08 22:19:18 +02:00
Henrik Lissner
6f1c0f7cc7
fix: "symbol's value as variable is void: \213" error
Some installs of Emacs do not come with byte-compiled versions of its
bundled elisp files, so when loading them, Emacs falls back to loading
its *.el.gz files. This would be fine if it were not for a  startup
optimization Doom employs, where it sets file-name-handler-alist to
nil (and by doing so, robs Emacs of the ability to read compressed
elisp). This causes "symbol's value as variable is void: \213" errors at
startup.

With this commit, Doom now disables this optimization early if it
suspects this applies to your install. But time will tell if it's early
enough.

Ref: https://mail.gnu.org/archive/html/emacs-devel/2022-08/msg00234.html
2022-08-08 18:52:32 +02:00
Henrik Lissner
f0e508b52d
bump: :lang ocaml
diml/utop@5d72a0ab34 -> diml/utop@bbd9a6ed45
flycheck/flycheck-ocaml@8707a7bf54 -> flycheck/flycheck-ocaml@77f8ddbd9b
ocaml-ppx/ocamlformat@9324ea439a -> ocaml-ppx/ocamlformat@9cbd8150c2
ocaml/dune@4bc7629a5e -> ocaml/dune@3df932f7f9
ocaml/merlin@5d59c70659 -> ocaml/merlin@be753d9412
ocaml/tuareg@04f5ab6be9 -> ocaml/tuareg@ad8a688b7e

Fix: ocaml-ppx/ocamlformat#2120
Close: #6639
Co-authored-by: tjammer <tjammer@users.noreply.github.com>
2022-08-08 18:47:13 +02:00
Jeetaditya Chatterjee
1b56675819 docs(tree-sitter): update highlights configuration 2022-08-08 18:37:20 +02:00
Jeetaditya Chatterjee
8e68cd5ffd feat(tree-sitter): conditionally enable ts-hl-mode
Based on the new variable `+tree-sitter-hl-enabled-modes`

This allows for people to use tree sitters tools without having
to use it for highlighting.
Useful because some modes (such as web-mode and its derivatives) do a
better job than the tree sitter alternative in this respect.
2022-08-08 18:37:20 +02:00
Peter Hoeg
4f23a02877 feat(terraform): support terragrunt 2022-08-08 18:35:46 +02:00
Abdelhak Bougouffa
d8c8f04f2f docs(vertico): add +childframe flag 2022-08-08 18:35:10 +02:00
Henrik Lissner
0ebf254f4e
fix(org): enable evil-org-mode in doom-docs-org-mode
So (evil) readers can get its benefits too.
2022-08-08 18:24:56 +02:00
Henrik Lissner
7c9d7a4551
fix(literate): report failures clearly
If tangling failed, it would do so silently, continuing on with the
'doom sync'. This causes a visible error instead, aborting the 'doom
sync'. Unfortunately, org-babel-tangle doesn't appear to produce any
errors, so this our error message can't be improved at this stage.

Fix: #6642
2022-08-08 18:23:47 +02:00
Henrik Lissner
9c04998e9c
tweak(cli): load doomrc quietly 2022-08-08 18:23:47 +02:00
Henrik Lissner
9c80b33b89
tweak: suppress defvaralias warnings 2022-08-08 18:23:47 +02:00
Henrik Lissner
27a448b04b
feat(vc-gutter): add +diff-hl backend
This adds an alternative backend to the :ui vc-gutter module, enabled
with the +diff-hl flag. In the future, I intend for diff-hl to replace
git-gutter, as it is slightly faster and depends on more native
functionality (vc.el), but it's still a little buggy. It will remain
opt-in until those issues are sorted out.
2022-08-08 18:23:47 +02:00
Henrik Lissner
cd9bc5a1fd
refactor!(vc-gutter): move style defaults behind +pretty
BREAKING CHANGE: This changes moves its default configuration of the
fringe behind a +pretty flag. This won't cause breakage, but will cause
a (possibly unwanted) visual change: git-gutter will use its default
indicators (e.g. + and - symbols) instead of the continuous bars from
before.

To get back the old look, enable `+pretty` on the `:ui vc-gutter`
module.

This was done to make the defaults toggleable, to standardize +pretty,
to document issues with this customization that have been brought up by
members of the Emacs community, and to better document it in comments
for posterity.
2022-08-08 18:23:47 +02:00