comparison lisp/progmodes/compile.el @ 3514:7a3e241a2917

(compile-internal): Alter current buffer only temporarily.
author Richard M. Stallman <rms@gnu.org>
date Sun, 06 Jun 1993 05:28:30 +0000
parents 539e7c93f8fa
children 713c76a95b74
comparison
equal deleted inserted replaced
3513:8154b7ce787e 3514:7a3e241a2917
292 ;; of the buffer, so point will track the compilation output. 292 ;; of the buffer, so point will track the compilation output.
293 (if (eq outbuf (current-buffer)) 293 (if (eq outbuf (current-buffer))
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
330 (defvar compilation-minor-mode-map 331 (defvar compilation-minor-mode-map
331 (let ((map (make-sparse-keymap))) 332 (let ((map (make-sparse-keymap)))