comparison lisp/progmodes/compile.el @ 11618:9702de178097

(compile-internal): Disable undo before erasing the buffer, then enable again afterward. (compilation-sentinel): Use force-mode-line-update.
author Richard M. Stallman <rms@gnu.org>
date Sat, 29 Apr 1995 16:37:06 +0000
parents 18c571c257aa
children 34dbef732b27
comparison
equal deleted inserted replaced
11617:9eaeed5c8a40 11618:9702de178097
359 ;; Clear out the compilation buffer and make it writable. 359 ;; Clear out the compilation buffer and make it writable.
360 ;; Change its default-directory to the directory where the compilation 360 ;; Change its default-directory to the directory where the compilation
361 ;; will happen, and insert a `cd' command to indicate this. 361 ;; will happen, and insert a `cd' command to indicate this.
362 (set-buffer outbuf) 362 (set-buffer outbuf)
363 (setq buffer-read-only nil) 363 (setq buffer-read-only nil)
364 (buffer-disable-undo (current-buffer))
364 (erase-buffer) 365 (erase-buffer)
366 (buffer-enable-undo (current-buffer))
365 (setq default-directory thisdir) 367 (setq default-directory thisdir)
366 (insert "cd " thisdir "\n" command "\n") 368 (insert "cd " thisdir "\n" command "\n")
367 (set-buffer-modified-p nil)) 369 (set-buffer-modified-p nil))
368 ;; If we're already in the compilation buffer, go to the end 370 ;; If we're already in the compilation buffer, go to the end
369 ;; of the buffer, so point will track the compilation output. 371 ;; of the buffer, so point will track the compilation output.
372 ;; Pop up the compilation buffer. 374 ;; Pop up the compilation buffer.
373 (setq outwin (display-buffer outbuf)) 375 (setq outwin (display-buffer outbuf))
374 (save-excursion 376 (save-excursion
375 (set-buffer outbuf) 377 (set-buffer outbuf)
376 (compilation-mode) 378 (compilation-mode)
377 (buffer-disable-undo (current-buffer))
378 ;; (setq buffer-read-only t) ;;; Non-ergonomic. 379 ;; (setq buffer-read-only t) ;;; Non-ergonomic.
379 (set (make-local-variable 'compilation-parse-errors-function) parser) 380 (set (make-local-variable 'compilation-parse-errors-function) parser)
380 (set (make-local-variable 'compilation-error-message) error-message) 381 (set (make-local-variable 'compilation-error-message) error-message)
381 (set (make-local-variable 'compilation-error-regexp-alist) regexp-alist) 382 (set (make-local-variable 'compilation-error-regexp-alist) regexp-alist)
382 (setq default-directory thisdir 383 (setq default-directory thisdir
553 ;; Since the buffer and mode line will show that the 554 ;; Since the buffer and mode line will show that the
554 ;; process is dead, we can delete it now. Otherwise it 555 ;; process is dead, we can delete it now. Otherwise it
555 ;; will stay around until M-x list-processes. 556 ;; will stay around until M-x list-processes.
556 (delete-process proc) 557 (delete-process proc)
557 ;; Force mode line redisplay soon. 558 ;; Force mode line redisplay soon.
558 (set-buffer-modified-p (buffer-modified-p))) 559 (force-mode-line-update))
559 (if (and opoint (< opoint omax)) 560 (if (and opoint (< opoint omax))
560 (goto-char opoint)) 561 (goto-char opoint))
561 (if compilation-finish-function 562 (if compilation-finish-function
562 (funcall compilation-finish-function buffer msg))) 563 (funcall compilation-finish-function buffer msg)))
563 (set-buffer obuf)))) 564 (set-buffer obuf))))