Skip to main content
5 votes

How do you abort an emacs M-x compile compilation

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 ...
Drew's user avatar
  • 78k
4 votes
Accepted

Print elapsed time in compilation buffer

Amazing nobody's answered this yet, but I can't find an answer anywhere. Here's my solution: (make-variable-buffer-local 'my-compilation-start-time) (add-hook 'compilation-start-hook #'my-...
Alan Conway's user avatar
4 votes

How can I add a compilation error regex for node js?

Answer came in via twitter from hero @jscalterego https://twitter.com/cowboyd/status/778287337952247808 Apparently the problem is that in the re-builder, I was using "string" regex syntax vs "read" ...
Charles Lowell's user avatar
4 votes
Accepted

TTY allocation in *Compilation* buffer

After a kind hint from @rpluim, I wrote this in my .emacs : (defun plain-pipe-for-process () (setq-local process-connection-type nil)) (add-hook 'compilation-mode-hook 'plain-pipe-for-process) It ...
user26785's user avatar
  • 161
4 votes

How to see color output when compiling?

Not sure when it was added but nowdays you can simply do: (add-hook 'compilation-filter-hook 'ansi-color-compilation-filter)
VitoshKa's user avatar
  • 266
3 votes
Accepted

compilation-mode: default-directory != src-root

At first I give a recipe for reproduction of your problem (hopefully I understood it right). Afterwards I will present a solution. Recipe for problem reproduction Put the following C++ source code ...
Tobias's user avatar
  • 33.3k
3 votes
Accepted

Sudo caching on compilation mode

I suppose you are using Tramp's sudo method to run the command with root permissions from Emacs. With a very recent snapshot of Tramp 2.4.1-pre (or 27.0.50), there is a new configuration parameter to ...
Michael Albinus's user avatar
3 votes
Accepted

How to align grep output?

Here is the complete solution: (setcar (car grep-regexp-alist) "^\\(.+?\\)\\(:[ \t]*\\)\\([1-9][0-9]*\\)[ \t]*\\2") (defun eab/grep-align () (interactive) (read-only-mode -1) (toggle-...
artscan's user avatar
  • 445
3 votes
Accepted

A compilation-mode conundrum - matching and highlighting

I think this is what's going on: The shell command produces output and at the same time compile.el wants to put font-lock properties on it using a list of regexps. But how should it know, whether ...
politza's user avatar
  • 3,346
3 votes
Accepted

compilation sentinel: symbol's value as variable is void for quote, >, <, =, etc

You're missing parentheses around the interior of your cond expression. You also should not have the parentheses around the body forms of the condition (although this part is not what is causing your ...
D. Gillis's user avatar
  • 496
2 votes
Accepted

Emacs Compile Mode: Extra characters before filename result in bad match

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-...
Realraptor's user avatar
  • 1,293
2 votes
Accepted

Selecting an item in *compilation* buffer makes the item jump to the top

Without a left fringe, there is no place for emacs to show an arrow on the current row. In that case it scrolls down so that the buffer shows the current row on top instead. See here: If the *...
Gauthier's user avatar
  • 509
2 votes

Source-Links in Compilation mode not working

After some tinkering, I was able to trace the problem to emacs wrongly recognizing the column in the trace output as the line number. All I had to do was add a new regexp to compilation-error-regexp-...
DeX3's user avatar
  • 273
2 votes
Accepted

Simultaneously compiling two or more projects with Compilation Mode

From the documentation of the compile function: To run more than one compilation at once, start one then rename the ‘compilation’ buffer to some other name with M-x rename-buffer. Then switch ...
Jordon Biondo's user avatar
2 votes

Which regexp from compilation-error-regexp-alist is used by compilation-mode?

This is a bit of a pain to debug. In my version of compile.el you can set compilation-debug: (setq compilation-debug 't) Then if you call describe-text-properties the compilation-debug property then ...
Att Righ's user avatar
  • 775
2 votes

Skip over remaining errors in current file to next error in next file

It's a minor glitch/bug in the Emacs error interface, compilation-next-file only works (at least as of Emacs 25) if you are in the buffer showing the error messages, not in the source file with the ...
intel_chris's user avatar
2 votes

How to Run a Context Sensitive Compile?

did you try with .dir-locals.el file? something along the lines ((c++-mode . ((compile-command . "make -j 4") ;; other customisation )) ;; other modes )...
user5972998's user avatar
2 votes
Accepted

"not in compilation buffer" error using compilation-next-error in elisp function

Try the following: (defun write-first-error-to-file() "function copies first error in compilation buffer and writes it to specified file" (interactive) (let (beg) (set-buffer "...
NickD's user avatar
  • 30.8k
2 votes

is there a way to get two separate next-error lists so I can bind them to two different keys

Doing all the preparation to be able to do that is going to be more work than it is worth: you have to write special functions to use the buffer(s) of interest and then bind them to keys. I think it ...
NickD's user avatar
  • 30.8k
2 votes
Accepted

Compilation mode error output parse not matching

The LINE and COLUMN entries (2 and 3 in your code) refers to the subgroup of the regexp. Your regexp only contains two subgroups, so they should be 1 and 2. In addition, the first entry after the ...
Lindydancer's user avatar
  • 6,170
2 votes
Accepted

Delete or hide compilation buffer when finished compile and run process

The compile mode actually exposes a hook that runs after compilation finishes, called compilation-finish-functions. You can add your own hook to the compilation, and in that, just call the quit-...
cyberbisson's user avatar
2 votes

Overriding the compilation regex to match files and lines for a new tool

After trying various examples around the web that simply didn't work (with my emacs 29.1), here's what ended up working. To add a tool (ansible-lint), I added this to my .emacs: ;;; ansible-lint ; ...
Perdu's user avatar
  • 51
1 vote

How to Run a Context Sensitive Compile?

This is a solution which searches up the parent directories for common build system filenames, and runs the appropriate build-command. Posting here since it works, although better methods may exist. ...
ideasman42's user avatar
  • 8,846
1 vote

How to use `next-error` and `previous-error` without the compilation buffer visible

You say that for you next-error doesn't work unless the buffer with the "error" messages is visible (i.e., in a visible window). I don't see that. Can you repro the problem starting with emacs -Q (no ...
Drew's user avatar
  • 78k
1 vote
Accepted

Why in compilation-mode do my go (golang) compile errors not include the column on goto-error?

The compilation mode documentation says the following: To parse messages from the compiler, Compilation mode uses the variable compilation-error-regexp-alist which lists various error message ...
psanford's user avatar
  • 176
1 vote
Accepted

capture and replay a closure later

I was experimenting with the reader macros and I think I figured it out. The problem is that I am trying to evaluate, the let values twice. Once when they are first bound and then again when we rebind ...
Prgrm.celeritas's user avatar
1 vote
Accepted

Highlight compilation error in compilation mode buffer

From lawlist's comment (this works nicely in both terminal and GUI emacs -- I find the highlighting a lot easier to see at a glance than the little arrow fringe marker): (defun my/turn-on-hl-line-...
Croad Langshan's user avatar
1 vote

Which regexp from compilation-error-regexp-alist is used by compilation-mode?

It might be any number of the regexp that make up the compilation-error-regexp-alist. One idea would be to place a message in compilation-parse-errors after both of the while loops: (while (re-...
lawlist's user avatar
  • 19.2k
1 vote
Accepted

How to move the point to next link?

tldr; C-x ` Details Picking up the comment from Vladimir Panteleev you can find key bindings to next-error with C-h w next-error Further I suggest you bind the command repeat to a key (I have ...
Marco Wahl's user avatar
  • 2,886
1 vote

How to automatically select *interpretation* buffer window

Is there a robust way to automatically make this *interpretation* buffer current after it pops up, instead of having to type C-xo (other-window)? There are several ways of varying degree of hackiness ...
Basil's user avatar
  • 12.5k

Only top scored, non community-wiki answers of a minimum length are eligible