Commit graph

1048 commits

Author SHA1 Message Date
Henrik Lissner
7bec0e3518
Fix doom/help-search-load-path & doom/help-search-loaded-files
When counsel-rg-base-command is a string, instead of a list.
2020-08-07 18:56:57 -04:00
Henrik Lissner
b5706c5793
Fix inverted on/off message from doom-debug-mode 2020-08-06 00:22:40 -04:00
Henrik Lissner
6f2471cda7
Bind ZX -> Save then kill current buffer
Since bury-buffer is already on SPC b z, and isn't a common operation in
day to day Emacs use.

Other useful keybinds:
  ZZ      -> Save then kill current window
  zx      -> kill current buffer (prompts if unsaved)
  SPC b z -> bury buffer
  zn      -> (operator) narrow buffer
  zN      -> widen narrowed buffer
2020-08-05 20:58:29 -04:00
Henrik Lissner
68507e1eac
Load straight in doom/bump* commands
Prevents errors about missing straight functions/variables.
2020-08-01 15:20:32 -04:00
Henrik Lissner
da1030985d
Minor refactors & reformatting 2020-07-23 01:26:03 -04:00
Henrik Lissner
cf39d7ed59
Fix #3532: file API wouldn't work with TRAMP 2020-07-13 17:14:12 -04:00
Henrik Lissner
46d6d0b586
Use symbol-at-point instead of xref w/ eglot
Otherwise doom-thing-at-point-or-region will return nil, causing
"Nothing under point" warnings when using lookup commands.
2020-06-29 15:12:30 -04:00
Henrik Lissner
aeba2116c7
Fix #3401: doom/help-search returning no results 2020-06-19 15:50:13 -04:00
Gerry Agbobada
32f9070614
Filter out 'eglot backend from doom-thing-at-point
Context : https://github.com/joaotavora/eglot/issues/503

Fixes a bug where having eglot enabled in a buffer will make `SPC *` search the whole project for literally `LSP Identifier at point.`
2020-06-18 23:59:33 +02:00
Henrik Lissner
912961b46d
Merge pull request #3258 from sei40kr/tslint-and-eslint-for-tsx
lang/javascript: Enable TSLint and ESLint for TypeScript-TSX
2020-06-07 14:19:13 -04:00
Henrik Lissner
5092bd82f9
Fix doom/help-search-{load-path,loaded-files}
counsel-rg-base-command now accepts a list.

Closes #3323
2020-06-07 13:55:23 -04:00
Henrik Lissner
0f03c32a12
Add with-output-to! macro
For piping output to both stdout and a file/buffer. Used in the coming
CLI rewrite.
2020-06-05 15:18:03 -04:00
Marcus Ramberg
35ec72d080 Rename perl module to raku.
It doesn't actually contain any Perl config.
2020-06-05 21:01:23 +02:00
Henrik Lissner
8bf902d5f4
General refactors & reformatting across the board 2020-06-04 20:13:28 -04:00
Seong Yong-ju
63113ff6ce lang/javascript: Enable TSLint and ESLint for TypeScript-TSX 2020-05-31 00:57:38 +09:00
Henrik Lissner
95eb2989dc
Minimize custom-set-faces! clobbering doom-load-theme-hook
Evaluating custom-set-faces! calls would add setter functions to
doom-load-theme-hook indefinitely, which could add up each time you M-x
doom/reload. Now it adds them to a subhook, which is reset whenever Doom
is reloaded.
2020-05-28 22:01:23 -04:00
Henrik Lissner
a9bf0b8985
Add cmd!, cmd!!, cmds! convenience macros
It's kind of silly that our command lambda macros (λ! and λ!!) need a
snippet, special key sequence or copy-paste to insert, so in the spirit
of fn! -- and to make sure they take up less space than `lambda!` --
I've added `cmd!` and `cmd!!` aliases. `lambda!` and `lambda!!` are now
deprecated. λ! and λ!! will remain.

I've also added `cmds!` as a convenience wrapper around
general-predicate-dispatch.
2020-05-27 18:29:35 -04:00
Henrik Lissner
77a4e8f8a7
Fix switch-project completion defaulting to current project
Affects doom/browse-in-other-project, doom/find-file-in-other-project,
+default/search-other-project and
+default/search-project-for-symbol-at-point.

When performing a text or file search in "another project", prior to
this update the current project would be the first highlighted
candidate, which doesn't make much sense when you're invoking a command
for searching *other* projects.
2020-05-26 14:06:19 -04:00
Henrik Lissner
3253ca8435
Minor refactors & comment/message revision 2020-05-25 22:11:15 -04:00
Henrik Lissner
d1fcbf244b
doom/toggle-debug-mode -> doom-debug-mode 2020-05-25 20:18:36 -04:00
Henrik Lissner
e6c88e4384
Refactor autoloads generator & reduce to one generated file
We no longer need two separate autoloads files, so I merged them and
optimized its generation logic.

