[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Display compilation buffer only if compilation failed
From: |
Drew Adams |
Subject: |
RE: Display compilation buffer only if compilation failed |
Date: |
Sat, 11 Feb 2012 09:29:35 -0800 |
> (defun my-recompile-switch-if-error ()
> (interactive)
> (let ((buf (save-window-excursion ; prevent display-buffer
> (recompile)))) ; returns compilation buffer
After displaying it, AFAICT.
> (when (not (my-compile-success-p buf))
> (display-buffer buf))))
>
> But it doesn't work...
AFAICT, `recompile' invokes `compilation-start', which calls `display-buffer' on
the output buffer.
The doc string of `compilation-start' does not explicitly say that it displays
the buffer. It probably should. The first line should probably state that it
runs compilation command COMMAND _and displays the output_. Some subsequent
doc-string line can bother to mention "(low-level interface)", if that is really
helpful/important.
Consider reporting a doc bug: `M-x report-emacs-bug'.