summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorYuuki Harano <masm+github@masm11.me>2021-06-20 18:17:23 +0900
committerYuuki Harano <masm+github@masm11.me>2021-06-20 18:17:23 +0900
commit01b0a909b5ca858a09484821cc866127652f4153 (patch)
treee36df7ad23f34a24afafa5549478c389e654d803 /lisp/emacs-lisp/bytecomp.el
parent11c835ea48b971faf21dd94e40721e9ed0a8265a (diff)
parenta17f40911e26e35f9df50ca0c04dcb4ab504114b (diff)
downloademacs-01b0a909b5ca858a09484821cc866127652f4153.tar.gz
emacs-01b0a909b5ca858a09484821cc866127652f4153.tar.bz2
emacs-01b0a909b5ca858a09484821cc866127652f4153.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el42
1 files changed, 20 insertions, 22 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 96a0da924fc..472e0ba3ba3 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -603,15 +603,11 @@ Each element is (INDEX . VALUE)")
form lexical)
(defvar byte-native-compiling nil
- "Non nil while native compiling.")
+ "Non-nil while native compiling.")
(defvar byte-native-qualities nil
"To spill default qualities from the compiled file.")
(defvar byte+native-compile nil
- "Non nil while compiling for bootstrap."
- ;; During bootstrap we produce both the .eln and the .elc together.
- ;; Because the make target is the later this has to be produced as
- ;; last to be resilient against build interruptions.
-)
+ "Non-nil while producing at the same time byte and native code.")
(defvar byte-to-native-lambdas-h nil
"Hash byte-code -> byte-to-native-lambda.")
(defvar byte-to-native-top-level-forms nil
@@ -1639,7 +1635,10 @@ URLs."
;; Ignore these `substitute-command-keys' substitutions.
(seq "\\" (or "="
(seq "<" (* (not ">")) ">")
- (seq "{" (* (not "}")) "}")))))
+ (seq "{" (* (not "}")) "}")))
+ ;; Ignore the function signature that's stashed at the end of
+ ;; the doc string (in some circumstances).
+ (seq bol "(fn (" (* nonl))))
""
;; Heuristic: assume these substitutions are of some length N.
(replace-regexp-in-string
@@ -2071,16 +2070,17 @@ See also `emacs-lisp-byte-compile-and-load'."
(insert "\n") ; aaah, unix.
(cond
((null target-file) nil) ;We only wanted the warnings!
- ((or byte-native-compiling
- (and (file-writable-p target-file)
- ;; We attempt to create a temporary file in the
- ;; target directory, so the target directory must be
- ;; writable.
- (file-writable-p
- (file-name-directory
- ;; Need to expand in case TARGET-FILE doesn't
- ;; include a directory (Bug#45287).
- (expand-file-name target-file)))))
+ ((and (or (null byte-native-compiling)
+ (and byte-native-compiling byte+native-compile))
+ (file-writable-p target-file)
+ ;; We attempt to create a temporary file in the
+ ;; target directory, so the target directory must be
+ ;; writable.
+ (file-writable-p
+ (file-name-directory
+ ;; Need to expand in case TARGET-FILE doesn't
+ ;; include a directory (Bug#45287).
+ (expand-file-name target-file))))
;; We must disable any code conversion here.
(let* ((coding-system-for-write 'no-conversion)
;; Write to a tempfile so that if another Emacs
@@ -2109,11 +2109,9 @@ See also `emacs-lisp-byte-compile-and-load'."
;; recompiled). Previously this was accomplished by
;; deleting target-file before writing it.
(if byte-native-compiling
- (if byte+native-compile
- ;; Defer elc final renaming.
- (setf byte-to-native-output-file
- (cons tempfile target-file))
- (delete-file tempfile))
+ ;; Defer elc final renaming.
+ (setf byte-to-native-output-file
+ (cons tempfile target-file))
(rename-file tempfile target-file t)))
(or noninteractive
byte-native-compiling