3737; ;
3838; ;; Core
3939
40- (defconst eask-compile--log-buffer-name " *Compile-Log*"
41- " Byte-compile log buffer name." )
40+ (require 'bytecomp )
41+
42+ ; ; XXX: The function `byte-compile-warn' last modified is 2015;
43+ ; ; I'll say it's safe to override this function.
44+ (advice-add 'byte-compile-warn :override
45+ (lambda (format &rest args )
46+ (setq format (apply #'format-message format args))
47+ (byte-compile-log-warning format t (if byte-compile-error-on-warn
48+ :error
49+ :warning ))))
4250
4351(defun eask-compile--print-log ()
4452 " Print `*Compile-Log*' buffer."
45- (when (get-buffer eask -compile-- log-buffer-name )
46- (with-current-buffer eask -compile-- log-buffer-name
53+ (when (get-buffer byte -compile-log-buffer)
54+ (with-current-buffer byte -compile-log-buffer
4755 (if (and (eask-clean-p) (eask-strict-p))
4856 (eask-error (buffer-string )) ; Exit with error code!
4957 (eask-print-log-buffer))
@@ -85,14 +93,14 @@ The CMD is the command to start a new Emacs session."
8593 (content (eask-compile--byte-compile-file-external-content filename cmd)))
8694 (if (string-empty-p content)
8795 t ; no error, good!
88- (with-current-buffer (get-buffer-create eask -compile-- log-buffer-name )
96+ (with-current-buffer (get-buffer-create byte -compile-log-buffer)
8997 (insert content)))))
9098
9199(defun eask-compile--byte-compile-file (filename )
92100 " Byte compile FILENAME."
93101 ; ; *Compile-Log* does not kill itself. Make sure it's clean before we do
94102 ; ; next byte-compile task.
95- (ignore-errors (kill-buffer eask -compile-- log-buffer-name ))
103+ (ignore-errors (kill-buffer byte -compile-log-buffer))
96104 (let* ((filename (expand-file-name filename))
97105 (result))
98106 (eask-with-progress
@@ -102,7 +110,7 @@ The CMD is the command to start a new Emacs session."
102110 (eask-compile--byte-compile-file-external filename)
103111 (byte-compile-file filename))
104112 result (eq result t )))
105- (if result " done ✓" " skipped ✗" ))
113+ (unless byte-compile-verbose ( if result " done ✓" " skipped ✗" ) ))
106114 (eask-compile--print-log)
107115 result))
108116
@@ -112,7 +120,7 @@ The CMD is the command to start a new Emacs session."
112120 (compiled (length compiled))
113121 (skipped (- (length files ) compiled)))
114122 ; ; XXX: Avoid last newline from the log buffer!
115- (unless (get-buffer eask -compile-- log-buffer-name )
123+ (unless (get-buffer byte -compile-log-buffer)
116124 (eask-msg " " ))
117125 (eask-info " (Total of %s file%s compiled, %s skipped)" compiled
118126 (eask--sinr compiled " " " s" )
0 commit comments