Commit Graph

170 Commits

Author SHA1 Message Date
Henrik Lissner
f42bfde8ae
Fix #1648: doom upgrade not updating packages
...when Doom itself is up-to-date.
2019-08-07 20:55:56 -04:00
Henrik Lissner
4a92d12267
Fix void-variable package error on 'doom update' 2019-08-07 17:22:46 -04:00
Henrik Lissner
b808c4e1ab
Reload autoloads files in noninteractive sessions
After it's been regenerated, so that any hacks (*cough*org/magit*cough*)
are in scope.
2019-08-07 16:55:04 -04:00
Henrik Lissner
c8d6ab823b
Update documentation for 'doom env' 2019-08-07 01:42:46 -04:00
Henrik Lissner
54edffc4bb
cli/packages: emit a little more debug info
To mark the start of purging/regrafting procedures.
2019-07-29 21:29:43 +02:00
Henrik Lissner
435436e390
Fix 'doom purge' failing to delete build directory 2019-07-29 21:18:49 +02:00
Henrik Lissner
7559949e09
Rewrite 'doom purge'; add repo regrafting
'doom purge -r' now re-grafts shallow cloned packages (compacting them
as much as possible).
2019-07-29 21:09:23 +02:00
Henrik Lissner
87fd81281f
Rewrite 'doom update'
- Is now much more fault tolerant (produces better errors)
- Now handles async.el process errors as well
- Standardizes data structure of thread responses
2019-07-29 21:01:46 +02:00
Henrik Lissner
da954aa361
Improve 'doom build' reporting & checks
- Fix 'doom build' not byte-compiling stale dependencies of rebuilt
  packages.
- Fix 'doom build' logging the wrong number of packages that were
  rebuilt.
2019-07-29 20:59:52 +02:00
Henrik Lissner
c32244ad4e
Generalize doom-sh
And slightly reformat 'doom upgrade' "you have updates" message.
2019-07-29 20:57:20 +02:00
Henrik Lissner
2b81233353
Clean up _upgrade rmeote after 'doom upgrade' 2019-07-29 03:47:56 +02:00
Henrik Lissner
ba07fe575e
Add {--no-{elpa,builds},-r,--repos} flags to 'doom purge' 2019-07-29 03:47:12 +02:00
Henrik Lissner
8a16513107
Fix various errors in 'doom upgrade' 2019-07-29 03:34:35 +02:00
Henrik Lissner
2304d69898
Fix wrong-type-arg number during 'doom upgrade' 2019-07-29 03:21:55 +02:00
Henrik Lissner
c28fff4fbf
Fix void-variable branch error on 'doom upgrade' 2019-07-29 03:18:39 +02:00
Henrik Lissner
c2af0723d7
Show progress percentage during 'doom update' 2019-07-28 16:10:54 +02:00
Henrik Lissner
efb4584797
Alias 'doom build' to 'doom rebuild' 2019-07-28 14:02:51 +02:00
Henrik Lissner
a9c1986a68
Fix and refactor 'doom upgrade' #1607
Now accepts the -f/--force switches to discard local changes to
the .emacs.d directory.
2019-07-28 13:47:57 +02:00
Henrik Lissner
4dc42de9e3
def-command! -> defcli!
And def-command-group! -> defcligroup!, to match our new convention for
naming definer macros.
2019-07-28 02:32:25 +02:00
Henrik Lissner
8dab8eefca
Prevent load-file-name/#$ replacements in strings & comments 2019-07-27 22:57:32 +02:00
Henrik Lissner
8d388ebba9
Improve 'doom rebuild' checks & formatting of logs
Corrects stale bytecode a little more aggressively.
2019-07-27 17:22:47 +02:00
Henrik Lissner
21a27b52d8
Refactor autoloads generation
- Correctly replace references to load-file-name and $# in autoloads.
- Don't load resulting autoloads file twice
- Read package autoloads literally (a little faster)
2019-07-27 16:59:10 +02:00
Henrik Lissner
0dfdbd471c
Ensure envvars at top of envvar file are checked
The regexp expects there to be at least one newline at the top of the
file, otherwise the very first envvar is skipped.
2019-07-27 02:46:50 +02:00
Henrik Lissner
597ef77c20
Ignore envvars prefixed with __
They are likely private. There are some public variables with single
underscore prefixes, however, like _FASD_DATA and _FASD_VIMINFO.
2019-07-27 02:46:49 +02:00
Henrik Lissner
6fcaa80355
Improve autoloads mtime scanning on packages
Scan source files in build directory rather than repos, which are better
indicators of a stale autoloads file.
2019-07-26 20:17:30 +02:00
Henrik Lissner
a10693886e
Fix double-rebuilding & lingering stale elc files
This update addresses two evasive issues:

