Commit Graph

47 Commits

Author SHA1 Message Date
Henrik Lissner
388267d256
Add --force/-f support to doom refresh 2019-07-22 23:22:55 +02:00
Henrik Lissner
93f7520c79
Refactor Doom core init process (again)
- Eager-load all core autoloaded libraries if autoloads file isn't
  present.
- Renames functions to be more descriptive of their true purpose:
  - doom-initialize-autoloads -> doom-load-autoloads-file
  - doom-load-env-vars -> doom-load-envvars-file
- Use doom-module-p instead of featurep! for backend use (the latter is
  mainly syntax sugar for module use, and evaluates at compile/expansion
  time, which may cause hash-table-p errors early in the startup
  process).
- Reorder plist library to prevent load order race condition with the
  functions using the macros that haven't been defined yet.
2019-07-22 23:22:54 +02:00
Henrik Lissner
22404f1ec5
Fix "nil is not any command *I* know"
What good is sass if it isn't right?
2019-07-22 22:34:08 +02:00
Henrik Lissner
1c4215c187
Fix 'command not found' errors for hidden commands 2019-07-22 04:46:14 +02:00
Henrik Lissner
e9e6786dd3
Fix file-missing cli/quickstart error 2019-07-22 04:22:42 +02:00
Henrik Lissner
d2fa1a3dd1
Load seq in core-cli 2019-07-22 04:15:45 +02:00
Henrik Lissner
b90dede1ab
💥 Replace package.el/quelpa with straight #374
There are a few kinks to iron out, but for the most part it's done. Doom
Emacs, powered by straight. Goodbye gnutls and elpa/quelpa issues.

This update doesn't come with rollback or lockfile support yet, but I
will eventually include one with Doom, and packages will be (by default,
anyway) updated in sync with Doom.

Relevant threads: #1577 #1566 #1473
2019-07-22 02:30:40 +02:00
Henrik Lissner
6d314c2795
Revise and update docstrings and comments 2019-05-01 21:02:28 -04:00
Henrik Lissner
1ab8dac872
Fix arg-less color functions in print!/format! 2019-04-24 18:16:07 -04:00
Henrik Lissner
2dc52bc9be
💥 Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.

Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
  commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)

The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.