Other changes
- Doom will refuse to start up (with a helpful error) if it's in an
  incomplete state. This should hopefully reduce the number of bug
  reports from folks that have done something weird, e.g.
  1. You've changed Emacs versions without running 'doom sync -b'.
  2. You've updated Doom outside of `doom upgrade` and didn't run `doom
     sync -u`.
  3. You've forgotten to run 'doom sync' in the first place!
  4. If a previous 'doom ...' command was aborted midway without running
     'doom sync' afterwards.
- 'doom sync' will emit reminders that you need to reload/restart Emacs
- Autoloads API now uses the `doom-autoloads-` prefix, intead of
  'doom-cli-autoloads-', as will be the new convention in the coming
  rewrite.
- Errors from within the package autoloads should be easier to invoke
  the debugger on.
- `doom-modules` is now stored in your autoloads file. Your module list
  will soon be frozen between calls to 'doom sync' to allow for our new,
  atomic CLI I'm working on. This will also means the `doom!` block
  won't cost anything in interactive sessions.
2020-05-25 15:55:29 -04:00
Henrik Lissner
be889d09e8
Rename doom-format lib -> doom-output
`format` isn't an appropriate for this library, considering it (and
future additions to it) will be mainly concerned with printing or
capturing output.
2020-05-25 15:55:29 -04:00
Henrik Lissner
cc5f498586
Add magic cli.el in modules & refactor module init
Doom now looks for cli.el files in your private directory or modules,
giving them an opportunity to customize the CLI (add commands or
reconfigure existing ones) to suit their purposes.
2020-05-25 15:55:28 -04:00
Henrik Lissner
3a38fc633c
Change doom-{interactive,debug}-mode suffix to -p
Because these are not really modes.

Also makes `doom-debug-mode` an actual (global) minor mode.
2020-05-25 03:43:40 -04:00
Henrik Lissner
09c6e99e23
Fix 'Cannot get this file-path' when bumping in babel edit buffers
Break glass in case of literate configs.
2020-05-25 01:19:03 -04:00
Henrik Lissner
196490c772
Improve UX & output of doom/bump-* commands 2020-05-20 15:33:55 -04:00
Henrik Lissner
f0e6ede81b
Relax how strict doom/bump-package-at-point is about point
This command would formerly work only if the point was on the opening
parenthesis, and sometimes insert the :pin in odd places. It is now much
more relaxed.
2020-05-19 22:00:20 -04:00
Henrik Lissner
df0bca6579
Fix doom/bump-module for :private packages 2020-05-19 19:11:02 -04:00
Henrik Lissner
92b98bed11
Fix doom/help-search-loaded-files
Would throw a string type error because load-history doesn't only
contain sublists whose CARs are strings.
2020-05-19 17:33:57 -04:00
Henrik Lissner
2b8388079b
Fix doom/bump-module command
Also allows you to bump :core now.
2020-05-15 05:37:10 -04:00
Henrik Lissner
ea18c83c0a
General refactors & reformatting across the board 2020-05-15 01:44:53 -04:00
Henrik Lissner
0e851ace9b
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.

Fixes #2802, #2737, #2386

The big highlights are:

- Fix #2802: We now update recipe repos *before* updating/installing any
  new packages. No more "Could not find package X in recipe repositories".

- Fix #2737: An edge case where straight couldn't reach a pinned
  commit (particularly with agda).

- Doom is now smarter about what option it recommends when straight
  prompts you to make a choice.

- Introduces a new init path for Doom. The old way:
  - Launch in "minimal" CLI mode in non-interactive sessions
  - Launch a "full" interactive mode otherwise.
  The new way
  - Launch in "minimal" CLI mode *only* for bin/doom
  - Launch is a simple mode for non-interactive sessions that still need
    access to your interactive config (like async org export/babel).
  - Launch a "full" interactive mode otherwise.

  This should fix compatibility issues with plugins that use the
  async.el library or spawn child Emacs processes to fake
  parallelization (like org's async export and babel functionality).

- Your private init.el is now loaded more reliably when running any
  bin/doom command. This gives you an opportunity to configure its
  settings.

- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
  deferred activation of a number of packages. Users can remove these
  modes from these hooks; altogether preventing them from loading,
  rather than waiting for them to load to then disable them,
  e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
  'doom-first-buffer #'smartparens-global-mode)

  Hooks added to doom-first-*-hook variables will be removed once they
  run.

  This should also indirectly fix #2386, by preventing interactive modes
  from running in non-interactive session.

