diff options
| author | Richard M. Stallman | 1993-06-06 05:28:30 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-06 05:28:30 +0000 |
| commit | d4ece6796d81a6b36877528c91d38fb31c1982be (patch) | |
| tree | b6aa761ab0e12bbae927cb9b2e6612943b375af1 | |
| parent | 0dda084273185683b0c1001852ba41a821f6b78c (diff) | |
| download | emacs-d4ece6796d81a6b36877528c91d38fb31c1982be.tar.gz emacs-d4ece6796d81a6b36877528c91d38fb31c1982be.zip | |
(compile-internal): Alter current buffer only temporarily.
| -rw-r--r-- | lisp/progmodes/compile.el | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 88bf0e911cb..0ddb1fb3196 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -294,36 +294,37 @@ Returns the compilation buffer created." | |||
| 294 | (goto-char (point-max))) | 294 | (goto-char (point-max))) |
| 295 | ;; Pop up the compilation buffer. | 295 | ;; Pop up the compilation buffer. |
| 296 | (setq outwin (display-buffer outbuf)) | 296 | (setq outwin (display-buffer outbuf)) |
| 297 | (set-buffer outbuf) | 297 | (save-excursion |
| 298 | (compilation-mode) | 298 | (set-buffer outbuf) |
| 299 | (buffer-disable-undo (current-buffer)) | 299 | (compilation-mode) |
| 300 | (setq buffer-read-only t) | 300 | (buffer-disable-undo (current-buffer)) |
| 301 | (set (make-local-variable 'compilation-parse-errors-function) parser) | 301 | (setq buffer-read-only t) |
| 302 | (set (make-local-variable 'compilation-error-message) error-message) | 302 | (set (make-local-variable 'compilation-parse-errors-function) parser) |
| 303 | (set (make-local-variable 'compilation-error-regexp-alist) regexp-alist) | 303 | (set (make-local-variable 'compilation-error-message) error-message) |
| 304 | (setq default-directory thisdir | 304 | (set (make-local-variable 'compilation-error-regexp-alist) regexp-alist) |
| 305 | compilation-directory-stack (list default-directory)) | 305 | (setq default-directory thisdir |
| 306 | (set-window-start outwin (point-min)) | 306 | compilation-directory-stack (list default-directory)) |
| 307 | (setq mode-name name-of-mode) | 307 | (set-window-start outwin (point-min)) |
| 308 | (or (eq outwin (selected-window)) | 308 | (setq mode-name name-of-mode) |
| 309 | (set-window-point outwin (point-min))) | 309 | (or (eq outwin (selected-window)) |
| 310 | (and compilation-window-height | 310 | (set-window-point outwin (point-min))) |
| 311 | (= (window-width outwin) (frame-width)) | 311 | (and compilation-window-height |
| 312 | (let ((w (selected-window))) | 312 | (= (window-width outwin) (frame-width)) |
| 313 | (unwind-protect | 313 | (let ((w (selected-window))) |
| 314 | (progn | 314 | (unwind-protect |
| 315 | (select-window outwin) | 315 | (progn |
| 316 | (enlarge-window (- compilation-window-height | 316 | (select-window outwin) |
| 317 | (window-height)))) | 317 | (enlarge-window (- compilation-window-height |
| 318 | (select-window w)))) | 318 | (window-height)))) |
| 319 | ;; Start the compilation. | 319 | (select-window w)))) |
| 320 | (let ((proc (start-process-shell-command (downcase mode-name) | 320 | ;; Start the compilation. |
| 321 | outbuf | 321 | (let ((proc (start-process-shell-command (downcase mode-name) |
| 322 | command))) | 322 | outbuf |
| 323 | (set-process-sentinel proc 'compilation-sentinel) | 323 | command))) |
| 324 | (set-process-filter proc 'compilation-filter) | 324 | (set-process-sentinel proc 'compilation-sentinel) |
| 325 | (set-marker (process-mark proc) (point) outbuf) | 325 | (set-process-filter proc 'compilation-filter) |
| 326 | (setq compilation-in-progress (cons proc compilation-in-progress)))) | 326 | (set-marker (process-mark proc) (point) outbuf) |
| 327 | (setq compilation-in-progress (cons proc compilation-in-progress))))) | ||
| 327 | ;; Make it so the next C-x ` will use this buffer. | 328 | ;; Make it so the next C-x ` will use this buffer. |
| 328 | (setq compilation-last-buffer outbuf))) | 329 | (setq compilation-last-buffer outbuf))) |
| 329 | 330 | ||