Commit Graph

379 Commits

Author SHA1 Message Date
Henrik Lissner
748b197676
Minor, general refactors 2019-03-08 04:25:45 -05:00
Henrik Lissner
a05b1877be
Rewrite switch-{buffer,window} hooks
+ Add doom-switch-frame-hook
+ Replace doom-{enter,exit}-{buffer,window}-hook with
  doom-switch-{buffer,window}-hook
+ New switch-buffer hooks run on buffer-list-update-hook rather than
  in select-window advice.
+ Blank our buffer-list-update-hook in some places to reduce how many
  times it gets triggered.
2019-03-08 02:37:33 -05:00
Henrik Lissner
4fbf7a2687
Remove expand-region package
It was unused, and is redundant with evil's text object expansion keys.
2019-03-08 02:34:26 -05:00
Henrik Lissner
78b4c784a6
Remap describe-symbol -> helpful-symbol 2019-03-03 01:26:30 -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
ec55884aae
General, minor reformatting & refactor 2019-02-18 00:47:46 -05:00
Henrik Lissner
4617e00b91
Autoload sp-point-in-{comment,string}
Some commands (like doom/forward-to-last-non-comment-or-eol) can use
this before smartparens has loaded.
2019-01-05 15:21:27 -05:00
Henrik Lissner
451c16b8ee
Revise :after-call & :defer-incrementally comments
Now implicitly adds the current package to :defer-incrementally's list
of packages.
2018-12-23 00:25:51 -05:00
Henrik Lissner
4daa9271a0
Introduce general.el & rewrite map!
+ Now uses an overriding keymap for leader keys, so that it is always
  available, even outside of normal/visual states. In insert/emacs
  states, or in sessions where evil is absent, an alternative prefix is
  used for leader/localleader keys. See these variables:
  + doom-leader-prefix
  + doom-leader-alt-prefix
  + doom-localleader-prefix
  + doom-localleader-alt-prefix
+ Keybinds now support alternative prefixes through the new :alt-prefix
  property. This is useful for non-evil users and non-normal evil
  states. By default, this is M-SPC (leader) and M-SPC m (localleader).
+ Removed +evil-commands flag from config/default (moved to
  feature/evil/+commands.el).
