aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/notes/bzr65
-rw-r--r--doc/lispref/ChangeLog5
-rw-r--r--doc/lispref/files.texi12
-rw-r--r--lisp/ChangeLog34
-rw-r--r--lisp/files.el28
-rw-r--r--lisp/gnus/ChangeLog6
-rw-r--r--lisp/info.el17
-rw-r--r--lisp/net/tramp-sh.el28
-rw-r--r--lisp/progmodes/python.el57
-rw-r--r--src/ChangeLog10
-rw-r--r--src/data.c2
-rw-r--r--src/fileio.c20
-rw-r--r--src/w32proc.c12
13 files changed, 237 insertions, 59 deletions
diff --git a/admin/notes/bzr b/admin/notes/bzr
index 50eaf3710ee..cdcfa7e7e3d 100644
--- a/admin/notes/bzr
+++ b/admin/notes/bzr
@@ -182,6 +182,71 @@ where revision N+1 is the one where file was removed.
182You could also try `bzr add --file-ids-from', if you have a copy of 182You could also try `bzr add --file-ids-from', if you have a copy of
183another branch where file still exists. 183another branch where file still exists.
184 184
185* Undoing a commit (uncommitting)
186
187It is possible to undo/remove a bzr commit (ie, to uncommit).
188Only do this if you really, really, need to. For example, if you
189somehow made a commit that triggers a bug in bzr itself.
190Don't do it because you made a typo in a commit or the log.
191
192If you do need to do this, do it as soon as possible, because the
193longer you leave it, the more work is involved.
194
1950. First, tell emacs-devel that you are going to do this, and suggest
196people not commit anything to the affected branch for the duration.
197
198In the following, replace USER with your Savannah username, and
199BRANCH with the name of the branch.
200Let's assume that revno 100 is the bad commit, and that there have
201been two more commits after that (because nothing is ever easy).
202
2031. Ensure your copy of the branch is up-to-date (for a bound
204branch, bzr up; for an unbound branch, bzr pull) and has no local
205changes (bzr st).
206
2072. Make a record of the commits you are going to undo:
208bzr diff -c 102 > /tmp/102.diff
209etc
210
211Also record the commit message, author, and any --fixes information.
212
2133. Most Emacs branches are set up to prevent just this kind of thing.
214So we need to disable that protection:
215
216bzr config append_revisions_only=False \
217 -d bzr+ssh://USER@bzr.savannah.gnu.org/emacs/BRANCH/
218
2194. Undo the commits:
220bzr uncommit -r -4
221
222This will show the commits it is going to undo, and prompt you to confirm.
223
2245. If using an unbound branch:
225bzr push --overwrite
226
2276. Now, replay the commits you just undid (obviously, fix whatever it
228was in the bad commit that caused the problem):
229
230patch -p0 < /tmp/100.diff
231bzr commit --author ... --fixes ... -F /tmp/100.log
232etc
233
2347. If using an unbound branch:
235bzr push
236
2378. Finally, re-enable the branch protection:
238bzr config append_revisions_only=True \
239 -d bzr+ssh://USER@bzr.savannah.gnu.org/emacs/BRANCH/
240
2419. Tell emacs-devel that it is ok to use the branch again.
242Anyone with local changes should back them up before doing anything.
243
244For a bound branch, bzr up will convert any of the undone commits to a
245pending merge. Just bzr revert these away.
246
247For an unbound branch, bzr pull will complain about diverged branches
248and refuse to do anything. Use bzr pull --overwrite.
249
185* Loggerhead 250* Loggerhead
186 251
187Loggerhead is the bzr tool for viewing a repository over http (similar 252Loggerhead is the bzr tool for viewing a repository over http (similar
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 7893424a942..b2f89024726 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
12012-12-29 Eli Zaretskii <eliz@gnu.org>
2
3 * files.texi (Changing Files): Document the return values of
4 set-file-selinux-context and set-file-acl.
5
12012-12-27 Glenn Morris <rgm@gnu.org> 62012-12-27 Glenn Morris <rgm@gnu.org>
2 7
3 * files.texi (File Names): Mention Cygwin conversion functions. 8 * files.texi (File Names): Mention Cygwin conversion functions.
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 3faa5f5e257..4317fe42523 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1703,9 +1703,11 @@ This function sets the SELinux security context of the file
1703@var{filename} to @var{context}. @xref{File Attributes}, for a brief 1703@var{filename} to @var{context}. @xref{File Attributes}, for a brief
1704description of SELinux contexts. The @var{context} argument should be 1704description of SELinux contexts. The @var{context} argument should be
1705a list @code{(@var{user} @var{role} @var{type} @var{range})}, like the 1705a list @code{(@var{user} @var{role} @var{type} @var{range})}, like the
1706return value of @code{file-selinux-context}. The function does 1706return value of @code{file-selinux-context}. The function returns
1707nothing if SELinux is disabled, or if Emacs was compiled without 1707@code{t} if it succeeds to set the SELinux security context of
1708SELinux support. 1708@var{filename}, @code{nil} otherwise. The function does nothing and
1709returns @code{nil} if SELinux is disabled, or if Emacs was compiled
1710without SELinux support.
1709@end defun 1711@end defun
1710 1712
1711@defun set-file-acl filename acl-string 1713@defun set-file-acl filename acl-string
@@ -1713,7 +1715,9 @@ This function sets the ACL entries of the file @var{filename} to
1713@var{acl-string}. @xref{File Attributes}, for a brief description of 1715@var{acl-string}. @xref{File Attributes}, for a brief description of
1714ACLs. The @var{acl-string} argument should be a string containing the 1716ACLs. The @var{acl-string} argument should be a string containing the
1715textual representation of the desired ACL entries as returned by 1717textual representation of the desired ACL entries as returned by
1716@code{file-acl} (@pxref{File Attributes, file-acl}). 1718@code{file-acl} (@pxref{File Attributes, file-acl}). The function
1719returns @code{t} if it succeeds to set the ACL entries of
1720@var{filename}, @code{nil} otherwise.
1717@end defun 1721@end defun
1718 1722
1719@node File Names 1723@node File Names
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1083dc5513d..81b4978dba5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,37 @@
12012-12-29 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp-sh.el (tramp-sh-handle-file-acl): Suppress basic attributes.
4 (tramp-sh-handle-set-file-acl): Return `t' on success.
5
62012-12-29 Eli Zaretskii <eliz@gnu.org>
7
8 * files.el (backup-buffer-copy, basic-save-buffer-2): If
9 set-file-extended-attributes fails, fall back on set-file-modes
10 instead of signaling an error. (Bug#13298)
11 (basic-save-buffer): Likewise.
12
132012-12-29 Fabián Ezequiel Gallina <fgallina@cuca>
14
15 * progmodes/python.el: Support other commands triggering
16 python-indent-line so indentation cycling continues to work.
17 (python-indent-trigger-commands): New defcustom.
18 (python-indent-line): Use it.
19
202012-12-29 Fabián Ezequiel Gallina <fgallina@cuca>
21
22 * progmodes/python.el (python-shell-send-region): Add blank lines
23 for non sent code so backtraces remain correct.
24
252012-12-29 Fabián Ezequiel Gallina <fgallina@cuca>
26
27 * progmodes/python.el: Remove cl dependency.
28 (python-syntax-count-quotes): Replace incf call.
29 (python-fill-string): Replace setf call.
30
312012-12-29 Damien Cassou <damien.cassou@gmail.com>
32
33 * info.el (info-other-window): New arg, for consistency with info.
34
12012-12-28 Martin Rudalics <rudalics@gmx.at> 352012-12-28 Martin Rudalics <rudalics@gmx.at>
2 36
3 * mail/rmail.el (rmail-maybe-display-summary): Rewrite 37 * mail/rmail.el (rmail-maybe-display-summary): Rewrite
diff --git a/lisp/files.el b/lisp/files.el
index f076530fbc8..e8be1a09047 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4019,10 +4019,12 @@ BACKUPNAME is the backup file name, which is the old file renamed."
4019 nil))) 4019 nil)))
4020 ;; Reset the umask. 4020 ;; Reset the umask.
4021 (set-default-file-modes umask))) 4021 (set-default-file-modes umask)))
4022 (and modes 4022 ;; If set-file-extended-attributes fails, fall back on set-file-modes.
4023 (set-file-modes to-name (logand modes #o1777))) 4023 (unless (and extended-attributes
4024 (and extended-attributes 4024 (with-demoted-errors
4025 (set-file-extended-attributes to-name extended-attributes))) 4025 (set-file-extended-attributes to-name extended-attributes)))
4026 (and modes
4027 (set-file-modes to-name (logand modes #o1777)))))
4026 4028
4027(defvar file-name-version-regexp 4029(defvar file-name-version-regexp
4028 "\\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(?:~[[:digit:]]+\\)?~\\)" 4030 "\\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(?:~[[:digit:]]+\\)?~\\)"
@@ -4619,9 +4621,11 @@ Before and after saving the buffer, this function runs
4619 (if setmodes 4621 (if setmodes
4620 (condition-case () 4622 (condition-case ()
4621 (progn 4623 (progn
4622 (set-file-modes buffer-file-name (car setmodes)) 4624 (unless
4623 (set-file-extended-attributes buffer-file-name 4625 (with-demoted-errors
4624 (nth 1 setmodes))) 4626 (set-file-modes buffer-file-name (car setmodes)))
4627 (set-file-extended-attributes buffer-file-name
4628 (nth 1 setmodes))))
4625 (error nil)))) 4629 (error nil))))
4626 ;; If the auto-save file was recent before this command, 4630 ;; If the auto-save file was recent before this command,
4627 ;; delete it now. 4631 ;; delete it now.
@@ -4737,8 +4741,14 @@ Before and after saving the buffer, this function runs
4737 (setq setmodes (list (file-modes buffer-file-name) 4741 (setq setmodes (list (file-modes buffer-file-name)
4738 (file-extended-attributes buffer-file-name) 4742 (file-extended-attributes buffer-file-name)
4739 buffer-file-name)) 4743 buffer-file-name))
4740 (set-file-modes buffer-file-name (logior (car setmodes) 128)) 4744 ;; If set-file-extended-attributes fails, fall back on
4741 (set-file-extended-attributes buffer-file-name (nth 1 setmodes))))) 4745 ;; set-file-modes.
4746 (unless
4747 (with-demoted-errors
4748 (set-file-extended-attributes buffer-file-name
4749 (nth 1 setmodes)))
4750 (set-file-modes buffer-file-name
4751 (logior (car setmodes) 128))))))
4742 (let (success) 4752 (let (success)
4743 (unwind-protect 4753 (unwind-protect
4744 (progn 4754 (progn
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index b9df3bb9cf7..e17661095e4 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -26,11 +26,11 @@
26 26
272012-12-27 Andreas Schwab <schwab@linux-m68k.org> 272012-12-27 Andreas Schwab <schwab@linux-m68k.org>
28 28
29 * mml2015.el (mml2015-epg-key-image): separate attribute stream from 29 * mml2015.el (mml2015-epg-key-image): Separate attribute stream from
30 stderr. 30 stderr.
31 31
32 * nnimap.el (nnimap-find-article-by-message-id): 32 * nnimap.el (nnimap-find-article-by-message-id): Don't error out if
33 Don't error out if group is nil. 33 group is nil.
34 34
35 * shr.el (shr-tag-em): Render as italic, not bold. 35 * shr.el (shr-tag-em): Render as italic, not bold.
36 36
diff --git a/lisp/info.el b/lisp/info.el
index 19f9212f88a..07d5c66201d 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -746,11 +746,15 @@ in `Info-file-supports-index-cookies-list'."
746 (push dir Info-directory-list))))))) 746 (push dir Info-directory-list)))))))
747 747
748;;;###autoload 748;;;###autoload
749(defun info-other-window (&optional file-or-node) 749(defun info-other-window (&optional file-or-node buffer)
750 "Like `info' but show the Info buffer in another window." 750 "Like `info' but show the Info buffer in another window."
751 (interactive (if current-prefix-arg 751 (interactive (list
752 (list (read-file-name "Info file name: " nil nil t)))) 752 (if (and current-prefix-arg (not (numberp current-prefix-arg)))
753 (info-setup file-or-node (switch-to-buffer-other-window "*info*"))) 753 (read-file-name "Info file name: " nil nil t))
754 (if (numberp current-prefix-arg)
755 (format "*info*<%s>" current-prefix-arg))))
756 (info-setup file-or-node
757 (switch-to-buffer-other-window (or buffer "*info*"))))
754 758
755;;;###autoload (put 'info 'info-file (purecopy "emacs")) 759;;;###autoload (put 'info 'info-file (purecopy "emacs"))
756;;;###autoload 760;;;###autoload
@@ -767,8 +771,9 @@ with the top-level Info directory.
767 771
768In interactive use, a non-numeric prefix argument directs 772In interactive use, a non-numeric prefix argument directs
769this command to read a file name from the minibuffer. 773this command to read a file name from the minibuffer.
770A numeric prefix argument selects an Info buffer with the prefix number 774
771appended to the Info buffer name. 775A numeric prefix argument N selects an Info buffer named
776\"*info*<%s>\".
772 777
773The search path for Info files is in the variable `Info-directory-list'. 778The search path for Info files is in the variable `Info-directory-list'.
774The top-level Info directory is made by combining all the files named `dir' 779The top-level Info directory is made by combining all the files named `dir'
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 67459b4f9ca..ebc377c08c8 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1547,25 +1547,31 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1547 (when (and (tramp-remote-acl-p v) 1547 (when (and (tramp-remote-acl-p v)
1548 (tramp-send-command-and-check 1548 (tramp-send-command-and-check
1549 v (format 1549 v (format
1550 "getfacl -ac %s 2>/dev/null" 1550 "getfacl -acs %s 2>/dev/null"
1551 (tramp-shell-quote-argument localname)))) 1551 (tramp-shell-quote-argument localname))))
1552 (with-current-buffer (tramp-get-connection-buffer v) 1552 (with-current-buffer (tramp-get-connection-buffer v)
1553 (goto-char (point-max)) 1553 (goto-char (point-max))
1554 (delete-blank-lines) 1554 (delete-blank-lines)
1555 (substring-no-properties (buffer-string))))))) 1555 (when (> (point-max) (point-min))
1556 (substring-no-properties (buffer-string))))))))
1556 1557
1557(defun tramp-sh-handle-set-file-acl (filename acl-string) 1558(defun tramp-sh-handle-set-file-acl (filename acl-string)
1558 "Like `set-file-acl' for Tramp files." 1559 "Like `set-file-acl' for Tramp files."
1559 (with-parsed-tramp-file-name filename nil 1560 (with-parsed-tramp-file-name filename nil
1560 (if (and (stringp acl-string) 1561 (when (tramp-remote-acl-p v)
1561 (tramp-remote-acl-p v) 1562 (condition-case nil
1562 (tramp-send-command-and-check 1563 (when (stringp acl-string)
1563 v (format "setfacl --set-file=- %s <<'EOF'\n%s\nEOF\n" 1564 (tramp-set-file-property v localname "file-acl" acl-string)
1564 (tramp-shell-quote-argument localname) acl-string))) 1565 (dolist (line (split-string acl-string nil t) t)
1565 (tramp-set-file-property v localname "file-acl" acl-string) 1566 (unless (tramp-send-command-and-check
1566 (tramp-set-file-property v localname "file-acl-string" 'undef))) 1567 v (format
1567 ;; We always return nil. 1568 "setfacl -m %s %s"
1568 nil) 1569 line (tramp-shell-quote-argument localname)))
1570 (error))))
1571 ;; In case of errors, we return `nil'.
1572 (error
1573 (tramp-set-file-property v localname "file-acl" 'undef)
1574 nil)))))
1569 1575
1570;; Simple functions using the `test' command. 1576;; Simple functions using the `test' command.
1571 1577
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 67388c0339b..54a657a2593 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -204,7 +204,6 @@
204 204
205(require 'ansi-color) 205(require 'ansi-color)
206(require 'comint) 206(require 'comint)
207(eval-when-compile (require 'cl-lib))
208 207
209;; Avoid compiler warnings 208;; Avoid compiler warnings
210(defvar view-return-to-alist) 209(defvar view-return-to-alist)
@@ -529,7 +528,7 @@ is used to limit the scan."
529 (while (and (< i 3) 528 (while (and (< i 3)
530 (or (not limit) (< (+ point i) limit)) 529 (or (not limit) (< (+ point i) limit))
531 (eq (char-after (+ point i)) quote-char)) 530 (eq (char-after (+ point i)) quote-char))
532 (cl-incf i)) 531 (setq i (1+ i)))
533 i)) 532 i))
534 533
535(defun python-syntax-stringify () 534(defun python-syntax-stringify ()
@@ -608,6 +607,12 @@ It makes underscores and dots word constituent chars.")
608 :group 'python 607 :group 'python
609 :safe 'booleanp) 608 :safe 'booleanp)
610 609
610(defcustom python-indent-trigger-commands
611 '(indent-for-tab-command yas-expand yas/expand)
612 "Commands that might trigger a `python-indent-line' call."
613 :type '(repeat symbol)
614 :group 'python)
615
611(define-obsolete-variable-alias 616(define-obsolete-variable-alias
612 'python-indent 'python-indent-offset "24.3") 617 'python-indent 'python-indent-offset "24.3")
613 618
@@ -906,20 +911,21 @@ Uses the offset calculated in
906indicated by the variable `python-indent-levels' to set the 911indicated by the variable `python-indent-levels' to set the
907current indentation. 912current indentation.
908 913
909When the variable `last-command' is equal to 914When the variable `last-command' is equal to one of the symbols
910`indent-for-tab-command' or FORCE-TOGGLE is non-nil it cycles 915inside `python-indent-trigger-commands' or FORCE-TOGGLE is
911levels indicated in the variable `python-indent-levels' by 916non-nil it cycles levels indicated in the variable
912setting the current level in the variable 917`python-indent-levels' by setting the current level in the
913`python-indent-current-level'. 918variable `python-indent-current-level'.
914 919
915When the variable `last-command' is not equal to 920When the variable `last-command' is not equal to one of the
916`indent-for-tab-command' and FORCE-TOGGLE is nil it calculates 921symbols inside `python-indent-trigger-commands' and FORCE-TOGGLE
917possible indentation levels and saves it in the variable 922is nil it calculates possible indentation levels and saves it in
918`python-indent-levels'. Afterwards it sets the variable 923the variable `python-indent-levels'. Afterwards it sets the
919`python-indent-current-level' correctly so offset is equal 924variable `python-indent-current-level' correctly so offset is
920to (`nth' `python-indent-current-level' `python-indent-levels')" 925equal to (`nth' `python-indent-current-level'
926`python-indent-levels')"
921 (or 927 (or
922 (and (or (and (eq this-command 'indent-for-tab-command) 928 (and (or (and (memq this-command python-indent-trigger-commands)
923 (eq last-command this-command)) 929 (eq last-command this-command))
924 force-toggle) 930 force-toggle)
925 (not (equal python-indent-levels '(0))) 931 (not (equal python-indent-levels '(0)))
@@ -2009,7 +2015,14 @@ Returns the output. See `python-shell-send-string-no-output'."
2009(defun python-shell-send-region (start end) 2015(defun python-shell-send-region (start end)
2010 "Send the region delimited by START and END to inferior Python process." 2016 "Send the region delimited by START and END to inferior Python process."
2011 (interactive "r") 2017 (interactive "r")
2012 (python-shell-send-string (buffer-substring start end) nil t)) 2018 (python-shell-send-string
2019 (concat
2020 (let ((line-num (line-number-at-pos start)))
2021 ;; When sending a region, add blank lines for non sent code so
2022 ;; backtraces remain correct.
2023 (make-string (1- line-num) ?\n))
2024 (buffer-substring start end))
2025 nil t))
2013 2026
2014(defun python-shell-send-buffer (&optional arg) 2027(defun python-shell-send-buffer (&optional arg)
2015 "Send the entire buffer to inferior Python process. 2028 "Send the entire buffer to inferior Python process.
@@ -2487,12 +2500,12 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2487JUSTIFY should be used (if applicable) as in `fill-paragraph'." 2500JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2488 (let* ((marker (point-marker)) 2501 (let* ((marker (point-marker))
2489 (str-start-pos 2502 (str-start-pos
2490 (let ((m (make-marker))) 2503 (set-marker
2491 (setf (marker-position m) 2504 (make-marker)
2492 (or (python-syntax-context 'string) 2505 (or (python-syntax-context 'string)
2493 (and (equal (string-to-syntax "|") 2506 (and (equal (string-to-syntax "|")
2494 (syntax-after (point))) 2507 (syntax-after (point)))
2495 (point)))) m)) 2508 (point)))))
2496 (num-quotes (python-syntax-count-quotes 2509 (num-quotes (python-syntax-count-quotes
2497 (char-after str-start-pos) str-start-pos)) 2510 (char-after str-start-pos) str-start-pos))
2498 (str-end-pos 2511 (str-end-pos
diff --git a/src/ChangeLog b/src/ChangeLog
index 79d1982cc0e..e95df2b8953 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12012-12-29 Eli Zaretskii <eliz@gnu.org>
2
3 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
4 file's SELinux context or ACLs successfully set, nil otherwise.
5 (Bug#13298)
6 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
7
8 * w32proc.c (reader_thread): Avoid passing NULL handles to
9 SetEvent and WaitForSingleObject.
10
12012-12-28 Paul Eggert <eggert@cs.ucla.edu> 112012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2 12
3 Port EXTERNALLY_VISIBLE to Clang 3.2. 13 Port EXTERNALLY_VISIBLE to Clang 3.2.
diff --git a/src/data.c b/src/data.c
index a72fa3e2b5f..c0f35ac0916 100644
--- a/src/data.c
+++ b/src/data.c
@@ -583,7 +583,7 @@ DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0,
583 (register Lisp_Object symbol) 583 (register Lisp_Object symbol)
584{ 584{
585 CHECK_SYMBOL (symbol); 585 CHECK_SYMBOL (symbol);
586 return XSYMBOL (symbol)->function; 586 return XSYMBOL (symbol)->function;
587} 587}
588 588
589DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0, 589DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0,
diff --git a/src/fileio.c b/src/fileio.c
index 9f70c790592..0e63e3f18d9 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2029,7 +2029,15 @@ entries (depending on how Emacs was built). */)
2029 if (!CopyFile (SDATA (encoded_file), 2029 if (!CopyFile (SDATA (encoded_file),
2030 SDATA (encoded_newname), 2030 SDATA (encoded_newname),
2031 FALSE)) 2031 FALSE))
2032 report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil))); 2032 {
2033 /* CopyFile doesn't set errno when it fails. By far the most
2034 "popular" reason is that the target is read-only. */
2035 if (GetLastError () == 5)
2036 errno = EACCES;
2037 else
2038 errno = EPERM;
2039 report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil)));
2040 }
2033 /* CopyFile retains the timestamp by default. */ 2041 /* CopyFile retains the timestamp by default. */
2034 else if (NILP (keep_time)) 2042 else if (NILP (keep_time))
2035 { 2043 {
@@ -2996,8 +3004,10 @@ DEFUN ("set-file-selinux-context", Fset_file_selinux_context,
2996CONTEXT should be a list (USER ROLE TYPE RANGE), where the list 3004CONTEXT should be a list (USER ROLE TYPE RANGE), where the list
2997elements are strings naming the components of a SELinux context. 3005elements are strings naming the components of a SELinux context.
2998 3006
2999This function does nothing if SELinux is disabled, or if Emacs was not 3007Value is t if setting of SELinux context was successful, nil otherwise.
3000compiled with SELinux support. */) 3008
3009This function does nothing and returns nil if SELinux is disabled,
3010or if Emacs was not compiled with SELinux support. */)
3001 (Lisp_Object filename, Lisp_Object context) 3011 (Lisp_Object filename, Lisp_Object context)
3002{ 3012{
3003 Lisp_Object absname; 3013 Lisp_Object absname;
@@ -3063,6 +3073,7 @@ compiled with SELinux support. */)
3063 3073
3064 context_free (parsed_con); 3074 context_free (parsed_con);
3065 freecon (con); 3075 freecon (con);
3076 return fail ? Qnil : Qt;
3066 } 3077 }
3067 else 3078 else
3068 report_file_error ("Doing lgetfilecon", Fcons (absname, Qnil)); 3079 report_file_error ("Doing lgetfilecon", Fcons (absname, Qnil));
@@ -3127,6 +3138,8 @@ DEFUN ("set-file-acl", Fset_file_acl, Sset_file_acl,
3127ACL-STRING should contain the textual representation of the ACL 3138ACL-STRING should contain the textual representation of the ACL
3128entries in a format suitable for the platform. 3139entries in a format suitable for the platform.
3129 3140
3141Value is t if setting of ACL was successful, nil otherwise.
3142
3130Setting ACL for local files requires Emacs to be built with ACL 3143Setting ACL for local files requires Emacs to be built with ACL
3131support. */) 3144support. */)
3132 (Lisp_Object filename, Lisp_Object acl_string) 3145 (Lisp_Object filename, Lisp_Object acl_string)
@@ -3166,6 +3179,7 @@ support. */)
3166 report_file_error ("Setting ACL", Fcons (absname, Qnil)); 3179 report_file_error ("Setting ACL", Fcons (absname, Qnil));
3167 3180
3168 acl_free (acl); 3181 acl_free (acl);
3182 return fail ? Qnil : Qt;
3169 } 3183 }
3170#endif 3184#endif
3171 3185
diff --git a/src/w32proc.c b/src/w32proc.c
index 5c43a57db29..8977ca38a15 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -970,6 +970,11 @@ reader_thread (void *arg)
970 else 970 else
971 rc = _sys_read_ahead (cp->fd); 971 rc = _sys_read_ahead (cp->fd);
972 972
973 /* Don't bother waiting for the event if we already have been
974 told to exit by delete_child. */
975 if (cp->status == STATUS_READ_ERROR || !cp->char_avail)
976 break;
977
973 /* The name char_avail is a misnomer - it really just means the 978 /* The name char_avail is a misnomer - it really just means the
974 read-ahead has completed, whether successfully or not. */ 979 read-ahead has completed, whether successfully or not. */
975 if (!SetEvent (cp->char_avail)) 980 if (!SetEvent (cp->char_avail))
@@ -986,6 +991,11 @@ reader_thread (void *arg)
986 if (rc == STATUS_READ_FAILED) 991 if (rc == STATUS_READ_FAILED)
987 break; 992 break;
988 993
994 /* Don't bother waiting for the acknowledge if we already have
995 been told to exit by delete_child. */
996 if (cp->status == STATUS_READ_ERROR || !cp->char_consumed)
997 break;
998
989 /* Wait until our input is acknowledged before reading again */ 999 /* Wait until our input is acknowledged before reading again */
990 if (WaitForSingleObject (cp->char_consumed, INFINITE) != WAIT_OBJECT_0) 1000 if (WaitForSingleObject (cp->char_consumed, INFINITE) != WAIT_OBJECT_0)
991 { 1001 {
@@ -993,6 +1003,8 @@ reader_thread (void *arg)
993 "%lu for fd %ld\n", GetLastError (), cp->fd)); 1003 "%lu for fd %ld\n", GetLastError (), cp->fd));
994 break; 1004 break;
995 } 1005 }
1006 /* delete_child sets status to STATUS_READ_ERROR when it wants
1007 us to exit. */
996 if (cp->status == STATUS_READ_ERROR) 1008 if (cp->status == STATUS_READ_ERROR)
997 break; 1009 break;
998 } 1010 }