From bab2d5d01955fb8c4f4d2ab65e3ad196c5a61815 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 13 Jun 2024 00:57:28 +0100 Subject: (Emacs/config)~simplify compilation mode config --- Emacs/.config/emacs/config.org | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'Emacs/.config/emacs') diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index aab3c56..a9829c2 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -2347,7 +2347,16 @@ description I give won't do it justice. (global-aggressive-indent-mode)) #+end_src ** Compilation -Colourising the compilation buffer so ANSI colour codes get computed. +Compilation mode, a super useful subsystem of Emacs which allows one +to run arbitrary commands. If those commands produce errors, +particularly errors that have a filename, column and line, +compilation-mode can colourise them and automatically help you +navigate to them. Very nifty. + +Here I add some bindings and a filter which colourises the output of +compilation mode for ANSI escape sequences; eyecandy is certainly nice +but it's just useful when dealing with tools that use those codes so +you can actually read the text. #+begin_src emacs-lisp (use-package compile :defer t @@ -2369,13 +2378,10 @@ Colourising the compilation buffer so ANSI colour codes get computed. (display-buffer-reuse-window display-buffer-at-bottom) (reusable-frames . t) (window-height . 0.25)) + :init + (setq compilation-scroll-output 'first-error) :config - (defun +compile/colourise () - "Colourise the emacs compilation buffer." - (interactive) - (let ((inhibit-read-only t)) - (ansi-color-apply-on-region (point-min) (point-max)))) - (add-hook 'compilation-filter-hook #'+compile/colourise)) + (add-hook 'compilation-filter-hook #'ansi-color-compilation-filter)) #+end_src ** xref Find definitions, references and general objects using tags without -- cgit v1.2.3-13-gbd6f