+ config/default/+bindings.el has been split into
  config/default/+{evil,emacs}-bindings.el, which one is loaded depends
  on whether evil is present or not. The latter is blank, but will soon
  be populated with a keybinding scheme for non-evil users (perhaps
  inspired by #641).
+ The define-key! macro has been replaced; it is now an alias for
  general-def.
+ Added unmap! as an alias for general-unbind.
+ The following modifier key conventions are now enforced for
  consistency, across all OSes:
    alt/option      = meta
    windows/command = super
  It used to be
    alt/option      = alt
    windows/command = meta
  Many of the default keybinds have been updated to reflect this switch,
  but it is likely to affect personal meta/super keybinds!

The map! macro has also been rewritten to use general-define-key. Here
is what has been changed:

+ map! no longer works with characters, e.g. (map! ?x #'do-something) is
  no longer supported. Keys must be kbd-able strings like "C-c x" or
  vectors like [?C-c ?x].
+ The :map and :map* properties are now the same thing. If specified
  keymaps aren't defined when binding keys, it is automatically
  deferred.
+ The way you bind local keybinds has changed:

    ;; Don't do this
    (map! :l "a" #'func-a
          :l "b" #'func-b)
    ;; Do this
    (map! :map 'local "a" #'func-a
                      "b" #'func-b)

+ map! now supports the following new blocks:
  + (:if COND THEN-FORM ELSE-FORM...)
  + (:alt-prefix PREFIX KEYS...) -- this prefix will be used for
    non-normal evil states. Equivalent to :non-normal-prefix in general.
+ The way you declare a which-key label for a prefix key has changed:

    ;; before
    (map! :desc "label" :prefix "a" ...)
    ;; now
    (map! :prefix ("a" . "label") ...)

+ It used to be that map! supported binding a key to a key sequence,
  like so:

    (map! "a" [?x])  ; pressing a is like pressing x

  This functionality was removed *temporarily* while I figure out the
  implementation.

Addresses: #448, #814, #860
Mentioned in: #940
2018-12-22 04:14:43 -05:00
Henrik Lissner
63e25b349d
Silence undo-tree a little less destructively
undo-tree-load-history was formerly advised with doom*shut-up, which
uses the quiet! macro to suppress output. quiet! accomplishes this by
temporarily redefining message to a no-op function. However, if a fatal
error occurs while this binding is active, in some cases, message will
remain redefined, perpetually silencing all output to the minibuffer.

This tries to mitigate that, at least where undo-tree is concerned.

Also sharp-quotes an unquoted function.
2018-10-16 02:51:11 -04:00
Henrik Lissner
d21887149f
Minor refactor/reformatting 2018-10-06 20:44:25 -04:00
Henrik Lissner
5b4690419b
Increase doom-large-file-size threshold to 2mb
1mb is a little *too* conservative.
2018-10-03 15:10:08 -04:00
Henrik Lissner
48f7d33c03
Don't doom|check-large-file on tags files
Fixes an issue where reading TAGS files could cause "%s is a large file,
open literally to avoid performance issues?" prompts every time you open
a project file, if the tags file was larger than `doom-large-file-size'
2018-10-03 15:08:25 -04:00
Henrik Lissner
3961ba1662 Fix command-log-mode not disabling on toggle
clm/toggle-command-log-buffer enables global-command-log-mode, but
doesn't disable it on second invocation, so we use
global-command-log-mode instead.
2018-09-28 21:13:27 -04:00
Henrik Lissner
75ad188e01
Fix :defer-incrementally t
Should be the same as :defer-incrementally (<package-name>)
2018-09-21 22:43:52 -04:00
Henrik Lissner
b653039535
Add :defer-incrementally use-package keyword 2018-09-20 10:42:45 -04:00
Henrik Lissner
57579b883b
Refactor doom core files 2018-09-09 09:58:20 -04:00
Henrik Lissner
7d3ffdff06
Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
Henrik Lissner
3a23ff56cd
General formatting & minor refactors 2018-09-02 17:20:19 +02:00
Henrik Lissner
4e2bd22869
Don't chmod +x scripts
This silent change is a bit too intrusive. It's convenient, but let the
user decide to use it, rather than force it on them.
2018-08-31 23:36:54 +02:00
Henrik Lissner
d80e79203a
Replace delete-trailing-whitespace with ws-butler
ws-butler only strips trailing spaces on lines that have been modified.

+ ws-butler is disabled if editorconfig enables
  trim_trailing_whitespace, which resorts to delete-trailing-whitespace
  instead.
+ Updates doom|(enable|disable)-delete-trailing-whitespace hooks to use
  ws-butler-mode.
2018-08-31 13:59:12 +02:00
Henrik Lissner
c1fa37245f
Fix dtrt-indent errors in broken smie modes
Some smie modes throw errors when trying to guess their indentation,
like `nim-mode'. This prevents them from leaving Emacs in a broken
state.
2018-08-30 22:39:03 +02:00
Henrik Lissner
edc9bf70af
Delete trailing whitespace, globally, by default
Also adds doom|disable-delete-trailing-whitespace hook, which can be
used to disable this behavior on a per-buffer basis. If you want to turn
off this global behavior:

  (remove-hook 'write-file-functions #'delete-trailing-whitespace)
2018-08-30 20:36:15 +02:00
Henrik Lissner
2b560a6a0e
General & minor refactoring 2018-08-28 13:36:44 +02:00
Henrik Lissner
7a578eb242
Move counsel+helpful integration to ivy module 2018-08-17 03:37:07 +02:00
Henrik Lissner
a715f848aa
Let EMACS_SERVER_NAME envvar change server-name 2018-08-16 12:53:38 +02:00
Henrik Lissner
735e14270e
Fix non-string errors from kill-ring
When unpropertizing the kill ring.
2018-08-11 02:05:33 +02:00
Henrik Lissner
541ce81b91
Fix #791: replace global-command-log-mode
global-command-log-mode isn't autoloaded, but
clm/toggle-command-log-buffer is, and if command-log-mode-is-global is
set, it is equivalent to global-command-log-mode.
2018-08-08 23:37:30 +02:00
Henrik Lissner
37e80c4878
Refactor doom*strip-text-properties-from-undo-history
:around -> :before advice
2018-08-07 03:27:24 +02:00
Henrik Lissner
c45e563453
Fix advice for `undo-tree-make-history-save-file-name'
Inspired by #786: `:filter-return' expects a function to be given. If neither
"zstd" or "gzip" are found on the executable path, then it gets given nil
instead, which results in sadness when trying to save files.
2018-08-07 03:14:28 +02:00
Henrik Lissner
261aa7c944
Compress/compact undo-tree history (and shut up) 2018-08-03 19:09:06 +02:00
Henrik Lissner
b12944fddb
undo-tree-auto-save-history = t
Persistent undo history is great. I'm hoping that, with
undo-tree-enable-undo-in-region disabled, we can enable this feature
again safely.

Time will tell.
2018-08-03 18:25:24 +02:00
Henrik Lissner
ea0f46b181
Add 2nd arg to doom-initialize to load core libs
This restores the correct value of noninteractive while core libs are
loading, so packages like recentf can avoid initializing when running
emacs non interactively (thus polluting output or possibly causing
errors).
2018-08-03 16:35:42 +02:00
Henrik Lissner
b33b5ed624
Cleanup recentf list on kill-emacs 2018-07-30 02:57:50 +02:00
Henrik Lissner
cb7e471c90
General reformatting & comment revision/cleanup 2018-07-29 19:31:33 +02:00
Henrik Lissner
35e5a47e9f
Rewrote indentation detection
More robust and easier to customize.
2018-07-29 19:31:32 +02:00
Henrik Lissner
05d9a83ff7
Unpropertize kill-ring in savehist data
This speeds up startup marginally.
2018-07-29 17:41:59 +02:00
Henrik Lissner
2e25989dc5
undo-tree-enable-undo-in-region = nil
Try to save off the elusive and annoying "unrecognized entry in undo
list undo-tree-canary" error produced by undo-tree.
2018-07-29 17:41:59 +02:00
Henrik Lissner
a07126f611
Revise code comments in smartparens config 2018-07-24 20:08:11 +02:00
Henrik Lissner
8b25abc11c
large-file-warning-threshold = 30mb
Staves off filesize warnings for large files (like pdfs and media
files), while doom|check-large-file handles text files.
2018-07-12 20:43:04 +02:00
Henrik Lissner
81ffed520b
Rename doom-before-switch-*-hook hooks
+ doom-before-switch-buffer-hook => doom-exit-buffer-hook
+ doom-before-switch-window-hook => doom-exit-window-hook
+ doom-after-switch-buffer-hook => doom-enter-buffer-hook
+ doom-after-switch-window-hook => doom-enter-window-hook

Shorter, easier-to-type names that better describe their intended
purpose.

The old names are still usable, but deprecated.
2018-07-03 03:41:08 +02:00
Henrik Lissner
bf5c8351e4
Fix jumpiness from progress bars in eshell/term
Due to hscroll-margin ping-ponging the cursor.
2018-06-30 02:49:52 +02:00
Henrik Lissner
0603f7bb5d
Remove duplicate hscroll-margin setting 2018-06-30 02:46:09 +02:00
Henrik Lissner
f987c121d4
Make indent detection more ubiquitous #727
And have it change tab-width as well.

This should work as soon as my PR into dtrt-indent is pulled into MELPA.
2018-06-29 01:55:21 +02:00
Henrik Lissner
50991232e6
sp-escape-quotes-after-insert = nil
Smartparens isn't smart enough to escape quotes in many situations (like
single quotes in c/c++).
2018-06-28 14:44:47 +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
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
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
913394bfe7
Be quiet, recentf! 2018-06-17 02:25:12 +02:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
44363cae40
General, minor refactor & revision
Across the board. All the boards.
2018-06-16 12:26:58 +02:00
Henrik Lissner
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
Henrik Lissner
1db3830bf3
Defer server startup
MY PRECIOUS MILLISECONDS OF STARTUP TIME
2018-06-15 21:44:44 +02:00
Henrik Lissner
421d00f085
Refactor doom|check-large-file
More checks, fewer false positives.
2018-06-14 19:51:11 +02:00
Henrik Lissner
ac546220a4
Refactor core-editor def-package! blocks 2018-06-14 03:36:46 +02:00
Henrik Lissner
36171f5b33
Fix :after-call deferred packages not loading
If you open emacs with a file (emacs file.txt), the file is switched to
before the switch-buffer hooks are set up. However, many core packages
are hooked to those switch-buffer hooks (to load when they're first
triggered). They miss the boat and don't get loaded.

These packages are now hooked onto after-find-file as well (and
immediately), which will fire when a file is opened, before or after
initialization.

Fixes #680
2018-06-14 03:36:46 +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
Henrik Lissner
2d6bef33d3
Disable doom|detect-indentation in fundamental or special modes
This should fix #607, which is caused by whitespace-mode messing up the
overlays/text properties in the mu4e sidebar.
2018-05-26 03:06:47 +02:00
Henrik Lissner
9febfb0477
Add fundamental-mode to doom-large-file-modes-list 2018-05-26 03:06:22 +02:00
Henrik Lissner
6dc375a891
Fix catch-all text-mode entry in auto-mode-alist
This indirectly fixes an issue where the elfeed db was opened in
text-mode, triggering the large-file check.
2018-05-24 21:20:02 +02:00
Henrik Lissner
8ce5e96ea5
recentf: auto-cleanup = 120; refactor temp-file detector 2018-05-21 01:38:17 +02:00
Henrik Lissner
1369c51000
Replace :defer HOOK/FN with :after-call keyword 2018-05-21 01:38:17 +02:00
Henrik Lissner
d4608c08f8
Defer dtrt-indent & don't detect indent in noninteractive Doom 2018-05-20 12:18:16 +02:00
Henrik Lissner
3d0745c3ec
Add automatic indentation-detection (experimental)
Editorconfig is given precedence. If it successfully sets an
indent_style or indent_size for the current buffer, automatic
indentation detection will be disabled.
2018-05-18 01:28:41 +02:00
Henrik Lissner
4f9cb60e07
Start server sooner 2018-05-17 15:29:54 +02:00
Henrik Lissner
02e4c15b8e
Move avy/ace-link from core-editor to core-ui 2018-05-17 15:29:29 +02:00
Henrik Lissner
b4a7e5348a
Autoload smartparens commands
Turns out I *do* need these!
2018-05-16 00:58:04 +02:00
Henrik Lissner
1e004a5638
Change undo-tree deferral to before switch buffer 2018-05-16 00:11:14 +02:00
Henrik Lissner
b6813393d8
Remove custom helpful pretty-printer; default is superior 2018-05-16 00:11:14 +02:00
Henrik Lissner
4734d55edc
Revert smartparens deferral until first before-switch-buffer 2018-05-15 22:19:37 +02:00
Henrik Lissner
8428a7a4ef
Autoload smartparens library 2018-05-15 22:07:44 +02:00
Henrik Lissner
7c97fd3c73
Load smartparens a little sooner (fix sp-with-modes error) 2018-05-15 21:52:09 +02:00
Henrik Lissner
c36e127ec5
Rethink core package deferral hooks
Ensure they are available exactly when they can be useful, but no
sooner.
2018-05-15 21:49:51 +02:00
Liu, Joey
86b6fab18e Add: ace-link-mu4e autoload 2018-05-15 09:30:21 -04:00
Henrik Lissner
032203ef99
hscroll-margin = 2
So that moving to the ends of a sentence don't sometimes leave the
cursor beyond the edge of the screen in GUI Emacs.
2018-05-15 10:54:45 +02:00
Henrik Lissner
a6c6686628
Enable global-undo-tree-mode after setting variables 2018-05-15 10:54:45 +02:00
Henrik Lissner
94f9e43f25
Rewrite :defer semantics
:defer now supports a hook, a cons cell with (SYMBOL . INTEGER) where
SYMBOL is a hook and INTEGER is a number of idle seconds before the
package is autoloaded, or just the integer (as per the default behavior
of :defer).

Also fixes an issue where switch-buffer-deffered packages (like
smartparens) wouldn't load.
2018-05-15 10:54:45 +02:00
Henrik Lissner
d51f3b1f38
Map /[A-Z]+$ files to text-mode 2018-05-15 01:40:42 +02:00
Henrik Lissner
bec79a3d4c
Major refactor of Doom bootstrap process
+ New `input` and `buffer` support for :defer in def-package! can now
  defer packages until the first command invoked after startup or first
  interactive buffer switch, respectively
+ Exploit these new :defer techniques to lazy-load many core packages,
  netting Doom a 20-30% decrease in startup time
+ Various userland macros (like package!, def-package-hook!, packages!,
  and disable-packages!) will now throw an error if used incorrectly
  (i.e. outside of their intended files; e.g. package! should be used in
  packages.el files)
+ Removed support for multiple/nested doom! calls. There should only be
  THE ONE in ~/.doom.d/init.el (or ~/.config/doom/init.el)
+ Fix an issue where load-path and auto-mode-list modifications would
  not persist because doom-packages-file was cached too late.
+ Added package-activated-list to cached variables in
  doom-packages-file, thus we no longer need custom-file.
+ Load Doom core files from doom-initialize. Now doom-initialize can be
  called from state-dependent non-interactive functions, instead of
  reloading core/core.el, which was clumsy
+ Removed the doom-post-init-hook hook. There was no reason for it to
  exist when doom-init-hook can simply be appended to
2018-05-14 20:37:13 +02:00
Henrik Lissner
99bd3beec2
Autoload ace-link-addr 2018-05-14 13:05:03 +02:00
Henrik Lissner
57f383ef76
General revision of docstrings 2018-05-14 13:05:03 +02:00
Henrik Lissner
67f9aa1ffe
Move whitespace config to core-ui
Introduces new doom|show-whitespace-maybe hook to replace
doom|editorconfig-whitespace-mode-maybe
2018-05-09 00:20:01 +02:00
Henrik Lissner
8d936f2d0b
Move editorconfig out of core into tools/editorconfig 2018-05-08 19:59:08 +02:00
Henrik Lissner
99ca62c106
Remove smart-forward package 2018-05-08 19:56:31 +02:00
Henrik Lissner
cecff39a7e
Refactor doom|check-large-file 2018-05-07 19:26:31 +02:00
Henrik Lissner
65245bfc21
recentf-auto-cleanup = 60
Cleanup would cause tremendous slowdowns on startup if files in its list
didn't exist.
2018-05-07 19:26:31 +02:00
Henrik Lissner
9e315c93da
Revert sp-autowrap-region to default
Fixes wrapping regions for non-evil users
2018-05-02 15:53:54 +02:00
UndeadKernel
856dd96636 Whitespace should preferably respect the fill-column variable
Let whitespace dynamically set `whitespace-line-column` depending on the current
state of the variable `fill-column`. Changing the value to `nil` does exactly that.
2018-03-26 18:17:59 +02:00
Henrik Lissner
51b5fb0f44
Add missing modes to editorconfig-indentation-alist 2018-03-21 05:19:01 -04:00
Henrik Lissner
1352ac4553
Exclude images and remote files from recentf 2018-03-14 18:28:48 -04:00
Henrik Lissner
00a9a08afb
Automatically add execute permission to files with a shebang line 2018-03-12 13:32:02 -04:00
Henrik Lissner
5726da8be2
Fix unbalanced-parenthesis error in some helpful-variable buffers 2018-03-12 13:32:00 -04:00
Henrik Lissner
11e5140b98
Fix editorconfig file ext 'guesser' in org-edit-src buffers
Fixes editorconfig not correctly guessing style settings in org-edit-src
buffers.
2018-02-13 19:42:39 -05:00
Henrik Lissner
bae2287d51
Recenter screen after save-place successfully loads point 2018-02-02 20:47:32 -05:00
Henrik Lissner
03a03853e4
core-editor: reset expand-region on doom/escape #317 2018-02-01 19:58:44 -05:00
Henrik Lissner
c5b72566ea
Remove help-fns+, add helpful plugin #363 2018-01-21 21:37:15 -05:00
Henrik Lissner
45c2221316
General update for docstrings and comments & minor refactor 2018-01-15 00:43:28 -05:00
Henrik Lissner
5ee50c6b53
Move wgrep config from core-editor to completion/{ivy,helm} 2018-01-14 02:04:34 -05:00