(Emacs/config)~simplify compilation mode config
This commit is contained in:
@@ -2347,7 +2347,16 @@ description I give won't do it justice.
|
|||||||
(global-aggressive-indent-mode))
|
(global-aggressive-indent-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Compilation
|
** 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
|
#+begin_src emacs-lisp
|
||||||
(use-package compile
|
(use-package compile
|
||||||
:defer t
|
:defer t
|
||||||
@@ -2369,13 +2378,10 @@ Colourising the compilation buffer so ANSI colour codes get computed.
|
|||||||
(display-buffer-reuse-window display-buffer-at-bottom)
|
(display-buffer-reuse-window display-buffer-at-bottom)
|
||||||
(reusable-frames . t)
|
(reusable-frames . t)
|
||||||
(window-height . 0.25))
|
(window-height . 0.25))
|
||||||
|
:init
|
||||||
|
(setq compilation-scroll-output 'first-error)
|
||||||
:config
|
:config
|
||||||
(defun +compile/colourise ()
|
(add-hook 'compilation-filter-hook #'ansi-color-compilation-filter))
|
||||||
"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))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
** xref
|
** xref
|
||||||
Find definitions, references and general objects using tags without
|
Find definitions, references and general objects using tags without
|
||||||
|
|||||||
Reference in New Issue
Block a user