1. Packages updated with `doom update` would not rebuild correctly,
   requiring a `doom refresh` afterwards,
2. Packages would fail to rebuild even if their byte-compiled files were
   stale. The result: "*.el is newer than *.elc" warnings at startup.
2019-07-26 20:17:29 +02:00
Henrik Lissner
f8c4d075a5
Fix doom purge reporting failure despite success 2019-07-26 20:17:29 +02:00
Henrik Lissner
c2ae6f30a5
Don't compress auto-mode-alist
Modules may readd their entries afterwards, anyway.
2019-07-26 15:33:32 +02:00
Henrik Lissner
8834ba17e3
Only return non-nil if doom-packages-purge worked 2019-07-26 13:59:14 +02:00
Henrik Lissner
9311744f7f
Restore comment header in envvar files
`shell-command` erases the target buffer before piping output to it.
Which means the envvar file comment header was wiped out. This causes
trouble for the envvar file parser, which expects the envvar list to
start with two newlines.
2019-07-26 13:38:13 +02:00
Henrik Lissner
321b797046
cli/packages: fix infinite waiting on pkg update
Caused lecause straight is prompting for input in a headless
session *and* from a headless async child instance of Emacs. It waits
forever for input for a question we could never see or respond to.

How sad.
2019-07-26 11:54:37 +02:00
Henrik Lissner
44c694da47
Make bin/doom options consistent & improve errors/docs 2019-07-26 03:12:07 +02:00
Henrik Lissner
829ad8c8b7
cli/packages: refactor doom-packages-purge
Sets it up for a later update where purging repos will no longer be the
default behavior.
2019-07-26 03:12:06 +02:00
Henrik Lissner
905ba1d23c
Refactor autoloads byte-compilation
- Let-bind byte-compile-* vars instead of using file-local vars.
- Fix duplicate bullet point in "Copied backup..." message.
- Only display refresh message if cli command was successful.
2019-07-26 03:12:06 +02:00
Henrik Lissner
bdcb156b91
Manually finalize straight transactions
Straight expects to be used interactively, which don't do (yet). Its
transactional system depends on idle timers, which don't run in a
noninteractive session, so we have to nudge it ourselves.
2019-07-26 03:12:06 +02:00
Henrik Lissner
2aa7dbfb27
cli/packages: refactor doom-packages-update
- Now handles errors from threads gracefully, rather than failing
  silently.
- Exploits straights modification system to trigger rebuilds
  later (instead of force-rebuilding after each update).
2019-07-26 03:12:06 +02:00
Henrik Lissner
ba990a6c9d
Build package autoloads in install order #374
Before this update, the autoloads files were collected in
lexicographical order (by traversing straight's build directory). By
using straight--build-cache's keys (which are entered in the order they
were registered) we avoid issues like
2019-07-23 21:54:50 +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
afebdb35da
Refactor autodef generator 2019-07-22 23:22:54 +02:00
Henrik Lissner
a301330603
Fix doom update #1584
It would no-op if you responded "y" to the 'update them?' prompt, and
proceed if you responded "n".

Doom must be in its rebellious phase.

Also relevant: #1585
2019-07-22 23:22:38 +02:00
Henrik Lissner
ffdb726ed8
Exclude gh.el from autoloads
See sigma/gh.el#95
2019-07-22 06:06:58 +02:00
Henrik Lissner
6f878a38bd
Fix incorrect path to init.example.el 2019-07-22 04:48:44 +02:00
Henrik Lissner
1c4215c187
Fix 'command not found' errors for hidden commands 2019-07-22 04:46:14 +02:00
Henrik Lissner
879ab3b2f3
Replace incorrect usage of doom-dir with doom-path 2019-07-22 04:20:52 +02:00
Henrik Lissner
76bb892a0c
Move cli/quickstart -> cli/install 2019-07-22 04:16:47 +02:00
Henrik Lissner
d980920c97
cli/packages: fix rebuild ignoring argument 2019-07-22 02:37:48 +02:00
Henrik Lissner
060ede0e2e
General, minor reformatting across the board
And an offering of blood to our great lord Byte Compiler-sama.
2019-07-22 02:37:45 +02:00
Henrik Lissner
71ba4789ca
Fix hash-table-p errors on reloading pkg autoloads
Because doom-modules wasn't set in doom-module-path's scope.
2019-07-22 02:37:44 +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
c3354e2620
cli: disable patch-macos (only --undo/-u works)
This has been deprecated for a while. I will remove it entirely with the 2.1
release, but for now, you can no longer patch your app bundle with this.

