This is what I wrote to take care of the problem for me.  I've had to
change it every now and then over the years with new versions of
Emacs:

;; Slight change on jde-compile-finish-kill-buffer so that the window is not
;; killed when I have more than one open, and resizes when I do.
(defvar my-one-window-before-compile nil)
(defvar my-window-height-before-compile nil)
(defun my-jde-compile-finish-kill-buffer (buf msg)
 "Removes the jde-compile window after a few seconds if no errors."
 (save-excursion
   (set-buffer buf)
   (if (null (or (string-match ".*exited abnormally.*" msg)
                 (string-match ".*BUILD FAILED.*" (buffer-string))))
       ;;no errors, make the compilation window go away in a few seconds
       (progn
         (if (equal my-one-window-before-compile t)
             (run-at-time
              "1 sec" nil 'delete-windows-on
              (get-buffer-create "*compilation*"))
           (progn
             (let ((buffer (get-buffer-create "*compilation*")))
               (set-window-text-height
                (car (get-buffer-window-list buffer))
                (- my-window-height-before-compile 1))
               (run-at-time
                "1 sec" nil 'kill-buffer
                buffer))))
           (message "No compilation errors"))
     ;;there were errors, so jump to the first error
     (next-error))))

(defadvice jde-compile (before set-compile-options activate)
 (setq my-one-window-before-compile (one-window-p t))
 (setq my-window-height-before-compile (window-height (next-window))))


On Apr 6, 2005 5:24 PM, Jeff Peck <[EMAIL PROTECTED]> wrote:
> Your fix will help; it enables one to unset jde-compile-enable-kill-buffer
> to avoid the killing of the window.
> However; what I want (and i suspect other's do as well), is to kill the
> buffer,
> but: Leave the window in place!
> 
> That way, when i have two edit windows, and compile in one window,
> the compile results will show briefly in the second window, and then
> (when all goes well) that second window will revert to the previously
> visible buffer!
> 
> That way you do it, compile will either:
>    a) leave the compile output showing where the second edit window was
>    b) close the second edit window.
> Neither of which is my expectation/intent.
> 
> If everyone else only expects one window per frame, and really wants to
> close
> the second/temporary compile output window, then maybe we should
> make creative use of save-window-excursion, to restore the configuration?
> 
> 
> >  > (defun jde-compile-kill-buffer (buf)
> >  >   (kill-buffer buf))
> >  >
> 
>

Reply via email to