Commit Graph

370 Commits

Author SHA1 Message Date
Henrik Lissner
40d2d4d222
Minor tweaks & byte-compiler offerings 2019-05-15 20:53:11 -04:00
Henrik Lissner
a4fb4070ea
Rework how unicode fonts are set and loaded 2019-05-15 20:24:52 -04:00
Henrik Lissner
2525822791
Move GC optimization to init.el
And reformat core.el
2019-05-15 18:30:20 -04:00
Henrik Lissner
5cd1fb2a52
tutorial--saved-dir = doom-cache-dir/tutorial/ 2019-05-14 23:41:21 -04:00
Henrik Lissner
75777756e1
Remove redundant dired sort hook #1414
This still means dired will be unsorted for BSD ls users, but that's
acceptable (for now).
2019-05-14 18:45:38 -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
20596cd41f
Reformat gc optimization & gc on focus-out
Also raises the gc upper limit to 512mb
2019-05-13 19:34:44 -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
6d314c2795
Revise and update docstrings and comments 2019-05-01 21:02:28 -04:00
Henrik Lissner
9735f034e1
General refactors & optimizations 2019-04-29 18:54:46 -04:00
Henrik Lissner
f61e0aa00c
Use outline-mode comment headings in core.el 2019-04-20 02:18:49 -04:00
Henrik Lissner
31eb845f6b
Reset more state on doom/module initialization
Makes `doom/reload` a little more reliable and the side effects of
`doom-initialize`/`doom-initialize-modules` a little more deterministic.
2019-04-09 03:43:13 -04:00
Henrik Lissner
2a079e2733
Load env even in tty Emacs
Even if it matches the current shell (or doesn't), the env file should
be the authority.
2019-04-03 01:53:20 -04:00
Henrik Lissner
700cda370b
Refactor doom env
- Limits process-environment during scraping
- Add `doom-env-executable` and `doom-env-switches` variables
- Announce what commands were run to produce your env var within env var
  file header
2019-04-03 00:09:22 -04:00
Henrik Lissner
a6cc66e21e
Refresh exec-path & shell-file-name
When loading envvars, since `load-env-vars` only affects the environment
and not Emacs' variables.
2019-04-01 13:15:15 -04:00
Henrik Lissner
7488b51e9a
Prevent void-function load-env-vars errors
In case load-env-vars hasn't been autoloaded yet.
2019-03-29 01:51:36 -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
b3d931d7ce
Refactor undo-tree advice 2019-03-28 01:56:09 -04:00
Henrik Lissner
37525bb1bd
Fix clipboard support on Windows #1284
Windows uses UTF-16 for clipboard content. selection-coding-system is
set correctly on Windows systems so we leave it to its default there.
2019-03-28 01:56:09 -04:00
Henrik Lissner
2dc52bc9be
💥 Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.

Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
  commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)

The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.

