From 1ec7499e59a8724cb9f3d8688a7c922acad3be27 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 3 May 2020 13:37:38 +0100 Subject: [PATCH] * Add a warning for missing write privilege * lisp/emacs-lisp/comp.el (native-compile-async): Check for write privilege and raise a warning in case. --- lisp/emacs-lisp/comp.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index f027bad65cf..bd4c25a1f57 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2344,7 +2344,16 @@ queued with LOAD %" file load (cdr entry)) ;; Make sure we are not already compiling `file' (bug#40838). (unless (gethash file comp-async-compilations) - (setf comp-files-queue (append comp-files-queue `((,file . ,load))))))) + (let ((out-dir (comp-output-directory file)) + (out-filename (comp-output-filename file))) + (if (or (file-writable-p out-filename) + (and (not (file-exists-p out-dir)) + (file-writable-p (substring out-dir 0 -1)))) + (setf comp-files-queue + (append comp-files-queue `((,file . ,load)))) + (display-warning 'comp + (format "No write access for %s skipping." + out-filename))))))) (when (zerop (comp-async-runnings)) (comp-run-async-workers) (message "Compilation started.")))) -- 2.39.5