Compilation mode turns each error message in the buffer into a hyperlink; you can move point to it and type RET, or click on it with the mouse (see Mouse References), to visit the locus of the error message in a separate window.
Questions tagged [compilation-mode]
77 questions
18
votes
4 answers
Changing the compilation mode current directory automatically?
Currently, my compilation command is as follow:
cd ~/somedir && ./somescript.sh
This prevents emacs from finding the file in which an error happens (and opening it).
Of course I can run M-x cd manually but is there a way to tell the buffer to…

Thomas Moulard
- 391
- 3
- 11
9
votes
1 answer
Jumping to the first error -- not warning -- when compiling
The compilation-auto-jump-to-first-error option should make Emacs jump to the first error during compilation. However, it seems that Emacs treats warnings and errors in the same way, and jumps to the first one of either. How would you make Emacs…

Eleno
- 1,428
- 11
- 17
8
votes
1 answer
How can I detect compilation-mode is waiting for input
This often trips me up when building Linux kernels. I'll kick of a compile and after a while I realise it's not completed. What's usually happened is because the default config has changed it's waiting for user input in the compilation window. For…

stsquad
- 4,626
- 28
- 45
8
votes
1 answer
Read process output line by line
If there a way to read the output of a subprocess line by line, or at least to get it in small batches?
I have a subprocess doing work in the background, and printing a line every time it completes a task. There are many such small tasks, so I…

Clément
- 3,924
- 1
- 22
- 37
5
votes
2 answers
Which regexp from compilation-error-regexp-alist is used by compilation-mode?
I spent a while debugging the regex in compilation-error-regexp-alist only to find that the regex itself is fine. My current theory is that compilation-mode is just actually using a different regex instead.
The error message is: ERROR:…

Infiltrator
- 223
- 1
- 4
5
votes
2 answers
How can I add a compilation error regex for node js?
I can't seem to get emacs to recognize node stacktraces. As you can see, I've added what I think is a valid regular expression to compilation-error-regex-alist and compilation-error-regex-alist-alist, but it still does not match, and brings up the…

Charles Lowell
- 191
- 4
5
votes
1 answer
How can I recenter grep or compile window on next error
On next-error in the grep or compilation window, I can use something like
(setq next-error-recenter 35)
to ensure that window displaying the match scrolls to show the whole match, as described in more detail in this stackoverflow question.
How do I…

TooTone
- 401
- 4
- 11
5
votes
1 answer
How to highlight the compilation buffer?
I try to define a custom coloring of the compilation buffer, but I can not get the highlight correctly.
(add-to-list 'compilation-error-regexp-alist 'my-message)
(add-to-list 'compilation-error-regexp-alist-alist
'(my-message
…

ceving
- 1,308
- 1
- 14
- 28
3
votes
1 answer
Set variables based on path without using directory-local variables
I want to set variables, in particular, compile-command and tabbing related variables based on the path of the file I'm editing.
In my .vimrc I use the following to do this.
autocmd BufRead,BufNewFile */path/*.ext set tabbing-setting
autocmd…

Praxeolitic
- 387
- 2
- 9
3
votes
1 answer
is there a way to get two separate next-error lists so I can bind them to two different keys
I often have grep (technically rgrep) in a buffer/window and another buffer/window with a "compilation" of my active project in it. I would like to bind two different keys (e.g. f2 and f3) to next-error and next-grep-hit and have them be…

intel_chris
- 329
- 2
- 12
3
votes
1 answer
How do you abort an emacs M-x compile compilation
How do you abort an emacs M-x compile compilation?
I'm editing a bash file, and I "test execute it" by doing
M-x compile.
What I tried - googled:emacs abort compilation
The file I'm working on is like this
#!/bin/bash …

american-ninja-warrior
- 3,773
- 2
- 21
- 40
3
votes
1 answer
How to align grep output?
I use grep-mode for a set of files and wgrep (writable grep buffer) for editing them. The buffer usually looks like:
I want to find a way to change the view like this:
wgrep and compile-goto-error should work as usual.
Upd. It works for wgrep and…

artscan
- 445
- 2
- 12
3
votes
0 answers
Was compilation successful or not?
How do I find out if compilation was successful or not?
I would like to have a variable compilation-no-error set to true after successful compilation.
I looked at variables and functions starting with compilation-..., but I could not find a simple…

tom
- 283
- 1
- 7
3
votes
0 answers
show error message on its own line?
I'm using M-x compile to check for compilation errors and it's great. However, I'm wondering if I can get the actual error message to begin on its own line. For some reason the file path shows up as the absolute file path, which is unnecessary IMO…

Jorge Israel Peña
- 1,265
- 9
- 17
3
votes
2 answers
How to query-replace across all hits in a compilation-mode buffer
How can I run a query-replace on the all the files pointed to by an arbitrary compilation-mode buffer?
I think to be usable this would need to be resumable from point in the compilation-mode buffer.
Something very nearly exactly functionally…

Croad Langshan
- 3,192
- 14
- 42