Commit Graph

3507 Commits

Author SHA1 Message Date
Henrik Lissner
0f98b5b3c2
core-lib: use projectile cache in file-exists-p!
If available.
2019-07-22 02:30:39 +02:00
Henrik Lissner
f05aa3a0b1
core-lib: add unsetq-hook! #1568 2019-07-22 02:30:39 +02:00
Henrik Lissner
987061aedd
Rewrite autoload/message.el & move to format.el
Adds new convenience macros like print! and insert!, and adds classes;
which are helper functions that can be called inline within format!,
print! et co, e.g.

  (format! "%s" (filename "/tmp/some/file")) ; => file
  (format! "%s" (relpath "/tmp/some/file" "/tmp")) ; => some/file
  (format! "%s" (dirname "/tmp/some/file")) ; => /tmp/some

Check out doom-format-class-alist for more.
2019-07-22 02:30:39 +02:00
Henrik Lissner
2df56b93a9
Add so-long package
This package kicks in if you open a file whose lines are too long.

It is built into Emacs 27+, but I've backported it for earlier users.
2019-07-22 02:30:38 +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
e3a102d05a
core-lib: minor reformatting 2019-07-20 11:40:03 +02:00
Henrik Lissner
2caaec50e8
Remove cond!
Well, that was short lived, but pcase and pcase-let are superior and
already available.
2019-07-20 11:40:03 +02:00
Henrik Lissner
c3354e2620
cli: disable patch-macos (only --undo/-u works)
This has been deprecated for a while. I will remove it entirely with the 2.1
release, but for now, you can no longer patch your app bundle with this.

Use 'doom env refresh' instead.
2019-07-20 11:40:00 +02:00
Henrik Lissner
8b27d19e0b
Fix "err=[-50]" gnutls error
When updating/installing packages.
2019-07-20 11:05:52 +02:00
Henrik Lissner
24b40824ce
Add doom-{visible,buried}-buffer-p predicates 2019-07-18 13:13:31 +02:00
Henrik Lissner
103612a347
Add cond! macro to core-lib
An anaphoric cond.
2019-07-18 01:20:55 +02:00
Henrik Lissner
84d43643c9
Fix "Bad request" failures during package-refresh
Particular with elpa.gnu.org. This is caused by a known error in Emacs
26.x, which has been fixed in 27, and documented here:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34341
2019-07-15 01:00:49 +02:00
Henrik Lissner
2ff762b397
Fix fd/rtags on debian/ubuntu
On debian/ubuntu, these executables have a different name:

- fd -> fdfind
- rc -> rtags-rc
- rdm -> rtags-rdm
2019-07-14 22:04:50 +02:00
Henrik Lissner
3313058c76
Make doom-adjust-font-size non-interactive
As it was intended.
2019-07-14 20:44:16 +02:00
Henrik Lissner
0b28480a21
Remap xref-pop-marker-stack -> better-jumper
Better to have only one jumplist system.

Also remaps xref-find-* commands to +lookup commands earlier in the
startup process.
2019-07-13 15:47:19 +02:00
Henrik Lissner
57a5137b4b
Remove melpa mirror
It's fairly outdated (7 months) and only adds time to refresh process.
Need to find better mirrors or switch to straight soon.
2019-07-13 13:58:53 +02:00
Henrik Lissner
17d7130804
Fix #1558: remember position on C-a/C-e
When the cursor is between the swap points.
2019-07-12 18:19:28 +02:00
Henrik Lissner
e6540b419b
doom/set-indent-width: set standard-indent buffer-locally 2019-07-12 16:55:36 +02:00
Henrik Lissner
fddef812ec
tools/editorconfig: refactor how we ignore lisp modes 2019-07-12 16:47:49 +02:00
Henrik Lissner
f3fa1b0324
Fix editorconfig usage in doom/set-indent-width #1561 2019-07-12 16:39:00 +02:00
Henrik Lissner
527079094d
Expand docs for doom {install,update,autoremove} 2019-07-12 14:16:53 +02:00
Henrik Lissner
f0abd10409
Fix #1558: doom/forward-to-last-non-comment-or-eol
Should jump to EOL if end-of-non-comment is before point.
2019-07-12 13:33:31 +02:00
Henrik Lissner
c627972d20
Add set-indent-width & toggle-indent-style commands
And SPC t I keybind

Also sorts keybinds under the SPC t prefix
2019-07-11 17:22:01 +02:00
Henrik Lissner
1f84c206d6
Don't grow minibuffer when echoing large messages
Unless we're in the minibuffer (e.g. eval-expression, ivy or evil-ex)

