Commit graph

777 commits

Author SHA1 Message Date
Daanturo
23c0eeba45 fix(multiple-cursors): check evil-local-mode instead of the global one
For evil compatibility (switching to emacs state during multiple
cursors), when evil is enabled locally by evil-local-mode but not
globally by evil-mode, using the former to check is more accurate.

Also make the state variables local since MC maybe used for multiple
buffers: activate current buffer and while not deactivating here, go to
another buffer and activate there.
2023-08-18 19:20:45 +02:00
Christian Packard
0d30ef188a
docs(lispy): add "Working with Brackets" 2023-07-24 23:22:32 +02:00
Ellis Kenyo
435a383635 fix(evil): remap after eglot is loaded
evil-collection recently made some changes that map over our defaults
for evil
2023-07-22 16:41:13 +02:00
Henrik Lissner
cb6b065b87
fix(evil): embrace: escaped pairs in first org buffer
Close: #5423
2023-03-22 01:16:02 -04:00
Colin Woodbury
e1c962cdf9 fix(parinfer): activate for fennel-mode
A simple oversight.
2023-03-20 18:29:52 -04:00
Henrik Lissner
adb125f41f
fix(evil): persist evil state after mode changes
For example: when doom-guess-mode-h is triggered (see #7141), or when
the user invokes a mode function through M-x.

Fix: #7141
2023-03-11 10:54:22 -05:00
Henrik Lissner
fe2cb5e705
fix(evil): premature "too early" warnings
A warning gets logged if a lazily-loaded evil-collection package is
loaded too early at startup, but the goal posts were in the wrong place,
resulting in unavoidable warnings for packages that weren't actually
loaded too early.
2023-02-25 20:47:28 -05:00
Henrik Lissner
f348856cd3
docs(evil): add faq for kill-ring and clipboard sync
Describes how to disable synchronization between the kill-ring and
system clipboard.

Close: #6947
Co-authored-by: rittelle <rittelle@users.noreply.github.com>
2023-02-23 20:44:48 -05:00
Henrik Lissner
802f015f26
fix(file-templates): org-capture errors on new files
If an org-capture template generates a new, blank file, Doom steps in to
insert a yasnippet file-template into the buffer.  If the file template
has text fields, it leaves the new buffer in an "editing snippets"
state (and insert mode) which causes errors downstream when org-capture
tries to modify the buffer.

The file-templates module employs some heuristics to prevent false
positives like these, but packages (and org-capture) can get around this
by simply generating and switching to the org buffer before modifying
it. This commit no-ops file-template expansion in any org-capture
session, which should resolve these issues.

Fix: #6160
Fix: #6741
2023-02-22 20:47:51 -05:00
Henrik Lissner
1040dd45b6
bump: :editor
abo-abo/auto-yasnippet@db9e0dd433 -> abo-abo/auto-yasnippet@6a9e406d0d
abo-abo/lispy@df1b7e614f -> abo-abo/lispy@097dd66e66
doomemacs/snippets@2d031f7231 -> doomemacs/snippets@fe4003014a
emacs-tree-sitter/ts-fold@01d6485398 -> emacs-tree-sitter/ts-fold@9d9e0c5cf7
emacsorphanage/god-mode@49c1a17531 -> emacsorphanage/god-mode@607aff10a7
joostkremers/visual-fill-column@453d698d7f -> joostkremers/visual-fill-column@695a597892
justinbarclay/parinfer-rust-mode@c2c1bbec6c -> justinbarclay/parinfer-rust-mode@332c7f4742
magnars/multiple-cursors.el@aae47aebc0 -> magnars/multiple-cursors.el@16223efc2d
noctuid/lispyville@9c14bed035 -> noctuid/lispyville@14ee8711d5
2023-02-21 19:34:42 -05:00
Henrik Lissner
bd5d43df95
bump: :editor evil
emacs-evil/evil-collection@665d5c99e2 -> emacs-evil/evil-collection@aaf3e0038e
emacs-evil/evil-surround@c9e1449bf3 -> emacs-evil/evil-surround@f273821f57
emacs-evil/evil@26ec0cda1b -> emacs-evil/evil@2ce03d412c
redguardtoo/evil-nerd-commenter@b1a92221c9 -> redguardtoo/evil-nerd-commenter@8c0f23d46a
2023-02-18 15:27:49 -05:00
Henrik Lissner
33db882ae6
feat(word-wrap): add soft-wrapping at fill-column
Using visual-fill-column.

Close: #1906
Co-authored-by: flatwhatson <flatwhatson@users.noreply.github.com>~
2023-02-18 15:27:47 -05:00
p4v4n
aa079b0e3c
fix(god): remove hard coding of cursor color 2023-02-18 00:47:35 -05:00
Ta Quang Trung
acdd0a4865
fix(fold): set ts-fold-replacement-face fg to unspecified 2023-02-17 11:45:06 -05:00
Akhil Wali
d5ccac5d71 bump: :editor god
emacsorphanage/god-mode@fac7d26ecd -> emacsorphanage/god-mode@49c1a17531
2022-12-02 00:36:06 +01:00
Akhil Wali
b7efac8b9e fix(god): enable god-mode on init
Enabling god-mode was broken in 7a2be67.

Fix: #6954
Amend: 7a2be67efa
2022-12-02 00:36:06 +01:00
Layerex
5b2ea8c32f feat(file-templates): Add javascript "use strict" file template 2022-10-29 02:52:01 +02:00
Layerex
76caca0eaa feat(file-templates): Add javascript shebang file template 2022-10-29 02:52:01 +02:00
Henrik Lissner
a0ccb6b95b
feat(emacs-lisp,lispy): recognize ;;* outline headings
Permit `;;* ...` be recognized by imenu and outline-minor-mode (and
outline's commands). This also patches Lispy to reflect this new
configuration (if :lang emacs-lisp is active).

Close: #6732
Co-authored-by: LemonBreezes <LemonBreezes@users.noreply.github.com>
2022-10-29 01:57:43 +02:00
TEC
5ac2a5258b docs: change link format 2022-10-05 01:01:19 +02:00
Henrik Lissner
f9201eb218
refactor: introduce doom-context
Introduces a system to announce what execution contexts are active, so I
can react appropriately, emit more helpful logs/warnings in the case of
issues, and throw more meaningful errors.

* bin/doom: load module CLIs in the 'modules' context.
* lisp/cli/doctor.el: load package files in 'packages' context.
* lisp/doom-cli.el:
  - (doom-before-init-hook, doom-after-init-hook): trigger hooks at the
    correct time. This may increase startup load time, as the benchmark
    now times more of the startup process.
  - (doom-cli-execute, doom-cli-context-execute,
    doom-cli-context-restore, doom-cli-context-parse,
    doom-cli--output-benchmark-h, doom-cli-call, doom-cli--restart,
    doom-cli-load, run!): remove redundant context prefix in debug logs,
    it's now redundant with doom-context, which doom-log now prefixes
    them with.
* lisp/doom-lib.el (doom-log): prefix doom-context to doom-log output,
  unless it starts with :.
* lisp/doom-packages.el (package!, doom-packages--read): throw error if
  not used in a packages.el file or in the context of our package
  manager.
* lisp/doom-profiles.el (doom-profile--generate-init-vars,
  doom-profile--generate-load-modules): use modules doom-context instead
  of doom-init-time to detect startup.
* lisp/doom-start.el (doom-load-packages-incrementally-h): move function
  closer to end of doom-after-init-hook.
* lisp/doom.el:
  - (doom-before-init-hook, doom--set-initial-values-h,
    doom--begin-init-h): rename doom--set-initial-values-h to
    doom--begin-init-h and ensure it runs as late in
    doom-before-init-hook as possible, as that is the point where Doom's
    "initialization" formally begins.
  - (doom-after-init-hook): don't trigger at the end of command-line-1
    in non-interactive sessions. This will be triggered manually in
    doom-cli.el's run!.
* lisp/lib/config.el (doom/reload, doom/reload-autoloads,
  doom/reload-env): use 'reload' context for reload commands.
* modules/lang/emacs-lisp/autoload.el (+emacs-lisp-eval): use 'eval'
  context.
* modules/lang/org/config.el: remove doom-reloading-p; check for
  'reload' doom context instead.
2022-09-24 22:09:05 +02:00
Henrik Lissner
732d87ac3e
nit: minor comment revision and refactors 2022-09-16 17:01:57 +02:00
Henrik Lissner
7ffe0df8eb
bump: :editor evil
edkolev/evil-lion@4da660e124 -> edkolev/evil-lion@a55eb64742
emacs-evil/evil-collection@6cc02b238c -> emacs-evil/evil-collection@665d5c99e2
emacs-evil/evil@157af04d2c -> emacs-evil/evil@26ec0cda1b
redguardtoo/evil-nerd-commenter@386cd758a4 -> redguardtoo/evil-nerd-commenter@b1a92221c9
2022-09-16 17:01:57 +02:00
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