Commit graph

704 commits

Author SHA1 Message Date
Henrik Lissner
e499e05ff3
fix(fold): void-function evil-define-key* error on Emacs 29 2022-09-16 03:17:46 +02:00
Henrik Lissner
7a2be67efa
refactor!: redesign module init/config hooks
BREAKING CHANGE: For consistency and correctness, I've renamed the
module init/config hooks, and added new ones:

- Adds doom-before-modules-config-hook
- Adds doom-after-modules-config-hook (replaced doom-before-init-modules-hook)
- Adds doom-before-modules-init-hook
- Adds doom-after-modules-init-hook (replaced doom-init-modules-hook)
- Removed doom-after-init-modules-hook (replaced w/ after-init-hook)

The old naming (and timing) was counterintuitive. Now, it's named after
the loaded file group (init.el vs config.el), and I added before/after
variants. Altogether, this should make them less ambiguous.

I've also moved some functions in various modules to more correct hooks.

Load order before this change:
- $EMACSDIR/early-init.el
- $EMACSDIR/lisp/doom.el
- $EMACSDIR/lisp/doom-start.el
- $DOOMDIR/init.el
- {$DOOMDIR,~/.emacs.d}/modules/*/*/init.el
- `doom-before-init-modules-hook'
- {$DOOMDIR,~/.emacs.d}/modules/*/*/config.el
- `doom-init-modules-hook'
- $DOOMDIR/config.el
- `doom-after-init-modules-hook'
- `after-init-hook'
- `emacs-startup-hook'
- `window-setup-hook'

Load order after this change:
- $EMACSDIR/early-init.el
- $EMACSDIR/lisp/doom.el
- $EMACSDIR/lisp/doom-start.el
- $DOOMDIR/init.el
- `doom-before-modules-init-hook'
- {$DOOMDIR,~/.emacs.d}/modules/*/*/init.el
- `doom-after-modules-init-hook'
- `doom-before-modules-config-hook'
- {$DOOMDIR,~/.emacs.d}/modules/*/*/config.el
- `doom-after-modules-config-hook'
- $DOOMDIR/config.el
- `after-init-hook'
- `emacs-startup-hook'
- `window-setup-hook'
2022-09-16 01:14:22 +02:00
Jen-Chieh Shen
f8bd14ebc3
bump: ts-fold
jcs090218/ts-fold@01d6485398 -> emacs-tree-sitter/ts-fold@01d6485398

The repo has moved.
2022-09-07 00:24:57 +02:00
Alex Birdsall
5ca8c75644 fix(file-templates): better recognize shell types
There are some conventional files strongly associated with a non-bash
shell which do not use an explicit `.zsh` file extension (e.g.
`.zprofile`); the old logic would always use the `#!/usr/bin/env bash`
shebang in these cases, which is a tiny little bummer.
2022-08-19 11:23:56 +02:00
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
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
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
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
b6ba1204bf
fix(file-templates): unescaped periods in regexps 2022-08-07 20:58:29 +02:00
Henrik Lissner
3ca74a1d5f
feat(file-templates): add .doomrc template
Ref: 9b8ed397e8
2022-08-07 20:57:55 +02:00
Henrik Lissner
057e6c531c
refactor: replace doom-enlist with ensure-list
doom-enlist is now a deprecated alias for ensure-list, which is built
into Emacs 28.1+ and is its drop-in replacement. We've already
backported it for 27.x users in doom-lib (in 4bf4978).

Ref: 4bf49785fd
2022-08-07 19:43:13 +02:00
Henrik Lissner
1abcf913aa
revert: fix(docs): set mode in file-local vars
emacs-straight/org-mode@e22b4eb7aa introduced a breaking change that
made it impossible to rely on .dir-locals.el to change org-mode buffers
in $EMACSDIR to doom-docs-org-mode (without infinite recursion), so we
used file-local variables in 7e400ab.

emacs-straight/org-mode@215de6176b reverted that change, so we can use
.dir-locals.el again, and this is my preference, since it requires less
boilerplate across our hundreds of org files.

Ref: emacs-straight/org-mode@215de6176b
Ref: emacs-straight/org-mode@e22b4eb7aa
Revert: 7e400abdc0
2022-08-07 19:08:07 +02:00
Henrik Lissner
ba668f7cb0
fix(file-templates): indentation for licenses
And remove superfluous tabstops in gpl3 license.
2022-08-05 00:49:17 +02:00
Henrik Lissner
d6ffd2bfaa
fix(file-templates): update doom doc templates
To reflect the new mode: line added in 7e400ab, and add an ID property.
Also corrects heading level in __doom-readme file template.

