Commit graph

30 commits

Author SHA1 Message Date
Henrik Lissner
6a23c6142b tools/direnv: refactor
Our advice is no longer needed, now that envrc provides
envrc-propagate-environment. We also cache the executable path (benefits
TRAMP users, in particular).
2021-07-06 02:32:38 -04:00
Henrik Lissner
044a1a5f2b Drop Emacs 26.x support
Emacs 27.x has been the stable version of Emacs for nearly a year, and
introduces a litany of bugfixes, performance, and quality-of-life
improvements that significantly reduce Doom's maintenance burden (like
XDG support, early-init.el, image manipulation without imagemagick, a
native JSON library, harfbuzz support, pdumper, and others).

With so many big changes on Doom's horizon, I like having one less (big)
thing to worry about.

Also reverts bb677cf7a (#5232) as it is no longer needed.
2021-07-06 02:31:52 -04:00
Henrik Lissner
755d4c7b15 Add popup rule for *envrc* error buffers 2021-05-15 14:09:08 -04:00
Henrik Lissner
ecca37b07b
Bump :tools direnv
purcell/envrc@da8e306 -> purcell/envrc@18caf51

envrc-mode now provides its own envrc file major mode with basic syntax highlighting.
2020-11-14 13:05:28 -05:00
Henrik Lissner
f7293fb67e
Fix #4208: aborting direnv shouldn't abort find-file 2020-11-11 20:33:27 -05:00
Henrik Lissner
d45155aec8
tools/direnv: only run direnv once per buffer
Halves the time direnv integration takes to initialize.
2020-11-10 18:36:47 -05:00
Henrik Lissner
6f49f2151e
Fix #3812: direnv not in scope for babel execution 2020-08-24 22:27:40 -04:00
Henrik Lissner
6444662131
Fix envrc not being activated correctly
Fixes #3812
2020-08-23 15:18:03 -04:00
Henrik Lissner
06c404ecb1
tools/direnv: replace direnv package with envrc
wbolster/emacs-direnv uses an approach that mutates global state,
allowing a direnv to bleed into unrelated buffers and contexts. For this
to work it must rereads the direnv every time you switch buffers, which
can be very slow.

purcell/envrc, on the other hand, makes env state buffer-local, so the
direnv only needs to be read once, when a is first initialized. This is
faster and less error prone. However, it's necessary to manually reload
the direnv if you've changed your .envrc outside of Emacs (with `M-x
envrc-reload` or `M-x envrc-reload-all`).
2020-08-21 04:45:04 -04:00
Henrik Lissner
b92f41bfb2
Revert d697ff481
Fixes #3158
2020-05-18 15:12:13 -04:00
Henrik Lissner
d697ff481e
Update direnv unconditionally in some cases 2020-05-18 01:38:22 -04:00
Henrik Lissner
7afa8a7e90
Refactor tools/direnv 2020-02-06 15:29:28 -05:00
Henrik Lissner
a12a54b28f
Revert direnv modifications
Not worth the trouble. I'll move it to my private config.

Fixes #2384
Closes #2384
2020-02-02 03:18:49 -05:00
Henrik Lissner
6758110a25
Properly disable direnv when direnv-mode is disabled 2020-01-25 19:02:01 -05:00
Henrik Lissner
3743bc70ab
tools/direnv: fix async-shell-command 2019-12-01 15:42:05 -05:00
Henrik Lissner
4860bb86ce
tools/direnv: only update on major mode change
Rather than on buffer-switch. This makes switching windows much faster,
but introduces a (low) risk of a stale environment. Needs more testing.
2019-10-18 22:34:41 -04:00
Henrik Lissner
880c581c0d
tools/direnv: add README 2019-08-27 12:50:10 -04:00
Henrik Lissner
a9b5640d1f
tools/direnv: remove redundant focus-in hook
It's redundant with doom-switch-frame-hook
2019-08-27 00:09:50 -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
3423974234
Minor refactors & tweaks across the board 2019-08-06 14:50:42 -04:00
Henrik Lissner
19ecf8e46a
Correct last inline hook defuns
See a3e262c7 for rationale
2019-07-28 16:10:53 +02:00
Henrik Lissner
82ae3a73f3
def-advice!->defadvice! & conform to new advice conventions
This commit does two things:

- Renames def-advice! to defadvice!, in the spirit of naming convenience
  macros after the function/macro they enhance or replace.
- Correct the names of advice functions to indicate visibility and
  intent. A public advice function like doom-set-jump-a is meant to be
  used elsewhere. A private one like +dired--cleanup-header-line-a
  shouldn't -- it likely won't work anywhere but the function(s) it was
  made to advise.
2019-07-23 17:24:56 +02:00
Henrik Lissner
76cacb5bfe
💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
Henrik Lissner
8e096f7a23
tools/direnv: conform to new hook conventions 2019-07-22 23:51:12 +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
9733db65d2
tools/direnv: fontify direnv stdlib keywords 2019-07-10 02:29:13 +02:00
Henrik Lissner
b6a469f13d
tools/direnv: update direnv on frame switch 2019-07-10 02:28:52 +02:00
Henrik Lissner
ef8cd55234
tools/direnv: fix direnv+flycheck integration
Also fixes direnv+flycheck for nix users by consulting direnv before
looking for flycheck executables.
2019-07-09 16:11:36 +02:00
Henrik Lissner
17bd6e43c6
tools/direnv: consult direnv less frequently
By checking on doom-switch-{buffer,window}-hook and focus-in-hook, which
fires a lot less often than post-command-hook.
2019-07-08 21:23:49 +02:00
Henrik Lissner
cb5abcea0e
Add tools/direnv module 2019-04-05 03:16:37 -04:00