Commit Graph

2666 Commits

Author SHA1 Message Date
Henrik Lissner
98632fe086
Fix doom-module-from-path on module directories
Allow PATH to be an exact path to a module.
2018-06-15 16:20:20 +02:00
Henrik Lissner
58601488d9
describe-module: shows all modules, dim disabled
Shows all modules, whether or not they are enabled and dims disabled
modules.
2018-06-15 16:20:20 +02:00
Henrik Lissner
a500bfb0a0
Rewrite+rename describe-settings->describe-setters
Will now list autodefs instead of def-settings, including an origin
module label to tell you where it comes from at a glance.
2018-06-15 16:20:20 +02:00
Henrik Lissner
1184967531
Advise symbol-file to return doom-file property
...if it exists. Otherwise fall back on original functionality. This
allows certain symbols to overwrite where Emacs thinks they were
defined.

Warning: only use this for autodefs! It may have unintended side-effects
for other symbols.
2018-06-15 16:20:20 +02:00
Henrik Lissner
da5e2d54ca
Refactor autodef generator; put metadata in autodefs
Adds the doom-module and doom-file symbol properties to autodefs,
allowing functions like doom/describe-setting some insight into the
origin of the autodef.
2018-06-15 16:20:20 +02:00
Henrik Lissner
bbda434365
Move startup optimizations into init.el
Doesn't really belong in core.el and only applies to interactive
sessions.
2018-06-15 16:20:20 +02:00
Henrik Lissner
3c7c5d5120
Move doom-file-cookie-p to core-dispatcher
And rename it to doom--file-cookie-p
2018-06-15 16:20:20 +02:00
Henrik Lissner
c22b3da9f9
Move emacs/electric-indent to emacs/electric
This module will later be expanded to customize more of electric's
functionality.
2018-06-15 16:20:20 +02:00
Henrik Lissner
715167bec8
Add ability to mark modules as obsolete or moved
Better way to communicate to users that modules have moved without
breaking their config.
2018-06-15 16:20:20 +02:00
Henrik Lissner
13426eecde
Fix YES/-y support in doom refresh dispatcher 2018-06-15 04:24:48 +02:00
Henrik Lissner
eaca8c58fa
Move unit tests from ert to buttercup
Easier to organize and write. Now I can hopefully strive for better
coverage!
2018-06-15 03:42:01 +02:00
Henrik Lissner
98d2f1de3f
Add set-env! autodef; make :env obsolete 2018-06-15 03:42:01 +02:00
Henrik Lissner
2496e0348d
Add :when support to after!
This lets you delay a body of code until an arbitrary condition is
met (which is checked whenever a file is loaded).

Also refactors set-file-template! to wait until +file-templates-alist is
defined.
2018-06-15 03:42:01 +02:00
Henrik Lissner
d8b1e469bc
Introduce autodefs to replace some settings
+ :popup -> set-popup-rule!
+ :popups -> set-popup-rules!
+ :company-backend -> set-company-backend!
+ :evil-state -> set-evil-initial-state!

I am slowly phasing out the setting system (def-setting! and set!),
starting with these.

What are autodefs? These are functions that are always defined, whether
or not their respective modules are enabled. However, when their modules
are disabled, they are replaced with macros that no-op and don't
waste time evaluating their arguments.

The old set! function will still work, for a while.
2018-06-15 03:42:01 +02:00
Henrik Lissner
db8b4091dd
Fix bin/doom ignoring -d flag
defconst -> defvar
2018-06-15 00:25:39 +02:00
Henrik Lissner
421d00f085
Refactor doom|check-large-file
More checks, fewer false positives.
2018-06-14 19:51:11 +02:00
Henrik Lissner
3228369d73
Fix void-function errors from doom//reload
Because certain commands aren't available without core-dispatcher.
2018-06-14 19:50:27 +02:00
Henrik Lissner
04ec62c8f2
General, minor refactor & feedback revision 2018-06-14 19:49:03 +02:00
Henrik Lissner
f44ebbb7ed
Refactor autoload generator, plus autodef support
Soon, autodefs will replace settings (i.e. def-setting! & set!). This
refactor prepares for it.
2018-06-14 19:46:31 +02:00
Henrik Lissner
2908a6389e
Fix font loading in daemon-spawned frames
set-face-attribute wasn't reliable for changing the fixed-pitch and
variable-pitch faces. custom-set-faces uses a custom, internal user
theme that has the highest precedence, making this the superior choice
for default font-setting.
2018-06-14 13:59:04 +02:00
Henrik Lissner
da6ce8e3f9
Fix over-aggressive theme reloading
`display-graphic-p` returns a boolean (possibly a recent change in Emacs
27), which will never match any window system, causing the theme to be
reloaded on every new frame.

Also default doom-last-window-system to initial-window-system.
2018-06-14 13:58:38 +02:00
Henrik Lissner
cc3fd3126a
Fix "Failed to parse X" errors from use-package
use-package-handler/:after-call was (accidentally) relying on the
dynamic value of `name`, but now that use-package uses lexical binding,
this isn't possible anymore, causes errors.
2018-06-14 11:53:52 +02:00
Henrik Lissner
8c4d8d739b
Remove (provide ...) forms from package autoloads 2018-06-14 03:36:46 +02:00
Henrik Lissner
6571c9eabf
Update :depth in doom-files-in call
Was searching for *.el files one level too deep.
2018-06-14 03:36:46 +02:00
Henrik Lissner
b21d575eac
Init custom hooks on init-ui instead of post-init
Makes more sense to be on doom-init-ui-hook.
2018-06-14 03:36:46 +02:00
Henrik Lissner
ac546220a4
Refactor core-editor def-package! blocks 2018-06-14 03:36:46 +02:00
Henrik Lissner
36171f5b33
Fix :after-call deferred packages not loading
If you open emacs with a file (emacs file.txt), the file is switched to
before the switch-buffer hooks are set up. However, many core packages
are hooked to those switch-buffer hooks (to load when they're first
triggered). They miss the boat and don't get loaded.

