Commit Graph

452 Commits

Author SHA1 Message Date
Henrik Lissner
45240699e0
Remove doom-elpa-dir variable
And just use package-user-dir. No need for two variable when one will
do.
2019-09-26 14:26:47 -04:00
Henrik Lissner
31ccd9be78
Replace vestigial references to def-package!
def-package! is deprecated and is replaced with use-package! to reduce
confusion about its purpose and connection to use-package.
2019-09-13 22:00:34 -04:00
Henrik Lissner
4b736bef68
Introduce doom-interactive-mode
As soft inverse alias for noninteractive; this makes it easier to unit
test functionality that depends on the session type.
2019-09-03 00:37:30 -04:00
Henrik Lissner
91b27bdccc
Remove doom--straight-use-local-dir-a advice
Unnecessary now that straight-base-dir exists.
2019-09-02 22:51:20 -04:00
Henrik Lissner
19899dac82
Fix inverted condition in package-archives assembly 2019-08-28 22:08:13 -04:00
Henrik Lissner
75fe17950e
Refactor doom-initialize-packages
Make it reinitialize more if FORCE-P is provided or doom-init-packages-p
is nil.
2019-08-28 16:46:39 -04:00
Henrik Lissner
8ac1e1a781
Refactor doom init process
- Refactors doom-initialize
- Moves doom-initialize-modules call to init.el, to more easily isolate
  it during unit testing.
2019-08-27 00:05:12 -04:00
Henrik Lissner
879f3a660a
Use new straight-base-dir variable
We can't phase out doom--straight-use-local-dir-a until I fix the issue
with straight not reinstalling packages when their recipes change.
2019-08-21 00:29:12 -04:00
Henrik Lissner
0b2b5d1c6c
Install & track from straight.el's develop branch 2019-08-21 00:09:44 -04:00
Henrik Lissner
b2fd76cb49
Ensure straight is loaded on doom-initialize-packages
Without causing recursive require errors if called in an after! handler
for straight.
2019-08-15 19:56:20 -04:00
Henrik Lissner
8d3536fa77
Initialize package.el on doom-initialize-packages
So that packages installed via package.el are still available.
2019-08-15 19:52:43 -04:00
Henrik Lissner
bc8b6605db
Don't byte-compile straight
This eliminates the possibility of straight throwing an
emacs-version-changed error, which is difficult to catch, when uses
could invoke a straight command interactively and any time. We'll do our
own version checks (later).
2019-08-15 19:51:36 -04:00
Henrik Lissner
c3e2ec0157
Redesign straight initialization #1610 #1607
Straight throws an 'emacs-version-changed' error if you load it with a
version of Emacs it wasn't compiled with. This update causes this to
emit a more helpful error.
2019-07-29 21:09:21 +02:00
Henrik Lissner
19b6e82dc4
Change package! :recipe to extend default recipe
Instead of replacing the whole recipe with the contents of :recipe, only
modify the specified properties. This allows you to specify helpful
parameters like :nonrecursive or :depth without having to include the
full recipe.
2019-07-29 17:22:27 +02:00
Tej Chajed
1eacda2d5c
Fix :fetcher warning to include package name 2019-07-28 10:00:36 -04:00
Henrik Lissner
1a72cf0677
Minor, general refactors to package API 2019-07-26 20:17:30 +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
9eaee096c8
Minor comment revision & general code reformatting 2019-07-23 17:30:32 +02:00
Henrik Lissner
82ae3a73f3
def-advice!->defadvice! & conform to new advice conventions
This commit does two things:

- Renames def-advice! to defadvice!, in the spirit of naming convenience
  macros after the function/macro they enhance or replace.
- Correct the names of advice functions to indicate visibility and
  intent. A public advice function like doom-set-jump-a is meant to be
  used elsewhere. A private one like +dired--cleanup-header-line-a
  shouldn't -- it likely won't work anywhere but the function(s) it was
  made to advise.
2019-07-23 17:24:56 +02:00
Henrik Lissner
76cacb5bfe
💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
Henrik Lissner
0eb200c49f
Refactor package! macro 2019-07-22 23:22:54 +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
23d111132a
Update core-packages.el comments 2019-07-22 23:22:54 +02:00
Henrik Lissner
ea65f82e4d
Fix void doom-package-list error on first install 2019-07-22 03:48:29 +02:00
Henrik Lissner
82bcc2a68f
Disable straight+use-package integration
They won't be loaded together, and shouldn't be used anyway, what with
Doom's package management system.
2019-07-22 02:37:48 +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
51d3b1b424
💥 revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.

In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.

  doom*shut-up -> doom-shut-up-a
  doom*recenter -> doom-recenter-a
  +evil*static-reindent -> +evil--static-reindent-a

The rationale behind this change is:

1. Elisp's own formatting/indenting tools would occasionally struggle
   with | and * (particularly pp and cl-prettyprint). They have no
   problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
   github markdown) struggle with it, sometimes refusing to highlight
   code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
   intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
   on haphazardly way back when Doom was simply "my private config".

Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.

Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
  macro. The old pair weren't as useful. The new def-advice! saves on a
  lot of space.
- Removed "stage" assertions to make sure you were using the right
  macros in the right place. Turned out to not be necessary, we'll
  employ better checks later.