Also makes direnv summaries less imposing.
2019-07-10 21:28:27 +02:00
Henrik Lissner
3423ecc3d3
Load server on focus-out
In case the user switches to a terminal to use emacsclient as soon as
emacs is started.
2019-07-10 20:35:28 +02:00
Henrik Lissner
cb401c8302
Don't abbreviate autoload paths on windows #1548 2019-07-10 16:05:40 +02:00
Henrik Lissner
dfa5324f3d
cli/env: change how envvars are ignored
Improves the detection and omission algorithm of undesired envvars.
2019-07-10 15:06:45 +02:00
Henrik Lissner
b4d004a91a
Don't read envvar literally at startup #1549 2019-07-10 15:01:01 +02:00
Henrik Lissner
c99c184f85
Fix error in doom/help-packages for gnu packages
Due to validation checking for the wrong strings. Also extends support
for user-supplied archives (though the link may not be as helpful).
2019-07-09 23:30:59 +02:00
Henrik Lissner
ed9d7feb36
projectile: persist projectile-projects-cache-time
This way, projectile caches won't expire when restarting Emacs, but
instead time + projectile-files-cache-expire seconds from the time it is
serialized.
2019-07-09 19:54:21 +02:00
Henrik Lissner
c3c282f0a4
Add λ!! (lambda!!) macro
For quick inline commands for keybinds that simply call a
command (interactively) with a prefix argument.
2019-07-09 02:34:24 +02:00
Henrik Lissner
cd9378bb9e
Fix set-project-type!
Reference to non-existent variable, when
2019-07-09 02:19:35 +02:00
Henrik Lissner
df56ea5c60
Fix projectile breakage in windows in git projects
Because projectile tries to use `tr`, which doesn't exist on windows.
2019-07-08 22:08:54 +02:00
Henrik Lissner
71d505b893
Cache doom-modules on doom refresh 2019-07-07 14:10:21 +02:00
Henrik Lissner
b58b5e1d64
Fix auto-removal of builtin-preferred packges 2019-07-07 14:07:41 +02:00
Henrik Lissner
faeefc1775
Add FLAG argument to doom-module-p 2019-07-07 14:07:11 +02:00
Henrik Lissner
ebd53e5664
Allow expansion of stage-restricted forms
The package! family of macros will throw an error if used in the wrong
files. This same check would prevent macroexpand from expanding them, or
prevent them from being evaluated inline.
2019-07-07 13:29:22 +02:00
Henrik Lissner
dd4c70fe93
Add doom/reload-autoloads 2019-07-07 13:20:25 +02:00
Henrik Lissner
abfc8ced21
Add warning re :prefix-map in map! docstring
It really shouldn't be used outside of Doom proper; it has the
capability of destroying other :prefix-map's due to variable/keymap
naming collisions.
2019-07-07 02:00:36 +02:00
Henrik Lissner
51c067cc4d
Fix vanilla-doom+ sandbox instance
Now initializes doom-modules correctly and suppresses an undo-tree
error.
2019-07-07 01:58:49 +02:00
Henrik Lissner
9c15bb82f9
Fix hook collisions by setq-hook!
Fixes an edge case where setq-hook! would override the setq hooks of
other calls to setq-hook!

I want to avoid make-symbol/gensym so users can refer to these hook
functions by name, in case users want to remove these hooks by hand, if
necessary (e.g. for debugging purposes).
2019-07-06 23:22:28 +02:00
Henrik Lissner
af7a2d16c4
Clarify argument in after!'s docstring
after! takes a package, not a mode.
2019-07-06 23:22:28 +02:00
Henrik Lissner
0f0a8a5744
Rewrite custom-set-face!, add custom-theme-set-face!
custom-set-faces! and custom-theme-set-faces! are now drop-in
replacements for custom-set-faces and custom-theme-set-faces with one
major distinction: the latter will wait for the theme to be loaded
before applying the changes, this allows you to use theme-specific APIs
in your face definitions (like doom-color from doom-themes).

