Commit Graph

2666 Commits

Author SHA1 Message Date
Henrik Lissner
6bf529ddf8
Add magit/vcs support to doom file commands 2018-06-10 23:23:09 +02:00
Henrik Lissner
6f98aeebfb
Don't set doom-init-modules-p from doom-modules
Causes user config to not be loaded if doom-modules is used earlier.
2018-06-10 20:58:00 +02:00
Henrik Lissner
f02156286b
Error if autoloads are missing interactively
Trying to regenerate them greatly complicates doom-initialize's
potential use-cases. Keep it simple stupid!
2018-06-10 20:57:14 +02:00
Henrik Lissner
19deb4b926
Fix buffer-read-only: autoloads.el error 2018-06-10 20:55:42 +02:00
Henrik Lissner
5295f36115
case-fold-search = nil in reload-package-autoloads
Slight optimization.
2018-06-10 20:54:32 +02:00
Henrik Lissner
2d5ac8a164
Fix void-variable package--builtins error
Occurs while running make install because package.el wasn't loaded in
time.
2018-06-10 19:15:39 +02:00
Henrik Lissner
85704bea33
Fix void-variable ex2 error while package managing 2018-06-10 19:10:58 +02:00
Henrik Lissner
f144691157
Don't delete autoloads file
Turns out to be more error prone. Better to just ignore the existing one
when force-initializing Doom.
2018-06-10 19:07:37 +02:00
Henrik Lissner
8d4971d02b
Remove vestigial reference to doom-module-table 2018-06-10 17:48:48 +02:00
Henrik Lissner
400a4dafdb
Revert unit test breakage
This hunk was accidentally committed ahead of time!
2018-06-10 17:36:11 +02:00
Henrik Lissner
9cc190adc9
Minor reformat & refactor keyword intern 2018-06-10 17:28:17 +02:00
Henrik Lissner
2605a3938e
Initialize modules conditionally
doom-modules will be initialized on demand in non-interactive sessions.
2018-06-10 17:28:17 +02:00
Henrik Lissner
a87641635f
load-prefer-newer = nil for private config
load-prefer-newer = t makes debugging harder and reduces the
predictability of your config.
2018-06-10 17:28:17 +02:00
Henrik Lissner
3498d5c6b1
Catch more *.elc files with bin/doom clean 2018-06-10 17:28:17 +02:00
Henrik Lissner
b079db8ec3
Refactor unneeded arg out of local function _load
In doom-initialize-packages.
2018-06-10 17:28:17 +02:00
Henrik Lissner
7e00a83acc
Update & refactor doom-info 2018-06-10 17:28:17 +02:00
Henrik Lissner
edb6fd1964
Change how private & disabled packages are marked
They are now included in doom-packages, but with :private t or :disabled
t properties. This allows us to search for them if we wish (e.g. for
doom info).
2018-06-10 17:28:17 +02:00
Henrik Lissner
88f1ae3797
Refactor autoloads init in doom-initialize
Simplify doom-initialize-autoloads
2018-06-10 17:28:17 +02:00
Henrik Lissner
ee154911ae
Redesign doom-get-package
Now more useful for filtering packages by certain properties.
2018-06-10 17:28:17 +02:00
Henrik Lissner
01d1a814f9
Refactor doom-initialize functions
Removes doom-module-table; which was inflexible (though more stable). It
prevented you from putting your doom! block in anywhere but
~/.doom.d/init.el.

It is replaced (somewhat) by (doom-modules).
2018-06-10 17:30:26 +02:00
Henrik Lissner
1e2fc4227a
Fix void-variable: package--initialized error 2018-06-10 17:28:17 +02:00
Henrik Lissner
d4869228f5
Inhibit recursive switch-hooks in sub-hooks too 2018-06-10 17:28:17 +02:00
Henrik Lissner
14890376b1
Propagate buffer errors up the call stack
Delegates set-buffer(nil) errors (when switch hooks are called with an
invalid or dead buffer) to the caller to handle.

