37
37
; ;
38
38
; ;; Core
39
39
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 ))))
42
50
43
51
(defun eask-compile--print-log ()
44
52
" 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
47
55
(if (and (eask-clean-p) (eask-strict-p))
48
56
(eask-error (buffer-string )) ; Exit with error code!
49
57
(eask-print-log-buffer))
@@ -85,14 +93,14 @@ The CMD is the command to start a new Emacs session."
85
93
(content (eask-compile--byte-compile-file-external-content filename cmd)))
86
94
(if (string-empty-p content)
87
95
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)
89
97
(insert content)))))
90
98
91
99
(defun eask-compile--byte-compile-file (filename )
92
100
" Byte compile FILENAME."
93
101
; ; *Compile-Log* does not kill itself. Make sure it's clean before we do
94
102
; ; next byte-compile task.
95
- (ignore-errors (kill-buffer eask -compile-- log-buffer-name ))
103
+ (ignore-errors (kill-buffer byte -compile-log-buffer))
96
104
(let* ((filename (expand-file-name filename))
97
105
(result))
98
106
(eask-with-progress
@@ -102,7 +110,7 @@ The CMD is the command to start a new Emacs session."
102
110
(eask-compile--byte-compile-file-external filename)
103
111
(byte-compile-file filename))
104
112
result (eq result t )))
105
- (if result " done ✓" " skipped ✗" ))
113
+ (unless byte-compile-verbose ( if result " done ✓" " skipped ✗" ) ))
106
114
(eask-compile--print-log)
107
115
result))
108
116
@@ -112,7 +120,7 @@ The CMD is the command to start a new Emacs session."
112
120
(compiled (length compiled))
113
121
(skipped (- (length files ) compiled)))
114
122
; ; 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)
116
124
(eask-msg " " ))
117
125
(eask-info " (Total of %s file%s compiled, %s skipped)" compiled
118
126
(eask--sinr compiled " " " s" )
0 commit comments