You no longer have to think about load order when using these macros.
2019-07-06 23:22:27 +02:00
Henrik Lissner
3b17d767b8
package!: fix the fix fix fix for the :built-in fix
fixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfix
fixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfix
fixfix   fixfixfixfixfixfixfixfixfixfixfixfi    fixfix
fixfi    fixfixfixfixfixfixfixfixfixfixfixf     fixfix
fixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfix
fixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfix
fixfix                                       fixfixfix
fixfixfix       everything is fine        fixfixfixfix
fixfixfixfixfix                     fixfixfixfixfixfix
fixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfix
fixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfixfix
2019-07-05 23:53:56 +02:00
Henrik Lissner
0dab58ef19
package!: fix the fix for :built-in fix
fixfixfix
2019-07-05 23:07:05 +02:00
Henrik Lissner
ecc4e8087c
package!: fix :built-in property 2019-07-05 22:30:24 +02:00
Henrik Lissner
1f644d07e0
package!: accept 'prefer in :built-in property
This tells Doom's package manager to prefer the built-in package, if it
is present, rather than installing the new version from elpa.
2019-07-05 20:03:37 +02:00
Henrik Lissner
cb783b0609
Prevent hash-table-p errors on startup 2019-07-02 23:17:20 +02:00
Henrik Lissner
d8e7a2003b
Fix custom.el writing to DOOMDIR/init.el too early
This would cause ~/.doom.d/init.el to exist before `doom quickstart` can
copy ~/.emacs.d/init.example.el into it, causing some newcomers to
experience a wrong-type-argument: hash-table-p error at startup (and no
modules being enabled).
2019-07-02 23:17:20 +02:00
Henrik Lissner
52f575d4d2
Exclude PROMPT & RPROMPT envvars from env file 2019-07-02 14:16:58 +02:00
Henrik Lissner
275f499ce9
Exclude PS1 envvar from env file 2019-07-02 13:01:28 +02:00
Henrik Lissner
2762a08a76
highlight non-default indent despite whitespace-mode
Before, a custom whitespace-style (or global-whitespace-mode) would
disable doom|highlight-non-default-indentation (because they were
incompatible). Now it injects itself into the current style, if one
exists.
2019-06-30 14:28:21 +02:00
Henrik Lissner
58299341b8
Fix vanilla-doom+ launcher in sandbox (C-c C-p)
vanilla-doom+ should launch an instance of Doom with doom core plus
modules minus your private config loaded.
2019-06-30 13:18:14 +02:00
Henrik Lissner
5d0c408c38
cli/env: ignore PWD envvar 2019-06-30 09:48:54 +02:00
Henrik Lissner
92676bfe39
uniquify-buffer-name-style = 'forward #1506 2019-06-28 17:28:53 +02:00
Henrik Lissner
81cf6080bf
doom/window-maximizer-buffer: fail gracefully in popups
Doesn't work within popups and it's non-trivial to fix this, so better
it fail gracefully with a suggestion, instead of fail silently.
2019-06-27 17:21:00 +02:00
Henrik Lissner
d6aa19b638
Suppress error from projectile-default-generic-command
Caused when using projectile-{run,test,compile,configure}-project
commands in a project that projectile cannot recognize (i.e. doesn't
match any project in projectile-project-types).
2019-06-27 17:17:04 +02:00
Henrik Lissner
22cc519ac1
Add set-project-type! autodef
And use it for love2d projects in lang/lua module.
2019-06-27 17:16:40 +02:00
Henrik Lissner
2aa9252725
Move doom|disable-show-paren-mode to autoload/ui 2019-06-27 13:26:03 +02:00
Henrik Lissner
6317fa0435
Fix #1509: failure to resize certain popups (part 2)
doom/window-enlargen would fail silently for windows with a preserved
size (e.g. all ui/popup popup windows)
2019-06-26 23:06:46 +02:00
Henrik Lissner
95dff9f2c6
Remove deprecated set-env! 2019-06-26 21:06:05 +02:00
Henrik Lissner
129377ca5f
Remap tags commands sooner
Makes them easier for users to remap later.
2019-06-26 14:49:39 +02:00
Henrik Lissner
a9951ee63b
Autorevert on switch window
Better coverage for lazy autoreverting
2019-06-26 14:31:07 +02:00
Henrik Lissner
9c29ad78e0
Add SHELL to doom-info 2019-06-26 14:31:07 +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
4f5f51237e
cli/env: remove ignored vars retroactively
doom-env-ignored-vars is now treated as a list of regexps.