Fixes #668, #674
2018-06-10 17:28:17 +02:00
Henrik Lissner
dd2d704137
Fix reference to renamed _directory variable
Whoops!
2018-06-08 13:39:04 +02:00
Henrik Lissner
81c465a545
Move OS constants to core/core.el
So it is universally available to all of Doom, rather than excluding
sessions that haven't called doom-initialize interactively.
2018-06-08 13:31:45 +02:00
Henrik Lissner
bc2f8a0ec9
Don't complain about used _directory letvar
Byte-compiler-sama must be appeased.
2018-06-08 13:30:20 +02:00
Henrik Lissner
99d6927e56
Improve error-handling for quelpa packages 2018-06-08 13:08:38 +02:00
Henrik Lissner
ab98020295
Optimize buffer normalization in switch hooks
get-buffer is faster than window-normalize-buffer-to-switch-to.
2018-06-08 13:08:37 +02:00
Henrik Lissner
99afb01315
equals -> file-equal-p refactor
Use more reliable file comparison function.
2018-06-08 13:08:37 +02:00
Henrik Lissner
ee262e7737
Refactor error handling in package management API
I am hoping this will improve the ambiguous errors that originate from
package.el or quelpa.el.
2018-06-08 13:08:34 +02:00
Henrik Lissner
b207c4040b
Minor, general refactor 2018-06-07 02:51:46 +02:00
Henrik Lissner
ef9d8fb2e8
Don't trigger whitespace-mode if already on
Normally doom|show-whitespace-maybe turns on whitespace-mode with a
subset of its features when indent-tabs-mode was different in that
buffer versus it's global default. e.g. If your default was spaces and
you opened a file with tabs.

This is to make it easier to notice whitespace style discrepancies.

However, it have side effects if whitespace-mode/global-whitespace-mode
was already on.
2018-06-07 02:51:45 +02:00
Henrik Lissner
dda81f7b54
Fix insertion order of add-hook! when appending
When appending multiple functions to a hook(s) with add-hook!, insertion
order was not preserved. e.g.

  => (add-hook! :append 'some-mode-hook #'(hook-1 hook-2))
  => some-mode-hook
  (hook-2 hook-1)
2018-06-07 02:51:45 +02:00
Henrik Lissner
fcb5284393
Update switch-buffer hooks' docstrings 2018-06-07 02:51:45 +02:00
Henrik Lissner
e4a55d31bc
Don't abort package install on aborting autoremove
Originally, it would not bother running doom//packages-install if you
aborted (answered "n" to the prompt) during doom//packages-autoremove.
2018-06-07 02:51:45 +02:00
Henrik Lissner
b4e6022c82
Fix buffer/window/frame hooks not being triggered
In certain edge cases, the buffer/window/frame switch would not make the
new buffer/window/frame current, which is what the after switch hooks
should reasonably expect, causing some shenanigans.

For example, persp wouldn't register magit buffers because
`doom-after-switch-buffer-hook` was run in the context of the previous
buffer.
2018-06-07 02:51:45 +02:00
Henrik Lissner
b26bbd4762
Fix args-out-of-range in enable-minor-mode-maybe
Caused by trying to use out-of-scope match data.
2018-06-07 02:51:03 +02:00
Henrik Lissner
dd3872dd32
Add DOOMDIR envvar
So doom-private-dir can be customized via shell dotfiles (or chemacs).
2018-06-05 17:20:20 +02:00
Henrik Lissner
3661462a7a
Use dynamic byte-compilation for autoload files
Very experimental! This reduces the size and overhead of autoload files
slightly, but may have other reprecussions!
2018-06-05 14:07:35 +02:00
Henrik Lissner
4978a64678
Create core directories before checking version
Otherwise the version cache file can't be written to!
2018-06-05 12:09:42 +02:00
Henrik Lissner
c9bfb58369
Minor, general refactor
Remove redundant keybinds, unused letvars, and fix
doom-module-load-path's docstring referencing its former signature.
2018-06-05 12:04:43 +02:00
Henrik Lissner
8124d5a893
Use package-activated-list for package count
Now that this variable is cached, it should always be available.
2018-06-05 12:04:43 +02:00
Henrik Lissner
f71d4634e8
Remove TODO colorizing in bin/doom help
It's unused and excessive. KISS!
2018-06-05 12:04:43 +02:00
Henrik Lissner
282e0d6653
Move emacs version check into doom-initialize
Also fixes void-function errors caused by (now removed)
doom-same-emacs-version-p not being defined in all the contexts it was
needed.

