Commit Graph

418 Commits

Author SHA1 Message Date
Henrik Lissner
12b276c4d6
Fix void-variable EMACS26+ issue
By loading core-lib a little later, for now.
2019-10-18 22:21:25 -04:00
Henrik Lissner
7b45b39860
Refactor doom-load-packages-incrementally 2019-10-18 22:09:28 -04:00
Henrik Lissner
43e8ddbc6d
Add docstrings to GC hooks
And correct grammar in a comment.
2019-10-18 22:09:28 -04:00
Henrik Lissner
2f4ac32b0d
Load core-lib & refactor x-win advice 2019-10-18 22:09:28 -04:00
Henrik Lissner
323e0adf45
Minor refactors & reformatting across the board 2019-10-17 01:47:58 -04:00
Henrik Lissner
ddce674a6c
Minor refactors across the board 2019-10-07 16:10:33 -04:00
Henrik Lissner
eae45e664b
doom-load-envvars-file: split-string->parse-colon-path 2019-10-05 13:00:06 -04:00
Undead Kernel
a3d79dcfa5 doom/core: avoid the litter of session.* files
When the  x-window system commands emacs to quit, emacs saves a session in
`.emacs.d/session.*` by default. There is no easy way to change the save
path. This commit overwrites the function responsible for creating the session
file name. We set the session file to reside in `doom-cache-dir`.
2019-09-28 15:22:40 +02:00
Henrik Lissner
45240699e0
Remove doom-elpa-dir variable
And just use package-user-dir. No need for two variable when one will
do.
2019-09-26 14:26:47 -04:00
Henrik Lissner
280a2407ab
Fix doom-load-envvars-file
A former regexp consumed the first letter of each environment variable's
name.
2019-09-06 14:17:34 -04:00
Henrik Lissner
29055ae6a3
Disable projectile-{ag,ripgrep}
Emit warnings for commands that won't work, as is, and that Doom
already provides a better alternative for.
2019-09-06 14:17:34 -04:00
Henrik Lissner
3b7711420f
General comment revision & cleanup 2019-09-06 00:25:35 -04:00
Henrik Lissner
cbe05e6df4
Soften formatting rules for envvar files
doom-load-envvar-file would fail if there weren't two newlines
indicating "the start of the envvar list", or if envvars were commented
out/were padded with whitespace. These rules have been relaxed.
2019-09-05 13:10:21 -04:00
Henrik Lissner
62b089ba36
Refactor core & core-lib
And make their tests pass
2019-09-03 00:59:46 -04:00
Henrik Lissner
4b736bef68
Introduce doom-interactive-mode
As soft inverse alias for noninteractive; this makes it easier to unit
test functionality that depends on the session type.
2019-09-03 00:37:30 -04:00
Henrik Lissner
8766499b0d
Fix some file permissions errors
Occurs when deferred packages are loaded while in an unreadable or
non-existent directory.
2019-08-27 00:05:12 -04:00
Henrik Lissner
8ac1e1a781
Refactor doom init process
- Refactors doom-initialize
- Moves doom-initialize-modules call to init.el, to more easily isolate
  it during unit testing.
2019-08-27 00:05:12 -04:00
Henrik Lissner
a7bdf6825a
Set default exec-path & shell-file-name
In case doom-load-envvars-file is called when these vars have local
bindings.
2019-08-15 18:42:26 -04:00
Henrik Lissner
b29a7ba8fe
Fix 'doom compile'
Fixes `void-function define-key!` error.
2019-08-15 01:33:40 -04:00
Henrik Lissner
48415edce3
Fix #1644: --restore switch not recognized 2019-08-08 23:30:16 -04:00
Henrik Lissner
3423974234
Minor refactors & tweaks across the board 2019-08-06 14:50:42 -04:00
Henrik Lissner
3e4c02f92f
Resolve symlinks in doom-emacs-dir
Shaves a little time off startup on slower drives.
2019-08-06 14:46:15 -04:00
Henrik Lissner
a6d77e951f
Move doom-run-all-startup-hooks-h to autoload/debug.el 2019-07-28 02:32:25 +02:00
Henrik Lissner
4d73f659f5
Refactor out nested hook defuns & refactor core.el
Moves file-handling config to core-editor.el.
2019-07-27 02:46:49 +02:00
Henrik Lissner
38b69785dd
Don't load pkg autoloads in non-interactive sessions
Fixes an issue where autoloads would bloat load-path and auto-mode-alist
with duplicates because they were build on top of old autoloads state.

