Commit Graph

2730 Commits

Author SHA1 Message Date
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
3a3eb92087 Move :tools rotate-text to :editor rotate-text
This change was a long time coming.
2018-06-22 01:49:20 +02:00
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
1dd023cda1 Fix error if private config.el doesn't exist 2018-06-22 01:49:19 +02:00
3d3d04b21c Move use-package config to core-modules 2018-06-20 12:48:59 +02:00
643c64c19f Prevent creation of ~/.emacs.d/elpa
Due o package-gnupghome-dir not being set properly.
2018-06-20 12:45:51 +02:00
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
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
71f0b3ba10 Minor error handler refactor in package management
Allow debugger to produce better backtraces.
2018-06-20 02:23:55 +02:00
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
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
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
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
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
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
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
279ee3cc8c Fix stringp regression during autoloads generation
Mentioned in #701
2018-06-19 17:16:08 +02:00
3b528302b2 Minor refactor of core-dispatcher 2018-06-19 16:43:08 +02:00
2e92f8d8a8 Keep backup of errant autoloads files 2018-06-19 16:42:10 +02:00
2c1b0ccaf8 Fix doom|run-all-startup-hooks
Wasn't using doom-try-run-hook correctly.
2018-06-19 12:01:51 +02:00
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
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
ca2c8b5a45 Minor refactor, across the board
Do you see the board? Now look at the other side. That's how far this
refactor extends.

Yes.
2018-06-18 15:02:24 +02:00
f6c7c13634 Clean up elcs only if compiling core or everything
Sometimes we only want to compile one module, without getting rid of all
our other compiled files.
2018-06-18 14:56:24 +02:00
32954ecb69 Move compile-time fix for disabled packages
This fix prevented the byte-compiler from trying to load packages that
were disabled or failed their :when/:unless/:if predicates. This commit
moves it into doom-byte-compile, so the :no-require predicate doesn't
have to run on every package in an interactive session, eating MY
PRECIOUS cpu cycles.

I do love my cpu cycles, yessiree.
2018-06-18 14:52:24 +02:00
ab07e07352 Improve general error handling at startup
This will hopefully reveal more information as to the cause and origin
of errors at startup. It should also make doom-debug-mode more likely to
produce a backtrace in non-interactive sessions.
2018-06-18 14:47:36 +02:00
08f01edafd Mark settings obsolete (properly)
And make set! noisy about settings that don't exist anymore, when
evaling it interactively.
2018-06-18 13:38:27 +02:00
0d925cda5e Load core-os sooner & in all sessions
Indirectly fixes set-env! errors when using it from your init files.
2018-06-18 12:04:30 +02:00
4e5c8b6052 Improve autoload generator
Adds support for defalias and arbitrary forms.
2018-06-18 01:55:37 +02:00
68903ae398 Set exec-path-from-shell-debug instead of aliasing
Also fixes the defvaralias error that occurs on the latest Emacs (but
only on MacOS).
2018-06-17 21:41:44 +02:00
26caea7f2b Move doom-docs-dir to core.el 2018-06-17 21:39:40 +02:00
0a20159eee Check doom-packages-dir mtime
Now that package management commands update its mtime manually, this is
the most reliable method of detecting package changes.
2018-06-17 21:38:53 +02:00
faf09288ce Major refactor of core-dispatcher 2018-06-17 21:38:30 +02:00
03022d09f9 Remove doom//x naming convention
This naming convention was meant to be for batch commands, but it grew
to include "commands that were helpful with managing Doom", but many of
these commands shouldn't be interactive in the first place!
2018-06-17 21:35:58 +02:00
36992037d1 Update package dir mtimes for stale checks
This helps doom//reload-package-autoloads detect if packages have
changed.
2018-06-17 14:45:07 +02:00
3188d67d6e Hide modeline in Man-mode 2018-06-17 14:22:29 +02:00
f3aadf6c77 Fix doom-temp-buffer-p & doom-real-buffer-p
A regression caused the former to error out (if the buffer name was less
than 2 characters long) and the latter to return t too eagerly (because
of an incorrect condition chain).
2018-06-17 02:30:02 +02:00
913394bfe7 Be quiet, recentf! 2018-06-17 02:25:12 +02:00
c1b8d6f508 More configuration for smartparens
Fewer overlay highlights and show-pair-from-inside, in case we use that
feature later.
2018-06-17 02:21:46 +02:00
194bcf4c60 Silence byte-compiler warning: unused lexical arg 2018-06-17 02:21:46 +02:00
b880175d79 Remove switch-frame hooks
They are too unreliable. Use after-focus-change-function if you
must (though, that's an latest-Emacs-27-only feature atm).
2018-06-16 21:40:46 +02:00
ec6372ef66 Mark all temp buffers as unreal
Hopefully there are no plugins that use temp buffers to display things!
2018-06-16 21:02:54 +02:00
bf44c1abcc Add doom-temp-buffer-p predicate function 2018-06-16 21:02:40 +02:00
b170119d4b Add smartparens to evil-ex; disable quote autopair
Don't autopair ' in eval-expression or evil-ex (doesn't make sense)
2018-06-16 12:40:57 +02:00
44363cae40 General, minor refactor & revision
Across the board. All the boards.
2018-06-16 12:26:58 +02:00
3f2318bc69 Fix wrong-type-argument errors on backspace
Caused when pressed at the beginning or end of a buffer.
2018-06-16 11:50:55 +02:00
9a2f96c0f1 Lazy load projectile (experimental)
I can feel it; the power coursing through my veins. Every millisecond
saved at startup makes me more powerful. This world will be mine. Mine I
tell you!
2018-06-16 11:42:37 +02:00
c81304d18b Enable smartparens in eval-expression
This is experimental, so we can have delimiter/quote autopairing while
we write lisp into eval-expression.
2018-06-16 11:42:01 +02:00
b656e68bc3 Move startup optimization to early-init
Also load early-init from init if early-init-file isn't bound. This
improves startup a modest 3-5% for Emacs 27 users.
2018-06-16 11:38:19 +02:00
126b7b6383 Refactor associate! with cl-defmacro 2018-06-16 11:34:42 +02:00