Use 'doom env refresh' instead.
2019-07-20 11:40:00 +02:00
Henrik Lissner
527079094d
Expand docs for doom {install,update,autoremove} 2019-07-12 14:16:53 +02:00
Henrik Lissner
cb401c8302
Don't abbreviate autoload paths on windows #1548 2019-07-10 16:05:40 +02:00
Henrik Lissner
dfa5324f3d
cli/env: change how envvars are ignored
Improves the detection and omission algorithm of undesired envvars.
2019-07-10 15:06:45 +02:00
Henrik Lissner
71d505b893
Cache doom-modules on doom refresh 2019-07-07 14:10:21 +02:00
Henrik Lissner
52f575d4d2
Exclude PROMPT & RPROMPT envvars from env file 2019-07-02 14:16:58 +02:00
Henrik Lissner
275f499ce9
Exclude PS1 envvar from env file 2019-07-02 13:01:28 +02:00
Henrik Lissner
5d0c408c38
cli/env: ignore PWD envvar 2019-06-30 09:48:54 +02:00
Henrik Lissner
9a02bd8ac8
Minor refactors across the board
- when-let* -> when-let
- Fix projectile-locate-dominating-file for connected remote files
2019-06-26 14:31:06 +02:00
Henrik Lissner
4f5f51237e
cli/env: remove ignored vars retroactively
doom-env-ignored-vars is now treated as a list of regexps.

Also updates docstrings and announces ignored variables.
2019-06-26 14:31:06 +02:00
Henrik Lissner
cdc41fc822
cli/env: reformat envvar file header
Places the generation command on line 2 for easier retrieval and
reformats explanation below.
2019-06-26 14:31:06 +02:00
Henrik Lissner
b45591989b
Revert remote reloading after refreshing autoloads
It's too flimsy, breaks easily, and doesn't handle the case where
multiple instances of Emacs are open.
2019-06-18 22:10:19 +02:00
Henrik Lissner
6be401f1a7
Refactor Doom core & reload autoloads remotely
- Move subr-x/cl-lib loading to core-lib
- Revise docstrings for and rename various CLI functions to be more
  descriptive and up-to-date
- After regenerating autoloads file, bin/doom will try to reload
  autoloads files remotely, through the server/daemon, if possible. This
  is highly experimental and could break
2019-06-16 23:01:17 +02:00
Henrik Lissner
5e9c020c21
doom-files-in: replace NOSORT w/ SORT; change default MATCH
- SORT defaults to t
- MATCH's new default regexp excludes files that start with underscore.
2019-06-16 19:16:23 +02:00
Henrik Lissner
47739698a8
Correct typo in doom env enable output #1499 2019-06-16 19:16:22 +02:00
Henrik Lissner
84fd744e3f
Minor, general refactor & comment revision 2019-06-14 11:08:59 +02:00
Gerry Agbobada
9d668791da Correct documentation of env_var file
Because of 3ed54e191b The `load-env-vars` advice is false now. Instead we can propose setting "doom-env-file" correctly, it seems to work for me.
2019-06-13 10:03:50 +02:00
Henrik Lissner
6641e26283
Refactor package management API
Sets out to solve a number of issues with the package management
process. Namely:

- To-be-removed packages that are simply being removed are no longer
  incorrectly labeled "quelpa->elpa", but "removed" instead.
- A backend (elpa vs quelpa) column was added to the package listing
  confirmation when running `doom update`.
- Doom now correctly recognizes that packages installed with a psuedonym
  are installed, and will not endlessly attempt to uninstall and
  reinstall them on every `doom refresh`.
- Packages declared with :built-in will no longer lose their built-in
  marking if said package is not actually present in Emacs' site load
  paths. i.e. if you say it's built in, Doom won't question it.
- package!'s :ignore property is now treated as a form whose evaluated
  result will be used as its value.
2019-06-11 08:01:42 +02:00
Henrik Lissner
29293aa17f
Fix #1453: ensure package autoloads are reloaded
`doom-package-update` does not trigger regeneration of the package
autoloads file.
2019-06-10 09:38:56 +02:00
chrunchyjesus
2631ca90d9
fix shebang for macos patch 2019-06-08 07:31:24 +02:00
Henrik Lissner
0733a6dfac
Replace SPC h p with doom/help-packages
Now that it supersedes describe-packages in functionality.
2019-05-30 14:01:48 -04:00
Henrik Lissner
990896ac9c
Fix doom quickstart help formatting
Not breaking lines in the right place.
2019-05-30 14:00:41 -04:00
Henrik Lissner
93876028b4
cli/upgrade: always update packages
Even when Doom is up-to-date.
2019-05-22 17:10:44 -04:00
Henrik Lissner
5ec0c5ba3f
cli/env: refactor 2019-05-17 21:34:21 -04:00
Henrik Lissner
3ed54e191b
Fix #1322: replace load-env-vars w/ custom loader
I've replaced load-env-var with our own custom parser. load-env-var
expects a well-formatted env file, which neither env nor set produces,
which is what doom env uses to dump the shell environment.