- Added `doom/bump-*` commands to make bumping modules and packages
  easier, and `doom/bumpify-*` commands for converting package!
  statements into user/repo@sha1hash format for bump commits.

- straight.el is now commit-pinned, like all other packages. We also
  more reliably install straight.el by cloning it ourselves, rather than
  relying on its bootstrap.el.

  This should prevent infinite "straight has diverged from master"
  prompts whenever we change branches (though, you might have to put up
  with it one more after this update -- see #2937 for workaround).

All the other minor changes:

- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
  simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
  already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
  trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
  doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
  1. Child instances will no longer inherit the process environment of
     the host instance,
  2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-15 01:33:52 -04:00
Henrik Lissner
4f27d8e774
Fix #3070: project scratch buffers not persistent 2020-05-08 15:08:25 -04:00
Henrik Lissner
cb8b66dd36
Remove old persisted scratch buffer file
This was for backward compatibility with the old format. Removing this
now after two months being deprecated.
2020-05-08 14:44:48 -04:00
Henrik Lissner
fd342dfdb0
Fix #2982: multiple instances of Emacs on restart
When invoking a restart during a restart (Yo dawg...)
2020-05-03 19:49:18 -04:00
Henrik Lissner
0c3ffbbb25
Fix wrong-type-arg arrayp error on doom/help search commands
The org crawler assumed that no headings were empty, which led to errors
when they were.
2020-05-03 16:38:44 -04:00
Henrik Lissner
4b28e9ce86
Rework & polish doom-store library
+ Add doom-store-rem
+ Add real doom-store-member-p (to replace doom-store-exists alias)
+ Fix doom-store-clear not clearing in-memory store
+ Add doom-store-flush
+ Add deferred flushing through doom--inhibit-flush lexical var
+ Update doom-store-persist & doom-store-desist for new API
2020-05-02 19:32:02 -04:00
Henrik Lissner
29c0781916
Fix doom-store library
And rename doom-store-set -> doom-store-put to be more consistent with
the underlying operation.
2020-05-02 13:17:10 -04:00
Henrik Lissner
29e91a6ff6
Replace doom-cache library with doom-store
And remove persistent-store dependency.
2020-05-02 00:14:08 -04:00
Gerry Agbobada
61b7368d49
Add a few missing modes to hdm alist
Rule was mostly to add major-modes defined by packages bundled in the module
2020-05-01 02:03:04 +02:00
Henrik Lissner
ba8892d7e9
Fix #3004: stale root cache on project search 2020-04-30 19:02:20 -04:00
Henrik Lissner
d12752324a
Introduce letf! convenience macro
A more succinct cl-letf, which allows for local functions and macros.
2020-04-29 23:48:21 -04:00
Henrik Lissner
c1127a5bde
Rewrite move/copy/delete file commands
To use rename-file, copy-file and delete-file, so these commands can
enjoy the benefits of any plugins that have advised these, like org-roam
does for rename-file.
2020-04-27 01:51:18 -04:00
Henrik Lissner
08d0eae595
Merge pull request #2925 from rushsteve1/develop
doom/upgrade use -y CLI flag
2020-04-24 00:11:48 -04:00
Henrik Lissner
06d5d5e6c0
General refactors, reformatting & comment revision 2020-04-23 23:56:17 -04:00
Henrik Lissner
2d766cfa0c
Remove :lang assembly
This module is too trivial, and provides nothing that the user couldn't
install themselves.
2020-04-23 23:28:50 -04:00
Steven vanZyl
5c340a670c doom/upgrade use -y CLI flag
When using the internal doom/upgrade command to upgrade using the CLI
tool, do so with the -y flag.

This is admittedly a temporary solution, but without it the CLI tool
will prompt for confirmation, which cannot easily or obviously be given
while inside Emacs.
A better solution would be to somehow integrate the prompt so that it
appears in the minibuffer as normal Emacs prompts do. But for now this
at least fixes doom/upgrade.
2020-04-17 13:16:53 -04:00
Henrik Lissner
778652bfd6
Fix void-function doom-try-hook
This snuck into a recent commit, but the function hasn't been renamed
yet.
2020-04-17 03:20:38 -04:00
Henrik Lissner
b78c862e98
Refactor compile macro in doom/reload-* commands 2020-04-14 19:49:20 -04:00
Henrik Lissner
93ff95c06e
Refactor sudo commands 2020-04-14 19:13:56 -04:00