Where it was before was clumsy design.
2018-06-05 12:04:43 +02:00
Henrik Lissner
6da8e5b3ab
Add error handling when loading autoloads files 2018-06-04 21:20:13 +02:00
Henrik Lissner
29005d9975
Load quelpa uncompiled to fix arrayp errors #647
Hopefully...
2018-06-04 21:19:46 +02:00
Henrik Lissner
1d9ae834f2
Minor refactors & docstring revision
These are not the refactors you are looking for.
2018-06-04 21:17:49 +02:00
Henrik Lissner
fdb95d9ee6
Minor optimization of doom*switch-buffer-hooks 2018-06-04 21:17:49 +02:00
Henrik Lissner
3027ed2f7f
Add new doom|mark-buffer-as-real hook to term/eshell
This is simpler (and perhaps faster) than doom-real-buffer-functions.
Better to reserve that for more complex logic.
2018-06-04 21:17:49 +02:00
Henrik Lissner
ee154a3eb7
Add Emacs version check to noninteractive session
Changing Emacs versions can cause incompatibilities. Doom now warns the
user about these.
2018-06-04 21:17:49 +02:00
Henrik Lissner
8762129e8d
Don't prompt when byte-compiling plugins
The warning only applies to full byte-compilation of your config.
2018-06-04 21:17:49 +02:00
Henrik Lissner
c96086d426
Fix reference to void variable path
In certain uses of file-exists-p! and project-file-exists-p!
2018-06-04 21:17:49 +02:00
Henrik Lissner
52a04fd8c6
Optimize file-exists-p! & project-file-exists-p! 2018-06-04 21:17:49 +02:00
Henrik Lissner
b2030c6ed3
Refactor doom/escape
Now returns first hook that returns non-nil; this makes it a little
easier to debug doom-escape-hook.
2018-06-04 00:07:03 +02:00
Henrik Lissner
9ba76b60dc
Refactor require! macro 2018-06-04 00:06:01 +02:00
Henrik Lissner
b53df20dd5
Minor refactor of associate! macro 2018-06-03 23:56:25 +02:00
Henrik Lissner
796af69c28
Move define-key! macro to core-lib 2018-06-03 23:52:21 +02:00
Henrik Lissner
7acfcf907a
Add warning prompt to byte-compile
Byte-compiling should be a considered an advanced workflow. Warn users
of the dangers. The prompt can be suppressed with the -y option. e.g.

  bin/doom -y compile

You won't get the prompt for byte-compiling :core or :plugins however.
2018-06-03 22:00:40 +02:00
Henrik Lissner
37b9beb9c9
Fix doom//upgrade not detecting updates 2018-06-03 15:58:49 +02:00
Henrik Lissner
1e81a35461
Minimize dependence on map!
This is in preparation for general.el integration coming in 2.1.1. It is
very likely that map! will change (and even more, be split into several
macros). Not much, but change none-the-less. Specifically, the state
keywords (e.g. :nvi, :n, :i) will be removed in favor of a :state
property that takes a list, e.g. (normal visual insert).

In any case, both map! and general are also relatively expensive
compared to define-key and evil-define-key* (and the new define-key!
macro), so use that when we can.

This also means changes to either API won't affect Doom's modules in the
long term.
2018-06-03 15:46:00 +02:00
Henrik Lissner
b2dfc4b8e8
Delete plugin *.elc before recompiling plugins 2018-06-03 01:38:35 +02:00
Henrik Lissner
1a1d74afa3
Refactor package management API
To make backtraces a little less cluttered, in case of the notorious
arrayp error, which I am yet unable to reproduce or understand.
2018-06-02 21:31:14 +02:00
Henrik Lissner
428f1e1d07
Refactor def-setting!/set! implementation
The `doom-settings` variable has been removed. Setting checks are done
with fboundp now, which is simpler.
2018-06-02 16:26:59 +02:00
Henrik Lissner
e5a4415d58
General, minor reformatting/refactor 2018-06-02 13:58:04 +02:00
Henrik Lissner
ae7ead6e87
Refactor doom//upgrade 2018-06-02 13:56:39 +02:00
Henrik Lissner
a0bec84997 Don't complain if no private packages.el 2018-06-02 01:08:23 +02:00
Henrik Lissner
b28d3414bb
Remove load-prefer-newer letvar around private init
Doesn't actually help and only slows things down.
2018-06-01 17:07:53 +02:00
Henrik Lissner
6480a45f84
Fix reload-package-autoloads outdated detection
The package autoloads generator wouldn't take module packages.el files
into consideration when detecting whether the autoloads file should be
regenerated. Now it does.
2018-06-01 17:06:03 +02:00
Henrik Lissner
c04bccc68b
Fix disabled packages not being disabled
By loading the private packages.el in two passes. The first time ensures
later modules will know about disabled packages and the second time
ensures overwritten packages are properly overwritten.

