Commit graph

978 commits

Author SHA1 Message Date
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
bcca96a69a
refactor(literate): remove unused envvar __DOOMRESTART
Also remove the "Restarting..." message; it's an implementation detail
that isn't important to the end user.
2022-08-05 00:49:17 +02:00
Henrik Lissner
bacb84f6c6
docs(default): add @hlissner, @UndeadKernel 2022-08-05 00:49:17 +02:00
Daanturo
08dac1400f fix(default): +default/yank-buffer-path echos the file name as nil
Emacs 29 with PGTK's kill-new doesn't return its STRING argument (with
the default settings) anymore, so we explicitly pass the file path to
prevent the confusing message "Copied path to clipboard: nil".
2022-08-03 19:26:19 +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
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
614a54b036
fix(literate): Doom core load paths
The file structure of the project was changed in b9933e6. This updates
the :config literate module to reflect that.

Amend: b9933e6637
2022-07-31 13:52:20 +02:00
Anh T Nguyen
7373e97ff6
feat(default): bind 'SPC b I' to open ibuffer for workspace 2022-07-24 00:07:41 +02:00
Henrik Lissner
043d32fefd
fix(literate): load doom core when tangling
This exposes Doom's stdlib to the sub-process that tangles your literate
config, so that src blocks therein (or their header arguments) can call
upon them or reference its variables (like IS-LINUX et co).

Fix: #6588
2022-07-23 16:42:29 +02:00
Daanturo
b5fd085af0 tweak(default): consult-flymake in a branch of +default-diagnostics
when available instead of plain flymake-show-diagnostics-buffer
2022-07-23 16:36:01 +02:00
Henrik Lissner
442d607ec0
fix: remove outdated uses of user-emacs-directory
Doom changes user-emacs-directory (see 46844b5 for explanation), so
doom-emacs-dir should be used to refer to your $EMACSDIR instead.

Fix: #6530
Ref: 46844b55de
2022-07-04 02:58:11 +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
Henrik Lissner
74cc541597
refactor(literate): DRY tangling
And remove unused cache file.

Ref: #6281
2022-06-29 18:14:20 +02:00
TEC
8df91f0b33 feat(literate): add async config tangling 2022-06-23 03:13:55 +02:00
Henrik Lissner
7ca50e0ce8
feat(default): bind 'SPC b y' to yank whole buffer
Evil may not always be available in all buffers, and in line with the
filepath yank commands on SPC f y/Y, I thought this command could be
useful. However, I omitted a "replace buffer with paste" command because
in any editing context, evil should be available, in which case it'd be
redundant with `vigp` (or yig for yanking the buffer).

Close: #5281
Co-authored-by: Alex Palaistras <deuill@users.noreply.github.com>
2022-06-21 18:46:25 +02:00
Henrik Lissner
ec2062f517
feat(macos): add 'open in new iTerm window' command
Plus keybinds on '<leader> o I'.

Close: #6318
Co-authored-by: brorbw <brorbw@users.noreply.github.com>
2022-06-21 18:46:25 +02:00
Henrik Lissner
6c0b7e1530
refactor!(cli): rewrite CLI framework libraries
BREAKING CHANGE: this changes Doom's CLI framework in subtle ways, which
is listed in greater detail below. If you've never extended Doom's CLI,
then this won't affect you, but otherwise it'd be recommended you read
on below.

This commit focuses on the CLI framework itself and backports some
foundational changes to its DSL and how it resolves command line
arguments to CLIs, validates input, displays documentation, and persists
state across sessions -- and more. This is done in preparation for the
final stretch towarding completing the CLI rewrite (see #4273).

This is also an effort to generalize Doom's CLI (both its framework and
bin/doom), to increase it versatility and make it a viable dev tool for
other Doom projects (on our Github org) and beyond.

However, there is a *lot* to cover so I'll try to be brief:

- Refactor: generalize Doom's CLI framework by moving all bin/doom
  specific configuration/commands out of core-cli into bin/doom. This
  makes it easier to use bin/doom as a project-agnostic development
  tool (or for users to write their own).
- Refactor: change the namespace for CLI variables/functions from
  doom-cli-X to doom-X.