+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
  running `doom env enable` (`doom env clear` will reverse this and
  delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
  file. You won't need it if you're confident Emacs will always be
  started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
  doom/reload-env`. Note: this won't work if the Emacs session you're
  running it in doesn't have a correct SHELL set. i.e. don't use this to
  create your first env file!

The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.

This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 01:56:09 -04:00
Henrik Lissner
e0ed8669af
Move (if|when)-let* shims to core.el
Fix void-functon when-let* errors at startup for Emacs 25.* users.
2019-03-08 18:06:35 -05:00
Henrik Lissner
5ab58a7eaf
Load subr-x & cl-lib sooner 2019-03-08 06:13:07 -05:00
Henrik Lissner
917d89da87
Refactor module init hooks
Also adds doom-after-init-modules-hook for consistency, which is an
alias to after-init-hook until I decide if it's necessary for it to be
independent.
2019-03-08 02:37:33 -05:00
Henrik Lissner
9b180fda97
Refactor doom-initialize & bootstrap in core.el 2019-03-08 02:37:32 -05:00
Henrik Lissner
e497df4a28
Restore obsolete doom-(post-)?init hooks
These will be removed later.
2019-03-05 19:23:50 -05:00
Henrik Lissner
024e27b618
Add contingency plan for local-vars hooks
They don't run if enable-local-variables is set to nil.
2019-03-05 17:08:39 -05:00
Henrik Lissner
05303c0fdb
💥 Rethink core hook order & naming
- doom-post-init-hook was renamed doom-init-modules-hook
- doom-init-hook was renamed doom-before-init-modules-hook
- doom-init-modules-hook now runs before the user's config.el is run
- Moved doom-init-ui-hook to run later (on window-setup-hook rather than
  emacs-startup-hook).

Yield a modest improvement in startup times.
2019-03-04 20:47:26 -05:00
Henrik Lissner
f6cc2644b0
New doom-log macro for debug-time logging
doom-log won't interfere with the minibuffer if it's in use, and will
report the originating module.

Addresses #1215
2019-03-04 18:38:25 -05:00
Henrik Lissner
1eb1933518
Don't let packages modify command-switch-alist
From their autoloads.
2019-03-02 03:55:15 -05:00
Henrik Lissner
84343f57aa
Refactor UTF-8 setters
Some were redundant
2019-03-02 03:53:13 -05:00
Henrik Lissner
d46bb287ae
General refactor of Doom core
- Code reduction and refactor across the board (cull unneeded minor
  advise, hooks and hacks or update them)
- Revise outdated comments and docstrings
- Reorganize core autoload libraries
- Remove large file check (Emacs already has a built-in one, which we
  augment to be even more performant when it does kick in)
- helpful.el can now be disabled completely through package!
2019-03-02 01:34:19 -05:00
Henrik Lissner
8a90f29c91
Make session persistence module agnostic
They've been removed from feature/workspaces and moved into
core/autoload/sessions, which falls back to desktop.el if persp-mode
isn't present. This also offers a substantial speed up to
restart+restoring and restoring sessions in general.

Also fixes #1210, where the newly spawned frame after doom/restart
wasn't focused.

Introduces the following commands:

- doom/restart
- doom/restart-and-restore
- doom/quickload-session
- doom/quicksave-session
- doom/load-session
- doom/save-session
- +workspace/restore-last-session (alias for doom/quickload-session)

And removes

- +workspace/load-session
- +workspace/save-session
- +workspace/load-last-session (renamed to +workspace/restore-last-session)
- +workspace/restart-emacs-then-restore (replaced by doom/restart-and-restore)
- :ss (ex command)
- :sl (ex command)
2019-03-02 01:34:19 -05:00
Henrik Lissner
21e01189b9
Properly keep cursor out of minibuffer prompt
The prompt in the minibuffer is read-only. You are able to move the
cursor into it before this fix.

This also more effectively silences echo-area output when deleting text
in the minibuffer. No more "Text is read-only" blocking what you're
typing.
2019-03-02 01:34:14 -05:00
Henrik Lissner
11d7ae070a
Add async-byte-compile-log-file setting to core.el 2019-02-21 19:13:35 -05:00
Henrik Lissner
19987df00a
Add IS-BSD constant
Fixes dired gls support on BSD OSes (and not just MacOS).
2019-01-05 16:06:26 -05:00
Henrik Lissner
e373052064
Restrict support to Emacs 25.3+ from now on
25.1-25.2 are no longer supported.
2018-12-28 15:22:52 -05:00
Henrik Lissner
9936532ea3
Move auth-sources & mc/list-files
...to move appropriate locations.
2018-12-23 23:16:03 -05:00
Henrik Lissner
a124497f4e
find-file-visit-truename = t 2018-12-22 14:30:29 -05:00
Henrik Lissner
f4698d2f0a
Fix uncaught errors during incremental load 2018-12-10 13:50:58 -05:00
Henrik Lissner
5d3bada86e
Don't byte-compile xdg-path in doom-private-dir
The danger of a stale value post-byte-compilation far outweighs the
benefits.
2018-10-06 20:44:25 -04:00
Henrik Lissner
fd19698927
doom|hack-local-variables => MODE-local-vars-hook
Uses a less destructive method (the same that Spacemacs uses) than the
one introduced in 13cee68, by introducing MODE-local-vars-hook hooks,
which run after local vars have been initialized.

The old method was to call `hack-local-variables` *before* mode hooks
run, however, this causes variables set by modes to have higher
precedence than local vars, which is unacceptable.

Also moved intero-mode & dante-mode to haskell-mode-local-vars-hook
2018-09-29 15:01:35 -04:00
Henrik Lissner
cae5009925
cl-remove-if -> cl-delete-if
Minor optimization for doom-load-packages-incrementally (cl-delete-if
deletes in-place).
2018-09-28 22:50:39 -04:00
Henrik Lissner
13cee6870e hack-local-variables before mode hooks
The default behavior is to read file+directory-local variables after the
major mode and its hooks have run. I think this is backwards. What if we
want to use these local variables to customize the things running in
hooks?

This does mean hack-local-variables will run at least twice when the
mode changes, but this is an acceptable compromise.
2018-09-28 21:13:28 -04:00
Henrik Lissner
078e3028a6 Minor, general comment revision 2018-09-28 21:02:59 -04:00
Henrik Lissner
c8b07f3caa
Fail gracefully if incremental load fails
...and continue loading other packages regardless.
2018-09-20 10:42:45 -04:00
Henrik Lissner
ba16dd8954
Resolve symlinks in doom-emacs-dir (and inline it) 2018-09-19 19:41:46 -04:00
Henrik Lissner
cc28aacecb
Don't inline DOOMDIR in doom-private-dir
Breaks DOOMDIR when config is byte-compiled, as mentioned in #900
2018-09-19 19:27:49 -04:00
Henrik Lissner
f4e119a642 Couple core-packages to package.el sooner
This way, if the user loads package.el themselves, doom's package.el
settings will take effect immediately.
2018-09-18 15:19:50 -04:00
Henrik Lissner
b96d50b3de history-length = 500 2018-09-18 15:19:50 -04:00
Henrik Lissner
e80f5e4c85
Remove unnecessary optimization in doom-try-run-hook
Hooks run with this should already be run in a gc-deferred state (at
startup), so deferring garbage collection _again_ may just cause
unnecessary consing.
2018-09-18 11:45:13 -04:00