Ref: 7e400abdc0
2022-08-04 01:15:23 +02:00
Henrik Lissner
1f8bf7accb
merge: rewrite-docs
I've omitted docs/*.org from this merge, as there is still work left to
do there, but I am pushing the module docs early so folks can benefit
from the new docs sooner.
2022-08-03 03:27:50 +02:00
Henrik Lissner
7e400abdc0
fix(docs): set mode in file-local vars
Due to emacs-straight/org-mode@e22b4eb, a replacement major mode (for
org-mode) can no longer be specified from .dir-locals.el, as it spirals
into infinite recursion. Therefore, a mode: line is needed in all Doom
docs.

Ref: emacs-straight/org-mode@e22b4eb7aa
2022-08-03 02:46:33 +02:00
ivanbrennan
90c510caca refactor(evil): remove evil-want-C-w-scroll
This appears to have been added accidentally in the following commit:
8b9d4a94bb

The codebase contains no references to it.
2022-08-02 20:36:59 +02:00
Henrik Lissner
1255315bfc
refactor(docs): replace nav menus with virtual one
Now that the header is dynamically generated (when doom-docs-mode is
active), a literal header is unnecessary.
2022-08-02 19:37:07 +02:00
Henrik Lissner
e77a45bc22
docs: use lowercase keywords
As per Org's new defaults, which we're adopting elsewhere, so may as
well adopt it here.
2022-08-02 16:23:43 +02:00
Henrik Lissner
924d78443a
tweak(snippets): yas-verbosity = 2 2022-07-24 13:16:02 +02:00
Henrik Lissner
9ec60d9ab9
fix(evil): evil-collection-occur -> evil-collection-replace
evil-collection-occur.el was moved to evil-collection-replace.el in
emacs-evil/evil-collection@79fc09b014.

Fix: #6495
Close: #6524
Ref: emacs-evil/evil-collection@79fc09b014
Co-authored-by: DeesonGao <DeesonGao@users.noreply.github.com>
2022-07-05 14:16:16 +02:00
Henrik Lissner
5a98d59afc
perf(evil): lazy load evil-collection-shortdoc
Another package that Emacs loads eagerly at startup, that ends up
pulling in evil-collection et co.
2022-07-04 02:38:10 +02:00
Henrik Lissner
14b2395424
refactor: remove unused core variables
doom-debug-p and doom-interactive-p have always been intentionally
redundant, because changing the variables they replaced had other
side-effects, which made writing tests for them difficult. Since our
new (yet unpublished) tests lean heavily toward integration testing more
than unit testing, this becomes an implementation detail.

And doom-init-p's only use was refactor out at some point in the past,
so it's no longer used.