+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
  running `doom env enable` (`doom env clear` will reverse this and
  delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
  file. You won't need it if you're confident Emacs will always be
  started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
  doom/reload-env`. Note: this won't work if the Emacs session you're
  running it in doesn't have a correct SHELL set. i.e. don't use this to
  create your first env file!

The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.

This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 01:56:09 -04:00
Henrik Lissner
f994fb07bf
bin/doom: make invalid command a user-error
It shouldn't invoke error handlers.
2018-09-28 22:29:42 -04:00
Henrik Lissner
8a8b5c6089 Refactor bin/doom & doom-dispatch
Done to make bin/doom produce better debugger output (and more readily).
A lot of bin/doom errors aren't recurring, so it's better to produce the
full error report ASAP.
2018-09-28 21:13:27 -04:00
Henrik Lissner
fe79178b1f
Revise docstrings for run/doc dispatchers 2018-09-09 23:16:55 -04:00
Henrik Lissner
77d2d84e14
Refactor core-cli
Moved to separate files for better organization.
2018-09-09 09:58:20 -04:00
Henrik Lissner
7d3ffdff06
Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
Henrik Lissner
1f3fa61c2b
Allow debugging in doom quickstart 2018-09-09 09:58:18 -04:00
Henrik Lissner
2c5ccaa864
Update patch-macos documentation
Follows up on 0fc9b6be
2018-08-31 00:19:34 +02:00
Henrik Lissner
2d21f1af6d
Fix comparison link for doom upgrade
The hashes were the wrong way around.
2018-08-30 13:36:21 +02:00
Henrik Lissner
cc1b0f7ee6
Show comparison diff link on bin/doom upgrade 2018-08-30 00:42:34 +02:00
Henrik Lissner
0fc9b6be91
Improve patch-macos wrapper script
Reported to produce better results.
2018-08-29 23:01:59 +02:00
Henrik Lissner
902386b60f
Fix file-missing error during patch-macos
Forgot to add Emacs.app to the end of the directories to be searched!
Whoops!
2018-08-29 12:44:09 +02:00
Henrik Lissner
9ee1d8d0e2
Set indent function for dispatcher! macro 2018-08-28 19:14:18 +02:00
Henrik Lissner
ef6e09dac9
Search for Emacs.app in /usr/local/opt
And refactors doom-patch-macos function, its dispatcher, and its usage
in doom-quickstart.
2018-08-28 19:13:34 +02:00
Henrik Lissner
2b560a6a0e
General & minor refactoring 2018-08-28 13:36:44 +02:00
Henrik Lissner
7510f5abf0
bin/quickstart: fix wrong-number-of-args error 2018-08-25 12:02:19 +02:00
Henrik Lissner
33b0a8d36c
bin/doom quickstart: Offer to patch Emacs.app 2018-08-25 03:40:00 +02:00
Henrik Lissner
08c09c2898
bin/doom patch-macos: show "Patching X" message 2018-08-24 01:12:05 +02:00
Henrik Lissner
c5f3cc17c5
Fix doom quickstart not respecting -y/--yes #817 2018-08-23 17:31:21 +02:00
Henrik Lissner
fa81f7ed71
Improve doom patch-macos documentation
Makes doom help patch-macos more informative, and simplifies
confirmation prompt when using it.
2018-08-23 16:49:03 +02:00
Henrik Lissner
f9b06bd3a8
bin/doom: fix Emacs.app patch wrapper script 2018-08-19 03:59:23 +02:00
Henrik Lissner
2be0772b13
bin/doom: add patch-macos command
Patches Emacs.app to respect your shell environment.
2018-08-19 03:44:42 +02:00
Henrik Lissner
fbe4e94fbc
Mention restart when bin/doom is finished
It is preferrable to doom/reload.
2018-08-04 13:44:55 +02:00
Henrik Lissner
2ee177d588
Don't invoke debugger on "Aborted" messages 2018-08-02 16:41:19 +02:00
Henrik Lissner
6cfbeaa4f6
Fix (cl-)?defmacro autodefs
They were formly inserted with (cl-)?defmacro replaced with nil,
otherwise.
2018-07-29 17:42:00 +02:00
Henrik Lissner
ea175180ef
Fix incorrect load-file-name in autodef conditions
Causing errors where featurep! calls in ;;;###autodef cookie conditions
couldn't resolve the correct module from load-file-name.
2018-07-29 17:42:00 +02:00
Henrik Lissner
770463aff2
Don't copy macro autodefs into autoloads verbatim
This makes it necessary to reload the autoloads anytime a macro is
modified at all.
2018-07-29 17:42:00 +02:00
Henrik Lissner
54c7936a77
Don't reload autoloads remotely
Communicating with the Emacs server isn't reliable and has a tendency to
hang, so we no longer do that. Instead, we inform the user to reload it
themselves.
2018-07-12 19:51:21 +02:00
Henrik Lissner
4941e327f4
General refactor for readability
+ Removes redundant/unhelpful comments
+ Renames functions, hooks and variables to be self-documenting
+ Use add-to-list to ensure idempotency (and is more performant)
2018-07-09 15:33:31 +02:00
Henrik Lissner
9648aa4093
Defer server reloading of autoloads
Occasionally, bin/doom commands hang when generating autoloads. It
blocks endlessly after sending a message to an active Emacs server, but
never receives a proper reply.

This commit makes it less likely that this hanging will leave Doom in a
broken state (and also informs the user it is safe to abort the
process).
2018-07-03 03:41:08 +02:00
Henrik Lissner
7408bd170d
Fix void-function errors on doom recompile
Due to autoloads files not being loaded at all in this one startup
route.

Reported by @ar1a & @AloisJanicek
2018-06-26 19:10:24 +02:00
Henrik Lissner
7d59b9c5a5
Use abbreviated, extension-less paths for autodefs
Decreases the size of doom-autoload-file, improves its portability and
fixes byte-compilation support for autodefs.
2018-06-26 18:58:07 +02:00
Henrik Lissner
ca1b9ac1bd
doom refresh: always force autoload regeneration 2018-06-26 18:58:06 +02:00
Henrik Lissner
094735867c
Fix byte-compiler
Because I did a silly. So silly.
2018-06-24 22:39:22 +02:00
Henrik Lissner
ecdde3f377
Fix void-variable: use-package-defaults error
In case use-package hasn't been loaded by this point (if the config has
been fulled byte-compiled).
2018-06-24 22:23:08 +02:00
Henrik Lissner
c9ac30889c
Allow debugger to handle byte-compile errors 2018-06-24 14:48:27 +02:00
Henrik Lissner
f6dc6ac74e
Refactor out map.el usage
After some profiling, it turns out map-put and map-delete are 5-7x
slower (more on Emacs 25) than delq, setf/alist-get and add-to-list for
small lists (under 250 items), which is exactly how I've been using
them.

The only caveat is alist-get's signature is different on Emacs 25, thus
a polyfill is necessary in core-lib.
2018-06-23 19:53:54 +02:00
Henrik Lissner
1efb0a8298
Rename core-dispatcher -> core-cli
The file's role is easier to guess at a glance.
2018-06-20 12:04:11 +02:00