diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-08-15 12:48:27 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-08-15 12:48:27 +0200 |
commit | 5213a6674b0546e5d2d5899f8a06d8e54b3b93bc (patch) | |
tree | 894222c115477c2b8ffde8a0c03f5721772879d7 /.config | |
parent | 0d331c1e704c39386a306a9ed06602b3dee88d8e (diff) |
emacs: Auto-kill successful compilation buffers
Diffstat (limited to '.config')
-rw-r--r-- | .config/emacs/config.org | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.config/emacs/config.org b/.config/emacs/config.org index 13647ee..31c3250 100644 --- a/.config/emacs/config.org +++ b/.config/emacs/config.org @@ -705,6 +705,23 @@ This mode is super useful for writing HTML. It lets me expand something like #+END_SRC +*** Compilation Buffer + +Emacs allows you to compile your project with =C-x p c= which is cool and all, +but it annoyingly creates a compilation buffer that I need to manually close +every time. I would like to have this buffer, but only when things go wrong. + +#+BEGIN_SRC elisp + + (add-hook 'compilation-finish-functions + (lambda (buffer _) + (with-current-buffer buffer + (unless (or (> compilation-num-warnings-found 0) + (> compilation-num-errors-found 0)) + (kill-buffer buffer))))) + +#+END_SRC + ** User Interface The default Emacs UI is fucking atrocious — we need to make it better. |