Also done to reduce Doom's footprint, in general.
2022-06-29 18:14:20 +02:00
Jeetaditya Chatterjee
cf0696f54b docs(fold): mention ts-fold package 2022-06-18 00:16:31 +02:00
Henrik Lissner
173396a963
merge: pull request #5401 from jeetelongname/tree-sitter 2022-06-17 22:55:42 +02:00
Henrik Lissner
31519d393a
bump: :editor evil
emacs-evil/evil-collection@e557188692 -> emacs-evil/evil-collection@6cc02b238c
emacs-evil/evil@3e41a82333 -> emacs-evil/evil@157af04d2c
hlissner/evil-snipe@a79177df40 -> hlissner/evil-snipe@c07788c35c
redguardtoo/evil-nerd-commenter@42ba1a473b -> redguardtoo/evil-nerd-commenter@386cd758a4
2022-06-17 18:21:23 +02:00
Henrik Lissner
d0cdf8f5c6
fix(evil): ]f/[f opening directories
They should traverse files, not directories.
2022-06-13 01:16:22 +02:00
Jeetaditya Chatterjee
4334eb285f
nit(fold): fix non idiomatic code
- remove final t in cond
- replace cond with if
- replace seq-filter with cl-remove-if-not
2022-05-22 21:26:08 +01:00
Jeetaditya Chatterjee
cd6cb8c499
fix(tree-sitter): check tree-sitter-mode is bound
and-true-p
2022-05-22 21:26:08 +01:00
Jeetaditya Chatterjee
cc238dd666
bump: :editor fold ts-fold
jcs090218/ts-fold@d6fbca3748 -> jcs090218/ts-fold@01d6485398
2022-05-22 21:26:07 +01:00
Jeetaditya Chatterjee
32bf2ee4cf
fix(tree-sitter): message raised when jumping up
as opposed to a nasty error,
the error was raised because I was not using the abs of count
this commit also comes with general code cleanup,
this includes
- removal of the eval quasiquote antipattern when an apply would work
better
- use of the :key keyword instead of the lambda
2022-05-22 21:26:02 +01:00
Jeetaditya Chatterjee
6127692848
fix(fold): handle bounding error
This basically stops the "not overlay" error we were getting when you
tried to jump to many times. this does have the disadvantage of not
jumping at all if the amount of jumps is higher than the amount of
overlays but this can be fixed in a future commit if necessary.
2022-05-22 21:26:02 +01:00
Jeetaditya Chatterjee
c16e16e92b
feat(fold): define ts-fold movement logic
As ts-fold does not provide fold movement logic I made my own. This can
and probably should be upstreamed but the details for that are not clear
2022-05-22 21:26:02 +01:00
Jeetaditya Chatterjee
caa64e8324
feat(fold): change ts-fold replacement face
this is to make it similar to hideshow
2022-05-22 21:26:02 +01:00
Jeetaditya Chatterjee
7b9d00d661
feat(tree-sitter): add ts to open/close all
also refactor +fold-open-all, +fold-close-all to use cond instead of the
when case for vimish fold.
2022-05-22 21:26:01 +01:00
Jeetaditya Chatterjee
c3e360eeaa
tweak(tree-sitter): add tree sitter check to foldp
instead of just checking if ts-fold is enabled I also check i
tree-sitter mode is actually enabled if not it will move onto hidehshow
2022-05-22 21:26:01 +01:00
Jeetaditya Chatterjee
c1f640209a
feat(fold): add ts-fold support to wrappers
Changes:
- add +fold--ts-fold-p which only checks if the feature is around
- add ts-fold into +fold/toggle, +fold/open, +fold/close
- update doc strings
2022-05-22 21:26:01 +01:00
Jeetaditya Chatterjee
83d22fe5ef
feat(fold): add ts-fold 2022-05-22 21:26:01 +01:00
Samuel Tschiedel
488ad07cc5 fix(evil): define *-any-quote directly
Defining `*-any-quote` objects via the exiting `*-block` helpers leads
to incorrect behaviour, where the trailing boundary is also included as
part of the selection (cursor on `|`, selection between `|`):

```
start: "te|st"
v i q: "|test"|
```

The expected behaviour is the same as `v i "`:
```
start: "te|st"
v i q: "|test|"
```

Fix: #5698
2022-04-25 16:38:40 +02:00
Henrik Lissner
f6fd2dc000
bump: :editor
abo-abo/lispy@bf31576802 -> abo-abo/lispy@df1b7e614f
cute-jumper/evil-embrace.el@464e8ec52f -> cute-jumper/evil-embrace.el@7b5a539cfe
doomemacs/snippets@3083b2342f -> doomemacs/snippets@2d031f7231
edkolev/evil-lion@6b03593f5d -> edkolev/evil-lion@4da660e124
emacs-evil/evil-collection@e69abfcb1c -> emacs-evil/evil-collection@e557188692
emacs-evil/evil@be97395e31 -> emacs-evil/evil@3e41a82333
emacsorphanage/god-mode@d7e9330950 -> emacsorphanage/god-mode@fac7d26ecd
gabesoft/evil-mc@246aecc174 -> gabesoft/evil-mc@63fd2fe0c2
magnars/multiple-cursors.el@8a60fc7ef0 -> magnars/multiple-cursors.el@aae47aebc0
2022-03-31 19:25:50 +02:00
Dominik Schrempf
b77699c38f nit(org): lower case keywords in file templates
See https://list.orgmode.org/87tuuw3n15.fsf@nicolasgoaziou.fr/.
2022-03-31 00:43:51 +02:00
Henrik Lissner
54d8c49d8b
refactor(file-templates): suppress in indirect buffers
Change how we detect and suppress file template expansion in org-capture
buffers (which are indirect clones). Since 99.99% of the time, an
indirect clone means we're doing something special in that buffer, it
seemed sensible to always suppress file templates in them. Hopefully
this will be more robust than the former advice.
2022-03-21 03:57:02 +01:00
Ian Kerins
893b4171b7 tweak(file-templates): remove default JSON template
As described at https://www.json.org/json-en.html, JSON has multiple
top-level forms (at least objects and arrays, and potentially all values
as well, depending on who you ask). Of these, I would not say array is a
good default. I frequently find myself deleting this default, generally
to use an object instead.

Because there is no consistent winner, and because the template is so
trivial, it seems best to simply delete it: the cost of the template not
matching the user's intent outweighs any benefit it stands to deliver
when it does match the user's intent.
2022-03-19 16:14:53 +01:00
Michael Chen
a505eae88f
fix(multiple-cursors): keybinds for {next,last}-cursor 2022-03-19 16:12:30 +01:00
Dan
42e5763782
fix(evil): respect users' evil-collection-key-blacklist 2022-02-23 17:49:53 +01:00
Layerex
169896e9ad tweak(file-templates): update default solidity template
- Added SPDX-License-Identifier
- Renewed default version pragma
2022-02-23 17:47:14 +01:00
Henrik Lissner
6ab43ff252
tweak(file-templates): use NAME <EMAIL> for Author: line
Instead of the github URL. No guarantee the user is a github user.
2022-02-23 15:23:14 +01:00