Commit graph

3358 commits

Author SHA1 Message Date
Henrik Lissner
5a7c8803d9
Remove :when support from after!; add defer-until!
New macro does what the :when keyword did for after!.
2018-06-27 21:29:28 +02:00
Henrik Lissner
5ae25318a4
Remove fmakunbound from add-transient-hook!
unintern is enough.
2018-06-27 18:53:05 +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
79e155a2a8
doom-files-in: match full path with :match
Instead of just the filename.
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
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
Henrik Lissner
af41e17355
Minor reformatting & docstring tweak 2018-06-26 01:48:15 +02:00
Henrik Lissner
017ba8d79c
Autoload defhydras & use new naming convention
Phasing out the +module@name convention for plain old
+module-name-hydra, which is more compatible with elisp reflection tools
like describe-function and such.

Also, Emacs starts up faster now. Tee hee.
2018-06-26 01:43:54 +02:00
Henrik Lissner
8a4f15b01c
Refactor smartparens default rules
Move them to config/default, but move single-lang-specific ones to their
respective modules.
2018-06-25 15:54:38 +02:00
Henrik Lissner
1d7782aea3
Ensure paren isn't loaded at startup
post-command-hook would trigger too soon, for some reason.
2018-06-25 15:47:29 +02:00
Henrik Lissner
b3fa3cda28
Lazy load which-key
GOTTA

GO

FAST
2018-06-25 15:46:31 +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
196638bf47
Improve handling for arbitrary package errors
e.g. if the package doesn't exist, it shouldn't simply die.
2018-06-24 22:23:09 +02:00
Henrik Lissner
335bef85fd
Remove unused memoize library 2018-06-24 22:23:09 +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
e99ae5382c
Refactor package! macro
And have :ignore and :freeze be evaluated during package management,
rather than during macro expansion/compile time.