Also updates docstrings and announces ignored variables.
2019-06-26 14:31:06 +02:00
Henrik Lissner
cdc41fc822
cli/env: reformat envvar file header
Places the generation command on line 2 for easier retrieval and
reformats explanation below.
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
26da625981
Fix #1509: failure to resize certain popups 2019-06-26 14:28:40 +02:00
Henrik Lissner
1e357310c4
Fix localleader alt key in insert mode 2019-06-26 14:28:40 +02:00
Henrik Lissner
c0eb1f524d
Fix exclusion of doom local files in recentf
Due to a load order issue, the doom-local-dir regexp wouldn't be mapped
through our custom recentf-filename-handlers. `file-in-directory-p` is
more robust.
2019-06-26 14:28:40 +02:00
Henrik Lissner
b45591989b
Revert remote reloading after refreshing autoloads
It's too flimsy, breaks easily, and doesn't handle the case where
multiple instances of Emacs are open.
2019-06-18 22:10:19 +02:00
Henrik Lissner
4575cbef05
Add rg check to core/doctor.el 2019-06-18 17:30:08 +02:00
Henrik Lissner
798e10c4f2
Refactor doom doctor
And move font check into core/doctor.el
2019-06-18 17:29:50 +02:00
Henrik Lissner
fd1b31667e
Index projects with ripgrep/fd on Windows 2019-06-18 14:43:15 +02:00
Henrik Lissner
f2d7c5625d
Revise comments & docstring 2019-06-18 14:43:05 +02:00
Henrik Lissner
3589ce4c5b
Fix exclusion of doom-local-dir from recentf list 2019-06-18 13:38:21 +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
12fa049012
Disable lazy autorevert if auto-revert-mode is used 2019-06-18 00:51:59 +02:00
Henrik Lissner
e2869c62a1
Add file-readable-p check to doom-project-find-file 2019-06-17 20:57:29 +02:00
Henrik Lissner
d27c148e14
Fix font-resizing in child frames #1500 2019-06-17 16:01:37 +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
5e9c020c21
doom-files-in: replace NOSORT w/ SORT; change default MATCH
- SORT defaults to t
- MATCH's new default regexp excludes files that start with underscore.
2019-06-16 19:16:23 +02:00
Henrik Lissner
47739698a8
Correct typo in doom env enable output #1499 2019-06-16 19:16:22 +02:00
Henrik Lissner
84fd744e3f
Minor, general refactor & comment revision 2019-06-14 11:08:59 +02:00
Gerry Agbobada
9d668791da Correct documentation of env_var file
Because of 3ed54e191b The `load-env-vars` advice is false now. Instead we can propose setting "doom-env-file" correctly, it seems to work for me.
2019-06-13 10:03:50 +02:00
Henrik Lissner
f3d8053933
Add internal doom-customize-theme-hook
Ensures custom-set-faces! take effect before any load-theme hooks.
2019-06-12 22:42:32 +02:00
Henrik Lissner
6641e26283
Refactor package management API
Sets out to solve a number of issues with the package management
process. Namely:

- To-be-removed packages that are simply being removed are no longer
  incorrectly labeled "quelpa->elpa", but "removed" instead.
- A backend (elpa vs quelpa) column was added to the package listing
  confirmation when running `doom update`.
- Doom now correctly recognizes that packages installed with a psuedonym
  are installed, and will not endlessly attempt to uninstall and
  reinstall them on every `doom refresh`.
- Packages declared with :built-in will no longer lose their built-in
  marking if said package is not actually present in Emacs' site load
  paths. i.e. if you say it's built in, Doom won't question it.
- package!'s :ignore property is now treated as a form whose evaluated
  result will be used as its value.
2019-06-11 08:01:42 +02:00
Henrik Lissner
158e4cc97c
Fix doom/clone-and-narrow-buffer
Also restores window scroll position after widening.
2019-06-10 09:38:57 +02:00
Henrik Lissner
4ae6faf627
scroll-margin = 0 2019-06-10 09:38:56 +02:00
Henrik Lissner
d329f216e3
Fix #1444: recentf hangs Emacs on quit & cleanup
Caused by using file-truename on (disconnected) remote files, which
invoked TRAMP authentication.

Replaces #1451
2019-06-10 09:38:56 +02:00
Henrik Lissner
79941a4fd7
Make recentf more aggressive
- Updates file order on window switch
- Adds dired directories to recentf list
- Reduce recentf-max-saved-items from 300 to 200 (reduce worst-case
  resorting costs)
2019-06-10 09:38:56 +02:00
Henrik Lissner
29293aa17f
Fix #1453: ensure package autoloads are reloaded
`doom-package-update` does not trigger regeneration of the package
autoloads file.
2019-06-10 09:38:56 +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
chrunchyjesus
2631ca90d9
fix shebang for macos patch 2019-06-08 07:31:24 +02:00
Brice Waegeneire
b29a7357c6 projectile: fd never use colors
Prevent projectile-find-file to be littered with escape codes when the
environment variable LS_COLORS is set.
2019-06-01 14:33:21 +02:00