- Fix: subcommands being mistaken as arguments. "doom make index" will
  resolve to (defcli! (doom make index)) if it exists,
  otherwise (defcli! (doom make)) with "index" as an argument. Before
  this, it would resolve to the latter no matter what. &rest can
  override this; with (defcli! (doom make) (&rest args)), (defcli! (doom
  make index)) will never be invoked.
- Refactor!: redesign our output library (was core/autoload/output.el,
  is now core/autoload/print.el), and how our CLI framework buffers and
  logs output, and now merges logs across (exit! ...) restarts.
- Feat: add support for :before and :after pseudo commands. E.g.

    (defcli! (:before doom help) () ...)
    (defcli! (:after doom sync) () ...)

  Caveat: unlike advice, only one of each can be defined per-command.
- Feat: option arguments now have rudimentary type validation (see
  `doom-cli-option-arg-types`). E.g.

    (defcli! (doom foo) ((foo ("--foo" num))) ...)

  If NUM is not a numeric, it will throw a validation error.

  Any type that isn't in `doom-cli-option-arg-types` will be treated as a
  wildcard string type. `num` can also be replaced with a specification,
  e.g. "HOST[:PORT]", and can be formatted by using symbol quotes:
  "`HOST'[:`PORT']".
- Feat: it is no longer required that options *immediately* follow the command
  that defines them (but it must be somewhere after it, not before). E.g.
    With:
      (defcli! (:before doom foo) ((foo ("--foo"))) ...)
      (defcli! (doom foo baz) () ...)
    Before:
      FAIL: doom --foo foo baz
      GOOD: doom foo --foo baz
      FAIL: doom foo baz --foo
    After:
      FAIL: doom --foo foo baz
      GOOD: doom foo --foo baz
      GOOD: doom foo baz --foo
- Refactor: CLI session state is now kept in a doom-cli-context struct (which
  can be bound to a CLI-local variable with &context in the arglist):

    (defcli! (doom sync) (&context context)
      (print! "Command: " (doom-cli-context-command context)))

  These contexts are persisted across sessions (when restarted). This is
  necessary to support seamless script restarting (i.e. execve
  emulation) in post-3.0.
- Feat: Doom's CLI framework now understands "--". Everything after it will be
  treated as regular arguments, instead of sub-commands or options.
- Refactor!: the semantics of &rest for CLIs has changed. It used to be "all
  extra literal, non-option arguments". It now means *all* unprocessed
  arguments, and its use will suppress "unrecognized option" errors, and
  tells the framework not to process any further subcommands. Use &args
  if you just want "all literal arguments following this command".
- Feat: add new auxiliary keywords for CLI arglists: &context, &multiple,
  &flags, &args, &stdin, &whole, and &cli.
  - &context SYM: binds the currently running context to SYM (a
    `doom-cli-context` struct). Helpful for introspection or passing
    along state when calling subcommands by hand (with `call!`).
  - &stdin SYM: SYM will be bound to a string containing any input piped
    into the running script, or nil if none. Use
    `doom-cli-context-pipe-p` to detect whether the script has been
    piped into or out of.
  - &multiple OPTIONS...: allows all following OPTIONS to be repeated. E.g. "foo
    -x a -x b -x c" will pass (list ("-x" . "a") ("-x" . "b") ("-x" .
    "c")) as -x's value.
  - &flags OPTIONS...: All options after "&flags" get an implicit --no-* switch
    and cannot accept arguments. Will be set to :yes or :no depending on which flag is
    provided, and nil if the flag isn't provided. Otherwise, a default
    value can be specified in that options' arglist. E.g.

      (defcli! (doom foo) (&flags (foo ("--foo" :no))) ...)

    When called, this command sets FOO to :yes if --foo, :no if --no-foo, and
    defaults to :no otherwise.
  - &args SYM: this replaces what &rest used to be; it binds to SYM a
    list of all unprocessed (non-option) arguments.
  - &rest SYM: now binds SYM to a list of all unprocessed arguments, including
    options. This also suppresses "unrecognized option" errors, but will render
    any sub-commands inaccessible. E.g.

      (defcli! (doom make) (&rest rest) ...)
      ;; These are now inaccessible!
      (defcli! (doom make foo) (&rest rest) ...)
      (defcli! (doom make bar) (&rest rest) ...)
  - &cli SYM: binds SYM to the currently running `doom-cli` struct. Can also be
    obtained via `(doom-cli-get (doom-cli-context-command context))`. Possibly
    useful for introspection.