Also gives doom-package-prop a third, boolean argument. If non-nil,
`eval' the return value.
2018-06-24 22:23:08 +02:00
Henrik Lissner
e91af20003
Optimize core-lib & pure module functions
And confer module membership check to run-time, rather than compile
time.
2018-06-24 22:23:08 +02:00
Henrik Lissner
d874f628bb
Prefix non-existent module message with Warning:
Because it's a warning, not an error, and life goes on.
2018-06-24 22:23:08 +02:00
Henrik Lissner
88ee423806
Refactor & optimize smartparens config
Also, apply <!-- --> comments to more html modes.
2018-06-24 16:31:13 +02:00
Henrik Lissner
c78c6495f1
Apply /* and /** pairs to more modes
Including js, ts, rjsx, rust, all C modes, php, and all css modes (scss,
less, and stylus).

Requested by @ar1a
2018-06-24 16:31:13 +02:00
Henrik Lissner
c9ac30889c
Allow debugger to handle byte-compile errors 2018-06-24 14:48:27 +02:00
Henrik Lissner
be44b1ae8a
Fix package!'s :disable being read unconditionally
Because the package was added to doom-disabled-packages at macro
expansion time, rather than at run time. This meant that, even if you
did:

  (when nil
    (package! x :disable t))

x would still be disabled.

Reported by @ar1a
2018-06-24 12:08:55 +02:00
Henrik Lissner
a52267fee5
Disable smartparens pair & tag navigation
Fixes quirky backspace and autoskipping behavior with html tags or
closing delimtiers unpredictably. These might be more useful to non-evil
users, but more testing is required.

Indirectly fixes #712
2018-06-23 23:21:02 +02:00
Henrik Lissner
e4b23d78da
Refactor require!
Defer its compile-time segments to run-time, which would cause many
issues in conditions wrapped around it.

In any case, avoid using require!, it was a poor choice to implement it
and should only be used for unit tests.
2018-06-23 22:23:35 +02:00
Henrik Lissner
4c4a35ae86
Minor reformatting
It's no big deal. Really.
2018-06-23 22:22:42 +02:00
Henrik Lissner
adf143a853
Fix void-variable error when installing packages
Caused by a haphazardly refactor in f6dc6ac7.
2018-06-23 20:11:43 +02:00
Henrik Lissner
16d3f75f1d
Minor refactor of use-package-handler/:after-call
+ Duplicate hooks aren't a problem
+ letbind `fn` only when we need it
2018-06-23 19:53:58 +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
3a3eb92087
Move :tools rotate-text to :editor rotate-text
This change was a long time coming.
2018-06-22 01:49:20 +02:00
Henrik Lissner
ff7823bfc9
Refactor module deprecation checks in doom!
Also changes the structure of doom-obsolete-modules, and adds :feature
version-control to it.
2018-06-22 01:49:20 +02:00
Henrik Lissner
1dd023cda1
Fix error if private config.el doesn't exist 2018-06-22 01:49:19 +02:00
Henrik Lissner
3d3d04b21c
Move use-package config to core-modules 2018-06-20 12:48:59 +02:00
Henrik Lissner
643c64c19f
Prevent creation of ~/.emacs.d/elpa
Due o package-gnupghome-dir not being set properly.
2018-06-20 12:45:51 +02:00
Henrik Lissner
d4ba03791f
Don't async refresh package contents
The performance benefit is minor and the loss of feedback is major in
case of errors.
2018-06-20 12:45:03 +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
Henrik Lissner
71f0b3ba10
Minor error handler refactor in package management
Allow debugger to produce better backtraces.
2018-06-20 02:23:55 +02:00
Henrik Lissner
5cb1d5d4c9
eval-after-load -> with-eval-after-load
The way Doom was using eval-after-load ensured its form were never
byte-compiled or even checked by the byte-compiler, because they were
treated as quoted forms (data), and thus eval'ed.

Friends don't let friends use eval.
2018-06-20 02:08:34 +02:00
Henrik Lissner
151858a8dc
Redesign Doom error handling
Another refactor, again to improve the locality of doom errors and make
the data that accompanies them more useful in determining the origin and
source of issues. Also, bin/doom is now a little more informative about
how to debug errors.
2018-06-20 02:07:12 +02:00
Henrik Lissner
84756b33a0
Fix closure symbolp errors blocking stacktraces
Caused because of symbol-file advice assuming SYMBOL would always be a
symbol.

This would prevent backtraces from happening, making debugging
impossibly obtuse.

This may indirectly fix #701
2018-06-20 01:59:07 +02:00
Henrik Lissner
600d7bcb4f
core: minor refactor/reformat
+ Prefer cl-loop over cl-mapcan for performance reasons.
+ Remove unnecessary let form
+ Log doom-try-run-hook when doom-debug-mode is on.
2018-06-19 20:55:44 +02:00
Henrik Lissner
adf9b7d26f
Log & error-handle in :after-call hooks
A load error no longer leaves Emacs in a broken state, but will report
errors. These errors can still be investigated with debug-on-error on.
2018-06-19 20:54:09 +02:00
Henrik Lissner
e069139b1c
Prevent kill-emacs-hook running after byte-compile
Prevents harmless errors after byte-compiling, or recentf needlessly
saving its cache to file.
2018-06-19 20:51:14 +02:00
Henrik Lissner
0fefc43d39
Refactor autoloads init & error handling
Also reduces byte-compiled forms in the backtrace of a
doom-autoload-error.
2018-06-19 17:19:11 +02:00
Henrik Lissner
279ee3cc8c
Fix stringp regression during autoloads generation
Mentioned in #701
2018-06-19 17:16:08 +02:00
Henrik Lissner
3b528302b2
Minor refactor of core-dispatcher 2018-06-19 16:43:08 +02:00
Henrik Lissner
2e92f8d8a8
Keep backup of errant autoloads files 2018-06-19 16:42:10 +02:00
Henrik Lissner
2c1b0ccaf8
Fix doom|run-all-startup-hooks
Wasn't using doom-try-run-hook correctly.
2018-06-19 12:01:51 +02:00
Henrik Lissner
f653e20407
Fix disabled autodefs defined with cl-lib
Stubs are defined as ordinary macros (with defmacro), but if an autodef
is defined with cl-defun, defmacro can't handle the clisp-style argument
lists, causing wrong-number-of-arguments errors.
2018-06-18 17:30:33 +02:00
Henrik Lissner
4685eddb66
Don't eat stacks in backtraces in debug mode
The error handlers were a little too effective. They obscured a large
chunk of the stacktrace after errors, even in debug mode. This fixes
that and ensures backtraces in debug mode are more helpful.
2018-06-18 17:14:17 +02:00