diff options
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 909a1b4412a..5ed6bfeddcc 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -2067,16 +2067,17 @@ See also `emacs-lisp-byte-compile-and-load'." | |||
| 2067 | (insert "\n") ; aaah, unix. | 2067 | (insert "\n") ; aaah, unix. |
| 2068 | (cond | 2068 | (cond |
| 2069 | ((null target-file) nil) ;We only wanted the warnings! | 2069 | ((null target-file) nil) ;We only wanted the warnings! |
| 2070 | ((or byte-native-compiling | 2070 | ((and (or (null byte-native-compiling) |
| 2071 | (and (file-writable-p target-file) | 2071 | (and byte-native-compiling byte+native-compile)) |
| 2072 | ;; We attempt to create a temporary file in the | 2072 | (file-writable-p target-file) |
| 2073 | ;; target directory, so the target directory must be | 2073 | ;; We attempt to create a temporary file in the |
| 2074 | ;; writable. | 2074 | ;; target directory, so the target directory must be |
| 2075 | (file-writable-p | 2075 | ;; writable. |
| 2076 | (file-name-directory | 2076 | (file-writable-p |
| 2077 | ;; Need to expand in case TARGET-FILE doesn't | 2077 | (file-name-directory |
| 2078 | ;; include a directory (Bug#45287). | 2078 | ;; Need to expand in case TARGET-FILE doesn't |
| 2079 | (expand-file-name target-file))))) | 2079 | ;; include a directory (Bug#45287). |
| 2080 | (expand-file-name target-file)))) | ||
| 2080 | ;; We must disable any code conversion here. | 2081 | ;; We must disable any code conversion here. |
| 2081 | (let* ((coding-system-for-write 'no-conversion) | 2082 | (let* ((coding-system-for-write 'no-conversion) |
| 2082 | ;; Write to a tempfile so that if another Emacs | 2083 | ;; Write to a tempfile so that if another Emacs |
| @@ -2105,11 +2106,9 @@ See also `emacs-lisp-byte-compile-and-load'." | |||
| 2105 | ;; recompiled). Previously this was accomplished by | 2106 | ;; recompiled). Previously this was accomplished by |
| 2106 | ;; deleting target-file before writing it. | 2107 | ;; deleting target-file before writing it. |
| 2107 | (if byte-native-compiling | 2108 | (if byte-native-compiling |
| 2108 | (if byte+native-compile | 2109 | ;; Defer elc final renaming. |
| 2109 | ;; Defer elc final renaming. | 2110 | (setf byte-to-native-output-file |
| 2110 | (setf byte-to-native-output-file | 2111 | (cons tempfile target-file)) |
| 2111 | (cons tempfile target-file)) | ||
| 2112 | (delete-file tempfile)) | ||
| 2113 | (rename-file tempfile target-file t))) | 2112 | (rename-file tempfile target-file t))) |
| 2114 | (or noninteractive | 2113 | (or noninteractive |
| 2115 | byte-native-compiling | 2114 | byte-native-compiling |