- feat: add defobsolete! macro for quickly defining obsolete commands.
- feat: add defalias! macro for quickly defining alias commands.
- feat: add defautoload! macro for defining an autoloaded command (won't
  be loaded until it is called for).
- refactor!: rename defcligroup! to defgroup! for consistency.
- fix: CLIs will now recursively inherit plist properties from parent
  defcli-group!'s (but will stack :prefix).
- refactor!: remove obsolete 'doom update':
- refactor!: further generalize 'doom ci'
  - In an effort to generalize 'doom ci' (so other Doom--or
    non-doom--projects can use it), all its subcommands have been
    changed to operate on the current working directory's repo instead
    of $EMACSDIR.
  - Doom-specific CI configuration was moved to .github/ci.el.
  - All 'doom ci' commands will now preload one of \$CURRENT_REPO_ROOT/ci.el or
    \$DOOMDIR/ci.el before executing.
- refactor!: changed 'doom env'
  - 'doom env {-c,--clear}' is now 'doom env {clear,c}'
  - -r/--reject and -a/--allow may now be specified multiple times
- refactor!: rewrote CLI help framework and error handling to be more
  sophisticated and detailed.
- feat: can now initiate $PAGER on output with (exit! :pager) (or use
  :pager? to only invoke pager is output is longer than the terminal is
  tall).
- refactor!: changed semantics+conventions for global bin/doom options
  - Single-character global options are now uppercased, to distinguish them from
    local options:
    - -d (for debug mode) is now -D
    - -y (to suppress prompts) is now -!
    - -l (to load elisp) is now -L
    - -h (short for --help) is now -?
  - Replace --yes/-y switches with --force/-!
  - -L/--load FILE: now silently ignores file errors.
  - Add --strict-load FILE: does the same as -L/--load, but throws an error if
    FILE does not exist/is unreadable.
  - Add -E/--eval FORM: evaluates arbitrary lisp before commands are processed.
  - -L/--load, --strict-load, and -E/--eval can now be used multiple times in
    one command.
  - Add --pager COMMAND to specify an explicit pager. Will also obey
    $DOOMPAGER envvar. Does not obey $PAGER.
- Fix #3746: which was likely caused by the generated post-script overwriting
  the old mid-execution. By salting the postscript filenames (with both an
  overarching session ID and a step counter).
- Docs: document websites, environment variables, and exit codes in
  'doom --help'
- Feat: add imenu support for def{cli,alias,obsolete}!

Ref: #4273
Fix: #3746
Fix: #3844
2022-06-18 23:53:12 +02:00
Tony
781e80d849
tweak(default): remove M-{-,=,+} and C-- keybinds
The keybindings M--, M-=, and C-- override the built-in commands
negative-argument and count-words-region. Moreover, the C-- command,
er/contract-region, is already bound transiently to
expand-region-contract-fast-key while expanding regions.
2022-06-18 17:20:49 +02:00
Itai Y. Efrat
f3f260c0c0 feat(default): on evil bind rename-buffer to <leader> b R 2022-04-12 02:33:03 +02:00
Henrik Lissner
7121e993ca
bump: :completion
PythonNut/helm-flx@6640fac5cb -> PythonNut/helm-flx@27dd9e3ce3
abo-abo/swiper@c97ea72285 -> abo-abo/swiper@764e0d35ba
company-mode/company-mode@073aef72dd -> company-mode/company-mode@1005540b1c
emacs-helm/helm@5b17313011 -> emacs-helm/helm@1003539c2e
minad/consult-flycheck@0ad7e8ff15 -> minad/consult-flycheck@9b40f136c0
minad/consult@473e6585c5 -> minad/consult@36b8bc7065
minad/marginalia@e63d27e6fb -> minad/marginalia@a514c024ac
minad/vertico@a92b1e47ff -> minad/vertico@7ec0f0c076
oantolin/embark@06d5caafd5 -> oantolin/embark@2890e535f5
oantolin/orderless@f2c78c4a60 -> oantolin/orderless@8f64537f55
2022-04-08 02:52:54 +02:00
Joao Azevedo
b42d7afd9a
fix(default): replace vertico-repeat w/ vertico-repeat-last
vertico-repeat was replaced by vertico-repeat-last.

