aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-08-08 09:02:40 +0000
committerRichard M. Stallman1994-08-08 09:02:40 +0000
commitc94b02d6f742063b6b19f8142e88e9da4b52939e (patch)
tree9482070464e56f8b15f95713b059f36dc0d939d1
parent2f3179987f81afcbefe99860d451b0c529d7cc32 (diff)
downloademacs-c94b02d6f742063b6b19f8142e88e9da4b52939e.tar.gz
emacs-c94b02d6f742063b6b19f8142e88e9da4b52939e.zip
(compilation-set-window-height): New function,
broken out from compile-internal. Don't change window height if it is the frame root window. (compile-internal): Call it. (compilation-goto-locus): Call it. Use any visible frame already showing the compilation buffer.
-rw-r--r--lisp/progmodes/compile.el31
1 files changed, 20 insertions, 11 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 300186619a5..7ecc68aa5be 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -380,15 +380,7 @@ Returns the compilation buffer created."
380 (setq mode-name name-of-mode) 380 (setq mode-name name-of-mode)
381 (or (eq outwin (selected-window)) 381 (or (eq outwin (selected-window))
382 (set-window-point outwin (point-min))) 382 (set-window-point outwin (point-min)))
383 (and compilation-window-height 383 (compilation-set-window-height outwin)
384 (= (window-width outwin) (frame-width))
385 (let ((w (selected-window)))
386 (unwind-protect
387 (progn
388 (select-window outwin)
389 (enlarge-window (- compilation-window-height
390 (window-height))))
391 (select-window w))))
392 ;; Start the compilation. 384 ;; Start the compilation.
393 (if (fboundp 'start-process) 385 (if (fboundp 'start-process)
394 (let ((proc (start-process-shell-command (downcase mode-name) 386 (let ((proc (start-process-shell-command (downcase mode-name)
@@ -407,6 +399,21 @@ Returns the compilation buffer created."
407 ;; Make it so the next C-x ` will use this buffer. 399 ;; Make it so the next C-x ` will use this buffer.
408 (setq compilation-last-buffer outbuf))) 400 (setq compilation-last-buffer outbuf)))
409 401
402;; Set the height of WINDOW according to compilation-window-height.
403(defun compilation-set-window-height (window)
404 (and compilation-window-height
405 (= (window-width window) (frame-width (window-frame window)))
406 ;; If window is alone in its frame, aside from a minibuffer,
407 ;; don't change its height.
408 (not (eq window (frame-root-window (window-frame window))))
409 (let ((w (selected-window)))
410 (unwind-protect
411 (progn
412 (select-window window)
413 (enlarge-window (- compilation-window-height
414 (window-height))))
415 (select-window w)))))
416
410(defvar compilation-minor-mode-map 417(defvar compilation-minor-mode-map
411 (let ((map (make-sparse-keymap))) 418 (let ((map (make-sparse-keymap)))
412 (define-key map [mouse-2] 'compile-mouse-goto-error) 419 (define-key map [mouse-2] 'compile-mouse-goto-error)
@@ -1044,9 +1051,11 @@ Selects a window with point at SOURCE, with another window displaying ERROR."
1044 1051
1045 ;; Show compilation buffer in other window, scrolled to this error. 1052 ;; Show compilation buffer in other window, scrolled to this error.
1046 (let* ((pop-up-windows t) 1053 (let* ((pop-up-windows t)
1047 (w (display-buffer (marker-buffer (car next-error))))) 1054 (w (or (get-buffer-window (marker-buffer (car next-error)) 'visible)
1055 (display-buffer (marker-buffer (car next-error))))))
1048 (set-window-point w (car next-error)) 1056 (set-window-point w (car next-error))
1049 (set-window-start w (car next-error)))) 1057 (set-window-start w (car next-error))
1058 (compilation-set-window-height w)))
1050 1059
1051;; Find a buffer for file FILENAME. 1060;; Find a buffer for file FILENAME.
1052;; Search the directories in compilation-search-path. 1061;; Search the directories in compilation-search-path.