2019-07-22 02:27:45 +02:00
Henrik Lissner
57a5137b4b
Remove melpa mirror
It's fairly outdated (7 months) and only adds time to refresh process.
Need to find better mirrors or switch to straight soon.
2019-07-13 13:58:53 +02:00
Henrik Lissner
3b17d767b8
package!: fix the fix fix fix for the :built-in fix
fixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfix
fixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfix
fixfix   fixfixfixfixfixfixfixfixfixfixfixfi    fixfix
fixfi    fixfixfixfixfixfixfixfixfixfixfixf     fixfix
fixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfix
fixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfix
fixfix                                       fixfixfix
fixfixfix       everything is fine        fixfixfixfix
fixfixfixfixfix                     fixfixfixfixfixfix
fixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfix
fixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfix
2019-07-05 23:53:56 +02:00
Henrik Lissner
0dab58ef19
package!: fix the fix for :built-in fix
fixfixfix
2019-07-05 23:07:05 +02:00
Henrik Lissner
ecc4e8087c
package!: fix :built-in property 2019-07-05 22:30:24 +02:00
Henrik Lissner
1f644d07e0
package!: accept 'prefer in :built-in property
This tells Doom's package manager to prefer the built-in package, if it
is present, rather than installing the new version from elpa.
2019-07-05 20:03:37 +02:00
Henrik Lissner
d8e7a2003b
Fix custom.el writing to DOOMDIR/init.el too early
This would cause ~/.doom.d/init.el to exist before `doom quickstart` can
copy ~/.emacs.d/init.example.el into it, causing some newcomers to
experience a wrong-type-argument: hash-table-p error at startup (and no
modules being enabled).
2019-07-02 23:17:20 +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
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
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
9bc47ca329
Minor refactors
- Don't aggressively load gnu-elpa-keyring-update, it autoloads itself
- Update docstring + comments
- scroll-margin = 1
2019-05-13 19:34:44 -04:00
Henrik Lissner
5e8db5a860
Refactor core-packages + add gnu-elpa-keyring-update
- Adds melpa-mirror, for those lonely days when melpa is down
- Reduce logging spam from package!
- Revise comments & use outline-mode headings
- Prioritize melpa over elpa
2019-05-12 22:09:52 -04:00
Henrik Lissner
388e0def2c
Cheer up the byte-compiler
You deserve better than those warnings.
2019-05-02 21:54:47 -04:00
Henrik Lissner
c399c07694
Add :tools lsp checks for +lsp flag
Also:
- Reorganizes some :lang modules' packages.el file.
- Adds setuptools check in lang/python
- Adds javac check in lang/java
- Removes the depends-on! macro
2019-04-24 18:16:05 -04:00
Henrik Lissner
ff42cf0767
Rewrite require! and change depends-on!
depends-on! was changed to no longer load a specified module's
packages.el, but to preform a module-enabled assertion. It emits an
error if the linked module isn't (or specified flags aren't) enabled.
2019-04-21 19:40:02 -04:00
Henrik Lissner
eb1296387f
Make load-env-vars a core package
Fixes a race condition where the load-env-vars package is used before it
was (or could be) installed.
2019-03-28 13:30:39 -04:00
Henrik Lissner
a443d9ab07
Refactor doom-initialize-packages & package API
- Packages are initialized once, when package.el is first loaded, and
  must be updated manually via doom/reload-packages.
- Package->module association is now stored in the package's PLIST under
  :modules. This is an internal property and cannot be explicitly set
  through `package!'
- Add doom-package-list function
- Rename doom-get-packages to doom-find-packages
- Updated doom-find-packages' docstring
- Added the :core filter to doom-find-packages
- Simplified doom-initialize-packages
- doom/reload calls doom/reload-packages if necessary.
- Fix redundant properties in doom-packages
- Remove tracking of after!, def-package! and def-package-hook! blocks.
  Replaced with doom-package-list being able to see all packages, even
  in disabled modules.
- Add :built-in property to package! for dummy packages. This is
  important so that doom/describe-package can see built-in packages.
2019-03-08 04:25:44 -05:00
Henrik Lissner
b054190820
New doom/describe-packages command
Replaces describe-packages and adds Doom module awareness to package
documentation.
2019-03-04 20:47:25 -05:00
Henrik Lissner
3923760c7c
Adjust compile-time state in package helper macros 2019-01-02 14:11:02 -05:00
Henrik Lissner
9628a74718
Fix disable-packages! macro
Now rolls out package! calls, rather than adjusting state directly.
2019-01-02 13:17:26 -05:00
Henrik Lissner
15991b5639 Refactor quiet! to be less destructive
It's possible for the debugger to be invoked from inside code wrapped in
a (quiet! ...) call. The debugger pauses Emacs in a broken state where
the functions locally rebound by quiet! (e.g. message, load-file,
write-region, etc) are never returned to their original definitions.

This attempts to reduce that probabilityby changing how quiet! silences
code. Rather than silencing them completely, they will be logged
to *Messages* but not displayed in the echo area.

Also, quiet! is now used less, where it isn't strictly needed (or where
inhibit-message is sufficient).
2018-09-28 21:13:27 -04:00
Henrik Lissner
377dbae3fc
Install/compile packages in order of declaration
This should fix an issue where a package A, which uses macros from a
package B, is installed before package B, causing void-function errors.

The currently known and affected packages are neotree, parinfer, and
evil-collection.
2018-09-25 11:00:30 -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
80ddf2122b
Fix doom-initialize-packages messing up load-path
This fixes issues with the doctor not being able to find certain
packages (like evil-collection), and an issue where using the package
management API (which calls doom-initialize-packages) breaks the current
session by breaking the load-path.
2018-06-26 18:58:06 +02:00