Skip to content

Commit 5abf94c

Browse files
Fix message in callbacks
1 parent b8308c7 commit 5abf94c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

async-bytecomp.el

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ all packages are always compiled asynchronously."
6060
(defvar async-bytecomp-load-variable-regexp "\\`load-path\\'"
6161
"The variable used by `async-inject-variables' when (re)compiling async.")
6262

63-
(defun async-bytecomp--file-to-comp-buffer (file-or-dir &optional quiet)
64-
(let ((bn (file-name-nondirectory file-or-dir)))
63+
(defun async-bytecomp--file-to-comp-buffer (file-or-dir &optional quiet type)
64+
(let ((bn (file-name-nondirectory file-or-dir))
65+
(action-name (pcase type
66+
('file "File")
67+
('directory "Directory"))))
6568
(if (file-exists-p async-byte-compile-log-file)
6669
(let ((buf (get-buffer-create byte-compile-log-buffer))
6770
(n 0))
@@ -79,10 +82,10 @@ all packages are always compiled asynchronously."
7982
(cl-incf n)))
8083
(if (> n 0)
8184
(message "Failed to compile %d files in directory `%s'" n bn)
82-
(message "Directory `%s' compiled asynchronously with warnings"
83-
bn)))))
85+
(message "%s `%s' compiled asynchronously with warnings"
86+
action-name bn)))))
8487
(unless quiet
85-
(message "Directory `%s' compiled asynchronously with success" bn)))))
88+
(message "%s `%s' compiled asynchronously with success" action-name bn)))))
8689

8790
;;;###autoload
8891
(defun async-byte-recompile-directory (directory &optional quiet)
@@ -97,7 +100,7 @@ All *.elc files are systematically deleted before proceeding."
97100
(load "async")
98101
(let ((call-back
99102
(lambda (&optional _ignore)
100-
(async-bytecomp--file-to-comp-buffer directory quiet))))
103+
(async-bytecomp--file-to-comp-buffer directory quiet 'directory))))
101104
(async-start
102105
`(lambda ()
103106
(require 'bytecomp)
@@ -175,7 +178,7 @@ Same as `byte-compile-file' but asynchronous."
175178
(interactive "fFile: ")
176179
(let ((call-back
177180
(lambda (&optional _ignore)
178-
(async-bytecomp--file-to-comp-buffer file))))
181+
(async-bytecomp--file-to-comp-buffer file nil 'file))))
179182
(async-start
180183
`(lambda ()
181184
(require 'bytecomp)

0 commit comments

Comments
 (0)