Skip to content

Commit 820e526

Browse files
committed
borg-compile: Account for native-compile's return value
It returns the filename, not t, on success. In case of failure it does not return and signals an error instead, but we now wrap that function so that we can increase the failure count.
1 parent 14806e5 commit 820e526

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

borg.el

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,9 @@ then also activate the clone using `borg-activate'."
537537
(setq borg-compile-function
538538
(if (functionp borg--compile-natively)
539539
borg--compile-natively
540-
'native-compile)))
540+
#'borg--native-compile)))
541+
(when (eq borg-compile-function #'native-compile)
542+
(setq borg-compile-function #'borg--native-compile))
541543
(if build
542544
(dolist (cmd build)
543545
(message " Running `%s'..." cmd)
@@ -746,8 +748,9 @@ then also activate the clone using `borg-activate'."
746748
('no-byte-compile
747749
(message "Compiling %s...skipped" file)
748750
skip-count)
749-
('t file-count)
750-
(_ fail-count))))
751+
((or 't (pred stringp))
752+
file-count)
753+
(_ fail-count))))
751754
(unless (equal dir last-dir)
752755
(setq last-dir dir)
753756
(cl-incf dir-count))))))))
@@ -792,6 +795,10 @@ then also activate the clone using `borg-activate'."
792795
t))
793796
(ignore-errors (delete-file file))))))
794797

798+
(defun borg--native-compile (file)
799+
(with-demoted-errors "borg--native-compile: %S"
800+
(native-compile file)))
801+
795802
;;; Assimilation
796803

797804
(defun borg-assimilate (package url &optional partially)

0 commit comments

Comments
 (0)