diff options
author | Leo Liu <sdl.web@gmail.com> | 2013-11-19 10:34:04 +0800 |
---|---|---|
committer | Leo Liu <sdl.web@gmail.com> | 2013-11-19 10:34:04 +0800 |
commit | f130cb76b8ebe4f57c764064122d06f525a65d22 (patch) | |
tree | 1f2a560bb144d6137abb8963917d03161f9feb99 /lisp/progmodes/compile.el | |
parent | 8d1c3af987154197ea2cbe0bbc3eb42c9466e2e9 (diff) | |
download | emacs-f130cb76b8ebe4f57c764064122d06f525a65d22.tar.gz |
* window.el (display-buffer-alist, display-buffer): Document the
new parameter no-display-ok.
* progmodes/compile.el (compilation-start)
(compilation-goto-locus, compilation-find-file): Pass
no-display-ok and handle nil value from display-buffer.
Fixes: debbugs:13594
Diffstat (limited to 'lisp/progmodes/compile.el')
-rw-r--r-- | lisp/progmodes/compile.el | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 54f03728524..58f14f68658 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1632,7 +1632,7 @@ Returns the compilation buffer created." (set-buffer-modified-p nil)) ;; Pop up the compilation buffer. ;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01638.html - (setq outwin (display-buffer outbuf)) + (setq outwin (display-buffer outbuf '(nil (no-display-ok . t)))) (with-current-buffer outbuf (let ((process-environment (append @@ -1654,7 +1654,7 @@ Returns the compilation buffer created." (list command mode name-function highlight-regexp)) (set (make-local-variable 'revert-buffer-function) 'compilation-revert-buffer) - (set-window-start outwin (point-min)) + (and outwin (set-window-start outwin (point-min))) ;; Position point as the user will see it. (let ((desired-visible-point @@ -1663,15 +1663,15 @@ Returns the compilation buffer created." (point-max) ;; Normally put it at the top. (point-min)))) - (if (eq outwin (selected-window)) - (goto-char desired-visible-point) + (goto-char desired-visible-point) + (when (and outwin (not (eq outwin (selected-window)))) (set-window-point outwin desired-visible-point))) ;; The setup function is called before compilation-set-window-height ;; so it can set the compilation-window-height buffer locally. (if compilation-process-setup-function (funcall compilation-process-setup-function)) - (compilation-set-window-height outwin) + (and outwin (compilation-set-window-height outwin)) ;; Start the compilation. (if (fboundp 'start-process) (let ((proc @@ -2513,14 +2513,16 @@ and overlay is highlighted between MK and END-MK." ;; the error location if the two buffers are in two ;; different frames. So don't do it if it's not necessary. pre-existing - (display-buffer (marker-buffer msg)))) + (display-buffer (marker-buffer msg) '(nil (no-display-ok . t))))) (highlight-regexp (with-current-buffer (marker-buffer msg) ;; also do this while we change buffer - (compilation-set-window w msg) + (goto-char (marker-position msg)) + (and w (compilation-set-window w msg)) compilation-highlight-regexp))) ;; Ideally, the window-size should be passed to `display-buffer' ;; so it's only used when creating a new window. - (unless pre-existing (compilation-set-window-height w)) + (when (and (not pre-existing) w) + (compilation-set-window-height w)) (if from-compilation-buffer ;; If the compilation buffer window was selected, @@ -2631,9 +2633,12 @@ attempts to find a file whose name is produced by (format FMT FILENAME)." (while (null buffer) ;Repeat until the user selects an existing file. ;; The file doesn't exist. Ask the user where to find it. (save-excursion ;This save-excursion is probably not right. - (let ((pop-up-windows t)) - (compilation-set-window (display-buffer (marker-buffer marker)) - marker) + (let ((w (let ((pop-up-windows t)) + (display-buffer (marker-buffer marker) + '(nil (no-display-ok . t)))))) + (with-current-buffer (marker-buffer marker) + (goto-char marker) + (and w (compilation-set-window w marker))) (let* ((name (read-file-name (format "Find this %s in (default %s): " compilation-error filename) |