Not the most efficient, but efficiency is low priority in noninteractive
sessions (i.e. during package management), the performance loss is
negligible, and packages.el files (should) have no other side effects
anyway.
2018-06-01 17:03:01 +02:00
Henrik Lissner
6bad6d12f3
Remove doom-psuedo-modules-dir
Not needed with now that doom-private-dir has first class support.
2018-06-01 17:01:39 +02:00
Henrik Lissner
36c36ca271
Optimize switch buffer/window hooks
Significantly reduces nested triggering of these hooks.
2018-06-01 16:40:39 +02:00
Henrik Lissner
2b052a9563
Ignore untracked files on make upgrade
In case temporary/cache files are saved outside of .local, for example.
2018-06-01 11:25:47 +02:00
Henrik Lissner
3359d351f5
Add define-key! macro; refactor config/default key fixes
I'd like to phase out map! where it isn't absolutely necessary, since it
isn't very well optimized.
2018-06-01 02:17:10 +02:00
Henrik Lissner
a4d03654bd
Fix associate!'s :files refusing a list of strings
Due to changes under the hood, the :files FORM property requires FORM to
either be a nested form of and/or sexps, or a single string. This is
inconsistent with the plurality of ":files", so it has been fixed to
accept a list of strings (with an implicit (and ...)).
2018-05-31 16:59:53 +02:00
Henrik Lissner
97cbb13c22
Improve which-key readability 2018-05-31 16:19:28 +02:00
Henrik Lissner
b1ab80ec3f
Fix doom//byte-compile when recompiling plugins
This would cause odd void-variable/function errors because
doom//byte-compile would erroneously try to compile *everything* after
recompiling plugins.
2018-05-31 01:31:33 +02:00
Henrik Lissner
d2ca6f65b3
doom/cleanup-session: don't kill modified buffers 2018-05-30 23:06:13 +02:00
Henrik Lissner
8b7888d58f
Increase GC threshold from 8 to 16mb 2018-05-30 19:15:43 +02:00
Henrik Lissner
3f6bfee027
Remember customized settings (load custom-file) 2018-05-30 19:15:29 +02:00
Henrik Lissner
bb9f00e275
Fix unused return value warnings
When byte-compiling or reloading autoloads files.
2018-05-30 16:05:24 +02:00
Henrik Lissner
c0b904afca
Fix void-variable nose-mode error in python #628
Caused by associate! only doing a fboundp check on MODE, but not boundp,
before trying to access its value.
2018-05-30 16:05:24 +02:00
Henrik Lissner
71dc572d79
Run doom//refresh after successfull doom//upgrade 2018-05-30 16:05:24 +02:00
Henrik Lissner
c4bbffd7ee
Extract refresh dispatcher into doom//refresh 2018-05-30 16:05:24 +02:00
Henrik Lissner
6b1e1a2c58
Fix doom-files-in returning files in arbitrary order
This would cause compilation issues in doom//byte-compile because
prerequisite files weren't compiled before dependent ones.
2018-05-30 01:43:57 +02:00
Henrik Lissner
bb6b91da9b
Downgrade missing module warnings to messages 2018-05-29 22:44:21 +02:00
Henrik Lissner
debe3e0dd3 Remove unnused letvar doom--inhibit-reload 2018-05-29 19:39:22 +02:00
Henrik Lissner
bd5ecc1aca
Display warning if a non-existent module is in your doom! block 2018-05-29 18:26:39 +02:00
Henrik Lissner
947fe345c3
Minor, general refactor
In some contexts, map-put is superior to add-to-list.
2018-05-29 15:34:13 +02:00
Henrik Lissner
592d83a968
Fix doom//byte-compile not initializing module list in some contexts 2018-05-29 15:32:36 +02:00
Henrik Lissner
456dc62051
Fix compile-time void-function errors from modeline 2018-05-29 15:32:36 +02:00
Henrik Lissner
4863f9fbf0
Fix after! macro with multiple features 2018-05-28 17:31:44 +02:00
Henrik Lissner
f8b9cff4aa
Get rid of doom-pre-init-hook 2018-05-28 16:07:11 +02:00
Henrik Lissner
ed5e8849cc
Fix void-variable fundamental-mode error from unquoted symbol 2018-05-28 15:50:11 +02:00
Henrik Lissner
61b22c1c7f
doom//upgrade: git reset instead of pull + error handling 2018-05-28 15:49:50 +02:00
Henrik Lissner
2dc1be2ce8
Update load! macro docstring 2018-05-28 12:30:27 +02:00
Henrik Lissner
b84946318c
No means no
Saying no to a confirmation prompt should abort the refresh process.
2018-05-28 12:23:48 +02:00
Henrik Lissner
c8b21e8cf8
Fix doom//upgrade dirty-tree detection
doom//upgrade refused to upgrade Doom because of unexpected behavior
with vc-state, which unhelpfully returns 'unregistered for unmodified
files. Instead, I manually test for output from git status --porcelain.
2018-05-28 12:20:01 +02:00
Henrik Lissner
376adde0d8
Optimize mode-line segments that are just variables 2018-05-27 22:31:08 +02:00
Henrik Lissner
1a452b6842
💥 Change first arg of load! macro
load!'s first argument is no longer a symbol (that will cause
void-variable errors now) to save on unnecessary interning and simplify
compile-time logic. It accepts any valid form that evaluates to a string
now.

If you use load!, you need to change its argument to a string!

e.g. (load! +my-module) => (load! "+my-module")
2018-05-27 12:52:28 +02:00
Henrik Lissner
bdee28609a
New emacs/ediff module
Ediff config was moved out of core. Also includes evil compatibility
(mvoed out of feature/evil) & wconf save/restore.
2018-05-27 12:52:28 +02:00