We initialize packages manually at the start of non-interactive sessions
anyway.
2019-07-26 20:17:29 +02:00
Henrik Lissner
08ba22c653
Minor refactor/reformatting of doom-initialize
- No need to use after! (it has a little magic associated with it that are
  meaningless this early in the startup process), so we use
  with-eval-after-load instead.

(And I've been itching for an excuse to use doom-rpartial)
2019-07-26 20:17:29 +02:00
Henrik Lissner
331a53c0a1
Complain if envvar file exists, but isn't readable 2019-07-26 13:15:28 +02:00
Henrik Lissner
c795a988e6
Conform many modules to new conventions 2019-07-23 12:30:47 +02:00
Henrik Lissner
93f7520c79
Refactor Doom core init process (again)
- Eager-load all core autoloaded libraries if autoloads file isn't
  present.
- Renames functions to be more descriptive of their true purpose:
  - doom-initialize-autoloads -> doom-load-autoloads-file
  - doom-load-env-vars -> doom-load-envvars-file
- Use doom-module-p instead of featurep! for backend use (the latter is
  mainly syntax sugar for module use, and evaluates at compile/expansion
  time, which may cause hash-table-p errors early in the startup
  process).
- Reorder plist library to prevent load order race condition with the
  functions using the macros that haven't been defined yet.
2019-07-22 23:22:54 +02:00
Henrik Lissner
a7ce48c2df
bin/doom: add -l/--local/DOOMLOCALDIR
Will come in handy for the new testing framework.
2019-07-22 02:37:48 +02:00
Henrik Lissner
060ede0e2e
General, minor reformatting across the board
And an offering of blood to our great lord Byte Compiler-sama.
2019-07-22 02:37:45 +02:00
Henrik Lissner
b90dede1ab
💥 Replace package.el/quelpa with straight #374
There are a few kinks to iron out, but for the most part it's done. Doom
Emacs, powered by straight. Goodbye gnutls and elpa/quelpa issues.

This update doesn't come with rollback or lockfile support yet, but I
will eventually include one with Doom, and packages will be (by default,
anyway) updated in sync with Doom.

Relevant threads: #1577 #1566 #1473
2019-07-22 02:30:40 +02:00
Henrik Lissner
0a84d2f0a9
core-lib: add auto-minor-mode, revise def-project-mode!
- Adds the auto-minor-mode package to replace our in-house
  implementation.
- Merges associate! into the def-project-mode! macro because associate!
  on its own is less useful than auto-minor-mode-alist,
  auto-minor-mode-magic-alist or hooks.
- Changes the semantics of :modes and :add-hooks properties of
  def-project-mode!. Its arguments are evaluated as is; lists will need
  to be quoted.

squash! core-lib: remove associate! macro
2019-07-22 02:30:39 +02:00
Henrik Lissner
fdcb259bcd
Major refactor of Doom core files
- Remove core-os and move many of its settings out to other core
  libraries, where they belong
- Significantly improve commenting & compartmentalization of many
  settings
- Correct some mis-named public hooks (that were named as if they were
  private)
- Move the vast majority of optimizations to "Optimizations" section in
  core.el
- Don't activate xclip-mode or osx-clipboard-mode if we're accessing
  Emacs through an SSH connection (does more bad than good there)
- Add fast-but-imprecise-scrolling = t
- Set bidi-display-reordering = 'left-to-right, at the recommendation of
  an Emacs dev. Apparently setting it to nil is undefined, as Emacs is
  designed to always assume it's set; setting it explicitly to
  left-to-right will still do what was originally intended by turning it
  off: to reduce line/text scans for bidirectional text, which gives us
  a moderate boost in general runtime snappiness
- Set inhibit-compacting-fon-caches = t on windows (where it struggles
  especially with icon fonts)
- Disables "literal" mode for very large files (because I will be
  backporting so-long.el from Emacs 27 in the next commit)
2019-07-22 02:30:38 +02:00
Henrik Lissner
81ab3dbc5d
Simplify and decouple init files
The two doom-gc-* variables in init.el couples the rest of the config to
these two files. The bulk of GC/file-handler optimization was moved into
core.el and simplified (all that idle-timer voodoo was overkill).

Also adds (setq frame-inhibit-implied-reize t) to early-init, which
speeds up startup a fair bit in some edge cases with larger fonts.

squash! Simplify and decouple init files
2019-07-22 02:30:38 +02:00
Henrik Lissner
149b2617b0
💥 revise hook/var fns naming convention (2/2)
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:

1. Replace the bar | to indicate a hook function with a -h suffix, e.g.

     doom|init-ui -> doom-init-ui-h
     doom|run-local-var-hooks -> doom-run-local-var-hooks-h

2. And add a -fn suffix for functions meant to be set on variables,
   e.g.

     (setq magit-display-buffer-function #'+magit-display-buffer-fn)

See ccf327f8 for the reasoning behind these changes.
2019-07-22 02:30:38 +02:00
Henrik Lissner
51d3b1b424
💥 revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.

In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.

  doom*shut-up -> doom-shut-up-a
  doom*recenter -> doom-recenter-a
  +evil*static-reindent -> +evil--static-reindent-a

The rationale behind this change is:

1. Elisp's own formatting/indenting tools would occasionally struggle
   with | and * (particularly pp and cl-prettyprint). They have no
   problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
   github markdown) struggle with it, sometimes refusing to highlight
   code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
   intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
   on haphazardly way back when Doom was simply "my private config".

Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.

Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
  macro. The old pair weren't as useful. The new def-advice! saves on a
  lot of space.
- Removed "stage" assertions to make sure you were using the right
  macros in the right place. Turned out to not be necessary, we'll
  employ better checks later.
2019-07-22 02:27:45 +02:00
Henrik Lissner
b4d004a91a
Don't read envvar literally at startup #1549 2019-07-10 15:01:01 +02:00
Henrik Lissner
9a02bd8ac8
Minor refactors across the board
- when-let* -> when-let
- Fix projectile-locate-dominating-file for connected remote files
2019-06-26 14:31:06 +02:00
Henrik Lissner
b245237b0c
Move custom-file to DOOMDIR/init.el
(And don't auto-load it at startup; no need)
2019-06-26 14:31:06 +02:00
Henrik Lissner
ae365272ad
Set exec-path/shell-file-name in doom-load-env-vars
And perform file-readable-p check inside doom-load-env-vars
2019-06-18 11:46:27 +02:00
Henrik Lissner
6be401f1a7
Refactor Doom core & reload autoloads remotely
- Move subr-x/cl-lib loading to core-lib
- Revise docstrings for and rename various CLI functions to be more
  descriptive and up-to-date
- After regenerating autoloads file, bin/doom will try to reload
  autoloads files remotely, through the server/daemon, if possible. This
  is highly experimental and could break
2019-06-16 23:01:17 +02:00
Henrik Lissner
72fd61e07b
Ensure order of after-change-major-mode-hook hooks
Reduces the likeliness of load order issues.
2019-06-16 19:16:23 +02:00
Henrik Lissner
653bd99b77
Polyfill kill-current-buffer in Emacs<=25.3 #1446
kill-current-buffer wasn't introduced until Emacs 26.
2019-06-10 09:38:55 +02:00
Henrik Lissner
9413e9ccae
Remove tutorial--saved-dir
See #1433: it is a function, not a variable.
2019-05-28 23:47:52 -04:00
Henrik Lissner
0383e504fe
Fix exec-path on Windows #1423
Windows uses ; as its PATH separator.
2019-05-21 17:24:22 -04:00
Henrik Lissner
4d20655f78
Optimize incremental loading
Interrupt package loading if Emacs recieves input. This further reduces
percieved pauses at startup.
2019-05-19 02:17:58 -04:00
Henrik Lissner
3ed54e191b
Fix #1322: replace load-env-vars w/ custom loader
I've replaced load-env-var with our own custom parser. load-env-var
expects a well-formatted env file, which neither env nor set produces,
which is what doom env uses to dump the shell environment.

This should fix issues that arise when envvars (like PATH) contain
arbitrary whitespace.
2019-05-17 20:19:35 -04:00
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