There are two parts to this. First, process ANSI colors :
;; Stolen from (http://endlessparentheses.com/ansi-colors-in-the-compilation-buffer-output.html)
(defun endless/colorize-compilation ()
"Colorize from `compilation-filter-start' to `point'."
(let ((inhibit-read-only t))
That's a lot of questions, but I will try to answer them in such a way that you can look up all the answers in detail.
Emacs is primarily a text editor; you will use it to edit your C++ files. Converting those files into a program that your computer can run is the job of a compiler. There are many C++ compilers, but you will want to use one called gcc. ...
This behaviour can be controlled by compilation-scroll-output.
compilation-scroll-output is a variable defined in `compile.el'.
Its value is `first-error'
Original value was nil
Non-nil to scroll the *compilation* buffer window as output appears.
Setting it causes the Compilation mode commands to put point at the
end of their output window ...
If I understand your question correctly, the simplest solution that I have found is to set the variable directory-abbrev-alist to map directories in the compilation buffer to the host system.
For example I run my phpunit tests in a docker container as a compile command. When there are errors or failures the filepaths in the compilation buffer show up as /...
Know that you can use M-x compile to compile from within Emacs.
If you do that then, in your compilation output buffer, use C-h m to see information about the mode.
For example, it might tell you that the mode is compilation-mode and that C-c C-k is bound to command kill-compilation. Clicking that command name tells you:
Kill the process made by the M-x ...
fortran-mode-hook only runs for buffers that end up in fortran-mode. To affect which extensions are recognized as fortran, you can modify auto-mode-alist, eg
(add-to-list 'auto-mode-alist '("\\.f9" . fortran-mode))
As mentioned by @JeanPierre , the problem was because the location of gfortran was not added to the PATH environment variable for the emacs shell. Thus the shell did not know where to look to find the command. To do so (and to make the PATH environment readily available for editing) I added this code block into my initialisation file: ~/.emacs.d/init.el
I suggest you use M-x re-builder on the compilation errors buffer (or just a buffer containing the text you want to match).
If you start with this edited pattern:
You'll probably be able to figure it out from there?
I imagine something like the following might do the trick?
A variable called compilation-error-regexp-alist-alist (I will call c-e-r-a-a) is a list of (<name> <regexp> <list of regexp match numbers...>).
From the output of `M-x describe-variable compilation-error-regexp-alist':
Each elt has the form (REGEXP FILE [LINE COLUMN TYPE HYPERLINK
HIGHLIGHT...]). If REGEXP matches, the FILE’th ...
See the Emacs commands find-grep-dired and find-dired. They do pretty much what you are trying to do, I think. And they present the results in a Dired buffer, giving you all of the features of Dired.
(Library Dired+ (dired+.el) contains enhanced versions of these commands, and puts them in a Run find Command menu, along with some other find commands.)