This should fix issues that arise when envvars (like PATH) contain
arbitrary whitespace.
2019-05-17 20:19:35 -04:00
Henrik Lissner
2cb5d895d7
cli/upgrade: fix void-function error
Derpity derp derp.

Derp McDerpington.

Derpsville, population me.
2019-05-15 17:29:43 -04:00
Henrik Lissner
4b66b7c29b
cli/upgrade: emit full error, if one occurs 2019-05-15 17:17:56 -04:00
Henrik Lissner
f7a6b2b33e
cli/upgrade: refresh before updating packages
So missing packages are installed and orphaned ones are removed (and env
file updated, if necessary).
2019-05-14 23:41:02 -04:00
Henrik Lissner
f0fe71892b
cli/upgrade: autoremove orphaned packages 2019-05-14 22:30:16 -04:00
Henrik Lissner
7443669b1e
Minor refactors & comment revision 2019-05-13 14:37:00 -04:00
Henrik Lissner
2358dbfc84
Replace "Doom" w/ ~/.emacs.d when 'upgrade' fails 2019-05-12 00:56:17 -04:00
Henrik Lissner
a558f9b3f1
cli/quickstart: fix font path for all-the-icons-install-fonts
all-the-icons-install-fonts guesses the font path based on
`window-system', which is nil in tty Emacs.
2019-05-12 00:56:17 -04:00
Henrik Lissner
d7bc99c3c3
Add deprecation warnings to doom patch-macos
And make "doom env enable" an alias for "doom env auto"
2019-05-09 18:43:32 -04:00
Henrik Lissner
e0e82ffbeb
cli/quickstart: ensure new init.el doom! is seen 2019-05-06 02:12:49 -04:00
Henrik Lissner
e75c41b10d
Fix autoload/hydras.el autoloads #1388
Caused by autoloads paths not being resolved correctly during
generation.
2019-05-05 19:40:51 -04:00
Henrik Lissner
45266213a5
Revert 087127a3
Installing buttercup on demand wasn't robust enough. Tests were breaking
more often.
2019-05-05 00:02:59 -04:00
Henrik Lissner
eb47568701
cli/quickstart: generate {init,config,packages}.el separately
Instead of aborting if DOOMDIR exists, all three files will be
checked (and generated) separately.
2019-05-01 21:02:29 -04:00
Henrik Lissner
6d314c2795
Revise and update docstrings and comments 2019-05-01 21:02:28 -04:00
Henrik Lissner
6bd6c1623b
Fix 'doom upgrade' not updating pkg autoloads
Folks should no longer need to run 'doom refresh' after upgrading.
2019-04-30 18:44:44 -04:00
Henrik Lissner
087127a31d
Lazy-install buttercup package 2019-04-29 18:48:35 -04:00
Henrik Lissner
88406bb11a
Fix unit test runner 2019-04-24 18:16:07 -04:00
Henrik Lissner
defd60b24b
Fix doom quickstart not installing packages
If the user had no ~/.doom.d/init.el to begin with, and never reads it
after it's been created (by `doom quickstart`), then Doom can't possibly
know what modules to install packages for, therefore no packages get
installed!
2019-04-09 03:31:05 -04:00
Henrik Lissner
2b7c215aee
Refactor byte-compile dispatchers
And don't implicitly compile ~/.emacs.d/init.el unless :core (or no
args) are passed.
2019-04-06 00:11:32 -04:00
Henrik Lissner
5be0e2be4a
Omit private module on doom compile
The private module won't be byte-compiled implicitly anymore, as it can
cause unexpected problems with stale code and config portability.

doom compile          -> only compiles ~/.emacs.d
doom compile :core    -> ~/.emacs.d/core
doom compile :plugins -> ~/.emacs.d/.local/packages/elpa
doom compile :private -> ~/.doom.d
2019-04-05 03:19:38 -04:00
Henrik Lissner
700cda370b
Refactor doom env
- Limits process-environment during scraping
- Add `doom-env-executable` and `doom-env-switches` variables
- Announce what commands were run to produce your env var within env var
  file header
2019-04-03 00:09:22 -04:00
Henrik Lissner
7b8a2fcff8
Don't capture INSECURE, DEBUG & YES envvars
They should be transient.
2019-03-28 14:47:31 -04:00
Henrik Lissner
af37f9af58
Fix wrong-number-args error on doom env 2019-03-28 13:30:39 -04:00
Henrik Lissner
9b97631ddf
Fix typo in env file template 2019-03-28 02:25:28 -04:00
Henrik Lissner
2f0ad0e269
Fix -y/--yes/YES in doom quickstart 2019-03-28 02:24:19 -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
7fd1497e88
Ask to install all-the-icons fonts in doom quickstart 2019-03-16 23:59:50 -04:00