These packages are now hooked onto after-find-file as well (and
immediately), which will fire when a file is opened, before or after
initialization.

Fixes #680
2018-06-14 03:36:46 +02:00
Henrik Lissner
69c6e0b8fb
Add doom-get-package-alist
New function returns a list of (NAME . DESC) cons cells in the order
they were declared (in module packages.el files).

Fixes a load-order issue where autoloads from one package would depend
on the autoloads of another package, but was inserted into
doom-package-autoload-file *before* the depended package, causing
void-variable errors.

Also allows for a big refactor of the :plugins byte-compile target.
2018-06-14 03:36:46 +02:00
Henrik Lissner
08a4701774
Fix case where private init.el has no doom! block
This shouldn't error out. It's better if Doom ran normally, just without
any of its modules activated.

Addresses issue mentioned in #681
2018-06-14 00:45:57 +02:00
Henrik Lissner
933023d779 Minor reformatting & docstring revision in core.el 2018-06-13 22:16:08 +02:00
Henrik Lissner
b6f9bc9675 Fix package manager not :ignore'ing packages 2018-06-13 22:15:08 +02:00
Henrik Lissner
4c2107d595
Refactor doom-module-from-path
If PATH is omitted, use (FILE!); also use doom-keyword-intern.
2018-06-12 21:07:34 +02:00
Henrik Lissner
399591b951
Add :mindepth property to doom-files-in
+ don't error out if directory doesn't exist.
+ :depth now starts from 0, instead of 1
2018-06-12 21:07:34 +02:00
Henrik Lissner
acbad5ca01
Add ALL-P parameter to doom-module-load-path
Allowing it to return path to *all* modules, whether or not they are
activated.
2018-06-12 21:07:34 +02:00
Henrik Lissner
98d2a35a59
Compile plugins in the correct order
Compile order will affect some packages, so `bin/doom compile :plugins`
will now byte-compile plugins in the order they're declared in, but
after their dependencies.
2018-06-12 12:58:47 +02:00
Henrik Lissner
c6324da59d
Add force-p parameter to doom//refresh
Also force autoloads regeneration on doom upgrade.
2018-06-12 12:26:58 +02:00
Henrik Lissner
77ac164651
Fix core libraries not loading
Caused because the load-path is reset to doom-site-load-path in
doom-initialize-packages, which was initialized before doom-core-dir was
added to it, so core-* libraries couldn't be found.
2018-06-12 12:18:21 +02:00
Henrik Lissner
85591ca296
Move custom-file into local-dir (not etc-dir)
Makes more sense to put more vital files in local than etc or cache.
2018-06-12 12:17:33 +02:00
Henrik Lissner
9ec0461162
Revert "Refactor def-package!"
This reverts commit f7a86ae281.

Turns out it's still needed when byte-compiling!
2018-06-12 01:58:06 +02:00
Henrik Lissner
4425fdfca4
defvar -> defconst for dir vars 2018-06-12 01:48:09 +02:00
Henrik Lissner
4c40195d40
Slightly better version check error 2018-06-12 01:47:43 +02:00
Henrik Lissner
64e02e4232
Load core-packages in doom//run-tests 2018-06-12 01:45:52 +02:00
Henrik Lissner
f7a86ae281
Refactor def-package!
It is no longer necessary to gate use-package calls with
:if/:when/:unless checks during byte-compilation. This was fixed
somewhere along the way.
2018-06-12 00:26:28 +02:00
Henrik Lissner
fe6afa19a3
Add docstrings to FILE! & DIR! macros 2018-06-12 00:25:11 +02:00
Henrik Lissner
1c3183b298
Remove space in backend labels during install
Minor reformatting. To be consistent with the backend transition labels
in doom//packages-autoremove.
2018-06-12 00:02:04 +02:00
Henrik Lissner
72201fead5
Major refactor of package management API
Fixes issues where:

+ package!'s :disable property was ignored and def-package! wouldn't
  ignore disabled packages.
+ Certain quelpa packages were being removed/reinstalled infinitely
+ Improved flexibility of doom-get-packages (its docstring needs to be
  updated!)
2018-06-12 00:02:04 +02:00
Henrik Lissner
0be2be5c82
Remove autoload/modules library
Move batch commands into core-dispatcher and doom//reload into
autoload/help. It will soon be renamed doom/reload.
2018-06-12 00:02:04 +02:00
Henrik Lissner
0741c8851a
Split core-packages into two (packages & modules)
+ Move doom-initialize et co into core.el
+ Lazy load core-packages
+ load! has been moved into core-lib
+ Added FILE! and DIR! macros
+ Fix package! not returning correct value when package is disabled
+ Remove :disabled support for def-package-hook! officially
2018-06-12 00:02:04 +02:00
Henrik Lissner
a25eff0189
delete-this-file: don't propagate deletion to vcs
Doom shouldn't assume the user always wants to stage the current
deletion after every delete.
2018-06-11 01:33:56 +02:00
Henrik Lissner
dd9f8d47af
Fix infinite recursion in buffer switch hooks
Caused by advice functions trying to manipulate non-existent buffers
that were intended to be created after switching to them.
2018-06-11 00:39:55 +02:00