]> git.eshelyaron.com Git - emacs.git/commitdiff
Merge remote-tracking branch 'savannah/master' into HEAD
authorAndrea Corallo <akrl@sdf.org>
Sun, 20 Dec 2020 21:07:48 +0000 (22:07 +0100)
committerAndrea Corallo <akrl@sdf.org>
Sun, 20 Dec 2020 21:08:42 +0000 (22:08 +0100)
16 files changed:
1  2 
etc/NEWS
lisp/emacs-lisp/advice.el
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/find-func.el
lisp/emacs-lisp/package.el
lisp/files.el
lisp/gnus/gnus.el
lisp/help-fns.el
lisp/international/mule.el
lisp/progmodes/cc-langs.el
lisp/progmodes/elisp-mode.el
lisp/startup.el
lisp/subr.el
src/lread.c
src/print.c
test/lisp/subr-tests.el

diff --cc etc/NEWS
Simple merge
Simple merge
index 02605f3d9f6c305acb3a889861fb9614cd760762,7e1a3304cc8f892124fa7f6415e1c100ebf1b537..620f15c619d8aeea2aeec209f8edc71da12c46af
@@@ -2013,46 -1965,54 +2018,63 @@@ See also `emacs-lisp-byte-compile-and-l
        (with-current-buffer output-buffer
          (goto-char (point-max))
          (insert "\n")                 ; aaah, unix.
-         (if (or (file-writable-p target-file)
-                   byte-native-compiling)
-             ;; We must disable any code conversion here.
-             (progn
-               (let* ((coding-system-for-write 'no-conversion)
-                      ;; Write to a tempfile so that if another Emacs
-                      ;; process is trying to load target-file (eg in a
-                      ;; parallel bootstrap), it does not risk getting a
-                      ;; half-finished file.  (Bug#4196)
-                      (tempfile
-                       (make-temp-file (when (file-writable-p target-file)
-                                           (expand-file-name target-file))))
-                      (default-modes (default-file-modes))
-                      (temp-modes (logand default-modes #o600))
-                      (desired-modes (logand default-modes #o666))
-                      (kill-emacs-hook
-                       (cons (lambda () (ignore-errors
-                                          (delete-file tempfile)))
-                             kill-emacs-hook)))
-                 (unless (= temp-modes desired-modes)
-                   (set-file-modes tempfile desired-modes 'nofollow))
-                 (write-region (point-min) (point-max) tempfile nil 1)
-                 ;; This has the intentional side effect that any
-                 ;; hard-links to target-file continue to
-                 ;; point to the old file (this makes it possible
-                 ;; for installed files to share disk space with
-                 ;; the build tree, without causing problems when
-                 ;; emacs-lisp files in the build tree are
-                 ;; recompiled).  Previously this was accomplished by
-                 ;; deleting target-file before writing it.
-                   (if byte-native-compiling
-                       (if byte-native-for-bootstrap
-                           ;; Defer elc final renaming.
-                           (setf byte-to-native-output-file
-                                 (cons tempfile target-file))
-                         (delete-file tempfile))
-                     (rename-file tempfile target-file t)))
-               (or noninteractive
-                     byte-native-compiling
-                     (message "Wrote %s" target-file)))
+         (cond
+          ((null target-file) nil)     ;We only wanted the warnings!
 -         ((and (file-writable-p target-file)
++         ((and (or (file-writable-p target-file)
++                   byte-native-compiling)
+                  ;; 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
+                  ;; process is trying to load target-file (eg in a
+                  ;; parallel bootstrap), it does not risk getting a
+                  ;; half-finished file.  (Bug#4196)
+                  (tempfile
+                   (make-temp-file (expand-file-name target-file)))
+                  (default-modes (default-file-modes))
+                  (temp-modes (logand default-modes #o600))
+                  (desired-modes (logand default-modes #o666))
+                  (kill-emacs-hook
+                   (cons (lambda () (ignore-errors
+                                 (delete-file tempfile)))
+                         kill-emacs-hook)))
+             (unless (= temp-modes desired-modes)
+               (set-file-modes tempfile desired-modes 'nofollow))
+             (write-region (point-min) (point-max) tempfile nil 1)
+             ;; This has the intentional side effect that any
+             ;; hard-links to target-file continue to
+             ;; point to the old file (this makes it possible
+             ;; for installed files to share disk space with
+             ;; the build tree, without causing problems when
+             ;; emacs-lisp files in the build tree are
+             ;; recompiled).  Previously this was accomplished by
+             ;; deleting target-file before writing it.
 -            (rename-file tempfile target-file t))
 -          (or noninteractive (message "Wrote %s" target-file)))
++            (if byte-native-compiling
++                  (if byte-native-for-bootstrap
++                      ;; Defer elc final renaming.
++                      (setf byte-to-native-output-file
++                            (cons tempfile target-file))
++                    (delete-file tempfile))
++                (rename-file tempfile target-file t)))
++          (or noninteractive
++              byte-native-compiling
++              (message "Wrote %s" target-file)))
+            ((file-writable-p target-file)
+             ;; In case the target directory isn't writable (see e.g. Bug#44631),
+             ;; try writing to the output file directly.  We must disable any
+             ;; code conversion here.
+             (let ((coding-system-for-write 'no-conversion))
+               (with-file-modes (logand (default-file-modes) #o666)
+                 (write-region (point-min) (point-max) target-file nil 1)))
+             (or noninteractive (message "Wrote %s" target-file)))
+          (t
            ;; This is just to give a better error message than write-region
            (let ((exists (file-exists-p target-file)))
              (signal (if exists 'file-error 'file-missing)
Simple merge
Simple merge
diff --cc lisp/files.el
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc lisp/startup.el
Simple merge
diff --cc lisp/subr.el
Simple merge
diff --cc src/lread.c
Simple merge
diff --cc src/print.c
Simple merge
Simple merge