How to setup emacs so that I can browse through previous-compilation errors during new compilation?
Two things don't work for me:
M-g M-g (next-error) function is not working when second compilation is in-progress.
I have my emacs split into 5 uneven windows (split-windows-horizontally), the compilation "window" is double the size (dbl monitor setup). When I launch compilation it always appeared in the last double compilation window. Now it opens a new window for itself.
Compilation Errors Compilation is where your high-level language converts into a lower-level language that the computer can understand better. A compilation or compile-time error happens when the compiler doesn't know how to turn your code into the lower-level code.
Most frequent Compile-Time errors are: Missing Parenthesis (}) Printing the value of variable without declaring it. Missing semicolon (terminator)
Putting the following in your init file will rename the compilation buffer to *compilation-old*
when the compile command terminates.
Please note that this will not work if you run the new compilation process from the old compilation buffer (since compile
will in this case reuse the buffer instead of creating a new one)
(defun my-rename-compilation-buffer (buffer message)
;; Don't do anything if we are in a derived mode
(when (with-current-buffer buffer (eq major-mode 'compilation-mode))
(let* ((old-compilation-buffer-name "*compilation-old*")
(old-compilation-buffer (get-buffer old-compilation-buffer-name)))
;; Kill old compilation buffer if necessary
(when old-compilation-buffer
(kill-buffer old-compilation-buffer))
;; Rename the current compilation buffer
(with-current-buffer buffer
(rename-buffer old-compilation-buffer-name)))))
(add-hook 'compilation-finish-functions 'my-rename-compilation-buffer)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With