Amend: 0e802f4653
2022-04-05 00:05:31 +02:00
Henrik Lissner
6f8b83b884
refactor(default,python): move smartparens config
Ref: 41cbb1fe7b
2022-04-01 19:12:35 +02:00
Henrik Lissner
0e802f4653
bump: :completion
abo-abo/swiper@1c6b3da377 -> abo-abo/swiper@c97ea72285
company-mode/company-mode@8b58e5895c -> company-mode/company-mode@073aef72dd
emacs-helm/helm@a246a9b278 -> emacs-helm/helm@5b17313011
ericdanan/counsel-projectile@e30150792a -> ericdanan/counsel-projectile@40d1e1d4bb
minad/consult@2106eee75f -> minad/consult@473e6585c5
minad/marginalia@e9540a7b80 -> minad/marginalia@e63d27e6fb
minad/vertico@509ca602c7 -> minad/vertico@a92b1e47ff
oantolin/embark@56e28c23d5 -> oantolin/embark@06d5caafd5
oantolin/orderless@ce462a63e3 -> oantolin/orderless@f2c78c4a60
raxod502/prescient.el@292ac9fe35 -> raxod502/prescient.el@c5295a9eec
tumashu/ivy-posframe@5d9420252c -> tumashu/ivy-posframe@533a8e368f
tumashu/posframe@3b1dc400d2 -> tumashu/posframe@c91d4d53fa
2022-03-30 17:32:47 +02:00
Abdelhak Bougouffa
e16d8b6011 feat(multiple-cursors): add bindings to evil-mc-skip-* 2022-02-23 17:49:22 +01:00
Henrik Lissner
26d5163ba0
fix(default): no usable configuration epg-error
Introduced in dcae28c83a, because ignore-errors was being used for the
wrong epg-* function.

Why this happens: epg-make-context throws this error if you don't have a
GnuPG environment set up.

Fix: #6114
Amend: dcae28c83a
2022-02-16 02:13:35 +01:00
Henrik Lissner
dcae28c83a
fix(default): don't default to disabled/expired pgp keys
And don't use the short ID (see evil32.com).

