summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-04-09 05:32:47 +0000
committerRichard M. Stallman <rms@gnu.org>1995-04-09 05:32:47 +0000
commit144b26379606157e4ff43e1505acb2552605feb9 (patch)
tree4e114a4876e35a69cd12a81695e5b35efb593d7f /lisp/emacs-lisp/bytecomp.el
parent434b8757772cb87f990a817524adef1538777e38 (diff)
downloademacs-144b26379606157e4ff43e1505acb2552605feb9.tar.gz
emacs-144b26379606157e4ff43e1505acb2552605feb9.tar.bz2
emacs-144b26379606157e4ff43e1505acb2552605feb9.zip
(byte-compile-log-file): New function.
(displaying-byte-compile-warnings): Log the file name at start; display the log buffer only if something more gets output by BODY. (byte-compile-warnings-point-max): Initialize to nil.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el33
1 files changed, 26 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 230790c8631..2bad3a7a863 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -724,6 +724,8 @@ otherwise pop it")
(defconst byte-compile-last-warned-form nil)
+;; Log a message STRING in *Compile-Log*.
+;; Also log the current function and file if not already done.
(defun byte-compile-log-1 (string &optional fill)
(cond (noninteractive
(if (or byte-compile-current-file
@@ -768,6 +770,19 @@ otherwise pop it")
(setq byte-compile-current-file nil
byte-compile-last-warned-form byte-compile-current-form))
+;; Log the start of a file in *Compile-Log*, and mark it as done.
+;; But do nothing in batch mode.
+(defun byte-compile-log-file ()
+ (and byte-compile-current-file (not noninteractive)
+ (save-excursion
+ (set-buffer (get-buffer-create "*Compile-Log*"))
+ (insert "\n\^L\nCompiling "
+ (if (stringp byte-compile-current-file)
+ (concat "file " byte-compile-current-file)
+ (concat "buffer " (buffer-name byte-compile-current-file)))
+ " at " (current-time-string) "\n")
+ (setq byte-compile-current-file nil))))
+
(defun byte-compile-warn (format &rest args)
(setq format (apply 'format format args))
(if byte-compile-error-on-warn
@@ -1059,15 +1074,19 @@ otherwise pop it")
)
body)))
-(defvar byte-compile-warnings-point-max)
+(defvar byte-compile-warnings-point-max nil)
(defmacro displaying-byte-compile-warnings (&rest body)
(list 'let
- '((byte-compile-warnings-point-max
- (if (boundp 'byte-compile-warnings-point-max)
- byte-compile-warnings-point-max
- (save-excursion
- (set-buffer (get-buffer-create "*Compile-Log*"))
- (point-max)))))
+ '((byte-compile-warnings-point-max byte-compile-warnings-point-max))
+ ;; Log the file name.
+ '(byte-compile-log-file)
+ ;; Record how much is logged now.
+ ;; We will display the log buffer if anything more is logged
+ ;; before the end of BODY.
+ '(or byte-compile-warnings-point-max
+ (save-excursion
+ (set-buffer (get-buffer-create "*Compile-Log*"))
+ (setq byte-compile-warnings-point-max (point-max))))
(list 'unwind-protect
(list 'condition-case 'error-info
(cons 'progn body)