Commit graph

739 commits

Author SHA1 Message Date
Henrik Lissner
bef076b655
bump: :editor evil
emacs-evil/evil@9eb69b7f5b -> emacs-evil/evil@5fc16776c5
emacs-evil/evil-collection@1ad283f5b7 -> emacs-evil/evil-collection@8be4b75c86

- Fixes breaking change due to emacs-mirror/emacs@802a54ad62 (see
  #7397).

Ref: debbugs.gnu.org/cgi/bugreport.cgi?bug=62248
Close: #7397
Co-authored-by: prashantvithani <prashantvithani@users.noreply.github.com>
2023-09-09 23:59:22 +02:00
Amos Bird
ca9f84d664
fix(evil): add evil-embrace support for c++-ts-mode
In emacs-29, native tree-sitter adds new major modes for the C++
language, named c++-ts-mode. As a result, hooks in c++-mode will not
run. This commit adds the angle bracket fix hook for c++-ts-mode.
2023-09-09 23:59:06 +02:00
Henrik Lissner
56187fc35a
merge: pull request #7359 from theschmocker/snippet-command-fixes-and-enhancements 2023-09-08 23:24:48 +02:00
Lorenzo Ravaglia
25602409b6
refactor(file-templates): c++-mode/__main.cpp: modernize
- Drops `using namespace std`: a known anti-pattern which imports a
  massive namespace into the global namespace. See
  https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice
- Modernizes/generalizes `main`'s signature with a trailing return
  type (C++11)

Ref: https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice
Close: #7387
2023-09-07 20:22:58 +02:00
Lorenzo Ravaglia
9cc9351cae
feat(file-templates): add c-mode/__main.c
Ref: #7387
2023-09-07 20:22:58 +02:00
Liam Hupfer
9c2d50d97e nit: fix docstrings 2023-09-02 11:46:07 -05:00
Henrik Lissner
9e9c7d9e6d
bump: :editor evil
edkolev/evil-lion@a55eb64742 -> edkolev/evil-lion@1e838a53b8
emacs-evil/evil@60ba716bf5 -> emacs-evil/evil@9eb69b7f5b
hlissner/evil-snipe@c07788c35c -> hlissner/evil-snipe@c2108d3932
mamapanda/evil-traces@d4c53bd6ad -> mamapanda/evil-traces@82e8a7b421

- Includes two fixes for breaking changes in evil:
  - mamapanda/evil-traces#5 (due to breaking changes in evil-ex.el)
  - emacs-evil/evil#1824 (due to removal of evil-unquote function)

Fix: mamapanda/evil-traces#5
Fix: emacs-evil/evil#1824
2023-08-21 18:09:02 +02:00
Henrik Lissner
21df7d0beb
bump: :editor evil
cute-jumper/evil-embrace.el@7b5a539cfe -> cute-jumper/evil-embrace.el@3081d37811
emacs-evil/evil-collection@aaf3e0038e -> emacs-evil/evil-collection@1ad283f5b7
emacs-evil/evil-surround@f273821f57 -> emacs-evil/evil-surround@8fad8540c4
emacs-evil/evil@2ce03d412c -> emacs-evil/evil@60ba716bf5
mamapanda/evil-traces@290b532354 -> mamapanda/evil-traces@d4c53bd6ad
redguardtoo/evil-nerd-commenter@8c0f23d46a -> redguardtoo/evil-nerd-commenter@3b197a2b55

Ref: mamapanda/evil-traces#5
Ref: cute-jumper/evil-embrace.el#10
2023-08-20 22:16:12 +02:00
theschmocker
406594b9af refactor(snippets): use cond instead of nested if 2023-08-19 21:59:48 -05:00
theschmocker
363706744d feat(snippets): select mode for new snippet
When there are extra yasnippet modes loaded in the current buffer,
prompt user to select one for the new snippet.

If a prefix arg is supplied when calling `+snippets/new`, prompt user to
select any mode.
2023-08-19 21:49:51 -05:00
theschmocker
4643376268 fix(snippets): fix +snippets/new and +snippets/new-alias file creation
When adding a snippet/alias to a mode for the first time, setting
`default-directory` before calling `+snippet--ensure-dir` would cause an
error due to the directory not existing. As a fix, return the dir from
`+snippet--ensure-dir` and bind `default-directory` to that.

Additionally, not having a file associated with the buffer caused issues
with loading the snippet after using snippet-mode's C-c C-c binding,
especially when other directories were added to yasnippet's load paths.
As a solution for this, prompt the user for a snippet key and set the
buffer's file name to it within the snippet dir. If an existing file
would be overwritten, ask user for confirmation. As an additional
convenience, set the snippet's key field to the entered value.

Finally, replace %alias with doom-snippets-expand in the generated alias
snippets. Not aware of any history here, but %alias did not work for me.
2023-08-19 21:49:11 -05:00
theschmocker
41f31ba9ce fix(snippets): fix snippet uuid completion
Rather than attempting to read the uuid from a text property on the
selected completion -- which gets stripped by vertico (and possibly
helm) -- grab it from a lookup alist of completion-candidat->uuid.

Essentially the same as the proposed implementation by @jgrey4296
on #4127

Fix: #4127
2023-08-19 21:00:15 -05:00
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