Ref: https://evil32.com/
2022-02-14 21:24:42 +01:00
Henrik Lissner
009613a470 refactor(default,lib): doom--org-headings 2022-02-10 21:07:20 +01:00
Henrik Lissner
fca8bd7f3f bump: :config default
abo-abo/avy@e92cb37457 -> abo-abo/avy@ba5f035be3
magnars/expand-region.el@95a773bd8f -> magnars/expand-region.el@7e5bbe2763
noctuid/link-hint.el@3be270f3a7 -> noctuid/link-hint.el@676dac6621
2022-02-02 01:58:55 +01:00
Henrik Lissner
7246db457c docs: replace doom-source with doom-repo links
I will later use "source" to refer to module sources, so better we avoid
the terminology for now.
2022-02-01 18:55:27 +01:00
Lele Gaifax
e5213f20e5 nit: fix several documentation typos 2022-01-10 02:21:49 +01:00
Celso Bonutti
1b895a0564 fix(default): smartparens rules for haskell
The default haskell-mode rules would result in an extra } appended to
the closing pair (#5448).

Fix: #5448
Close: #5450
2022-01-05 04:05:08 +01:00
Henrik Lissner
e92ce51c13
merge: pull request #5888 from ethan-leba/mac-woman
fix(default): only use `woman` on macOS
2021-12-15 18:04:25 +01:00
Ethan Leba
d720b29cd3 feat(default): set woman manpath with man if able 2021-12-15 09:55:54 -05:00
Ethan Leba
6e0b2eafa6 fix(default): only use woman on macOS
`man -k "^"` is very slow on macOS.

```
sh-3.2$ time man -k "^" > /dev/null

real	0m1.599s
user	0m0.391s
sys	0m1.209s
```
2021-12-14 20:51:34 -05:00
Henrik Lissner
23f6f90515 bump: :config
noctuid/link-hint.el@d3c5bacc9c -> noctuid/link-hint.el@3be270f3a7
2021-12-14 01:21:33 +01:00
Henrik Lissner
f0ba6c99b2 fix(default): search symbol at point from project root
...Rather than current directory.

While +default/search-project-for-symbol-at-point should operate out of
the current project's root, +default/search-notes-for-symbol-at-point
must operate out of org-directory, and no where else, even if
org-directory is not a valid project. 411ed0c8f8 was written to fix
that, but it indirectly broke
'+default/search-project-for-symbol-at-point' (causing it to always
resolve to the current directory, rather than the current project's
root).

Amend: 411ed0c8f8
Fix: #5831
2021-11-25 17:05:42 +01:00
Jorge Javier Araya Navarro
cd93df6ae8 fix(default): use persp-keymap-prefix's setter 2021-11-24 13:11:17 +01:00
Henrik Lissner
88844e9cec docs: simplify internal docs links
Fewer links means less confusion.

- Merge doom-issue and doom-commit links into doom-ref (for auto-linking
  Issue/PR/commit references).
- Merge doom-module-source and doom-docs-source links into doom-source.
- Rename doom-report-issue to doom-report.
- Use '!' as the icon for module issues link.
- Remove doom-repo (replaced with "doom:*" in :lang org module).
- Add doomdir and emacsdir links to :lang org module.
2021-11-21 20:04:28 +01:00
Henrik Lissner
c27f005011 docs(:config): update READMEs to new format 2021-11-21 20:04:28 +01:00
Henrik Lissner
df62fcba26 docs: add category readmes 2021-11-21 20:04:28 +01:00
Henrik Lissner
49a464a870 fix(default): missing evil-ex-registers for non-ivy users
It was `evil-show-registers' that we wanted, not
`evil-ex-registers' (which never existed in the first place). Folks who
did not have :completion ivy enabled (e.g. vertico and helm users) would
see 'commandp, evil-ex-registers' errors when pressing `SPC i r`. Folks
who had it enabled would transparently invoke `counsel-evil-registers'
instead (because it was remapped).

Fix: #5753
2021-11-21 15:34:57 +01:00
Henrik Lissner
407cf56a04 fix(multiple-cursors): references to removed keymaps
Fix: #5802
Ref: hlissner/evil-multiedit@36904ce86e
2021-11-21 03:46:45 +01:00
Henrik Lissner
411ed0c8f8 fix(default): search commands not respecting default-directory
Commands that delegate to `+default/search-project-for-symbol-at-point`
to search a directory (like +default/org-notes-search) would not scope
searches to default-directory.
2021-11-20 00:02:11 +01:00
Seong Yong-ju
a7d30f6853
fix: +default/discover-projects not reading depth
Fix: #5736
Fix: #5735
2021-11-18 19:15:56 +01:00
shelper
8886216874
bump: :tools biblio
bdarcus/bibtex-actions@08c6ca0e5b -> bdarcus/citar@fd33f5c4f7

bibtex-actions is now called citar, and the package comes with
configuration for embark.

Fix: #5723
Close: #5747
Co-authored-by: MPNV38 <MPNV38@zebra.com>
2021-11-18 19:14:51 +01:00
Carlos Pita
4903db036d tweak(default): improve smartparens vanilla bindings
Make bindings better conform to traditional sexp navigation ones.

Fix #5575
2021-10-05 02:30:51 +02:00
Itai Y. Efrat
74aae48944 feat(default): add .emacs.d search on <leader> s e 2021-09-23 11:40:04 +02:00
Daanturo
e19a6523ae feat(default): may include project name for SPC f Y
+default/yank-buffer-path-relative-to-project: with non-nil prefix arg,
copy the file name relative to the project root's parent.

Sometimes we also want to specify the project name to let others know
which is the currently mentioned project.
2021-09-15 19:01:46 +02:00