diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-05-03 13:37:38 +0100 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-05-03 13:37:38 +0100 |
commit | 1ec7499e59a8724cb9f3d8688a7c922acad3be27 (patch) | |
tree | 27adb01fb79934af04f17710d73aef1eae394805 /lisp/emacs-lisp | |
parent | 8d372201904bcb5fe6cb14aa5c45f33e6e1cd815 (diff) | |
download | emacs-1ec7499e59a8724cb9f3d8688a7c922acad3be27.tar.gz emacs-1ec7499e59a8724cb9f3d8688a7c922acad3be27.tar.bz2 emacs-1ec7499e59a8724cb9f3d8688a7c922acad3be27.zip |
* 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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/comp.el | 11 |
1 files changed, 10 insertions, 1 deletions
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.")))) |