------------------------------------------------------------ revno: 115808 committer: martin rudalics branch nick: trunk timestamp: Mon 2013-12-30 10:14:29 +0100 message: Fix Bug#16284. * dispnew.c (change_frame_size_1): Take old width of root window from that window's pixel width. Bug#16284. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-29 18:18:45 +0000 +++ src/ChangeLog 2013-12-30 09:14:29 +0000 @@ -1,3 +1,8 @@ +2013-12-30 Martin Rudalics + + * dispnew.c (change_frame_size_1): Take old width of root window + from that window's pixel width. Bug#16284. + 2013-12-29 Paul Eggert Plain copy-file no longer chmods an existing destination (Bug#16133). === modified file 'src/dispnew.c' --- src/dispnew.c 2013-12-20 10:48:36 +0000 +++ src/dispnew.c 2013-12-30 09:14:29 +0000 @@ -5463,8 +5463,7 @@ bool pretend, bool delay, bool safe, bool pixelwise) { int new_text_width, new_text_height, new_root_width; - int old_root_width = (FRAME_PIXEL_WIDTH (f) - - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); + int old_root_width = WINDOW_PIXEL_WIDTH (XWINDOW (FRAME_ROOT_WINDOW (f))); int new_cols, new_lines; ptrdiff_t count = SPECPDL_INDEX (); ------------------------------------------------------------ revno: 115807 fixes bug: http://debbugs.gnu.org/16292 committer: Paul Eggert branch nick: trunk timestamp: Sun 2013-12-29 19:19:25 -0800 message: Specify info encoding and language. * emacs.texi, emacs-xtra.texi: * emacs-lisp-intro.texi: * back.texi, book-spine.texi, elisp.texi, lay-flat.texi: * ada-mode.texi, auth.texi, autotype.texi, bovine.texi, calc.texi: * cc-mode.texi, cl.texi, dbus.texi, dired-x.texi, ebrowse.texi: * ede.texi, ediff.texi, edt.texi, efaq-w32.texi, efaq.texi: * eieio.texi, emacs-gnutls.texi, emacs-mime.texi, epa.texi, erc.texi: * ert.texi, eshell.texi, eudc.texi, flymake.texi, forms.texi: * gnus-coding.texi, gnus-faq.texi, gnus.texi, htmlfontify.texi: * idlwave.texi, ido.texi, info.texi, mairix-el.texi, message.texi: * mh-e.texi, newsticker.texi, nxml-mode.texi, octave-mode.texi: * org.texi, pcl-cvs.texi, pgg.texi, rcirc.texi, reftex.texi: * remember.texi, sasl.texi, sc.texi, semantic.texi, ses.texi: * sieve.texi, smtpmail.texi, speedbar.texi, srecode.texi: * todo-mode.texi, tramp.texi, url.texi, vip.texi, viper.texi: * widget.texi, wisent.texi, woman.texi: Add @documentencoding, @documentlanguage as needed. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-12-28 00:42:59 +0000 +++ doc/emacs/ChangeLog 2013-12-30 03:19:25 +0000 @@ -1,3 +1,8 @@ +2013-12-30 Paul Eggert + + Specify info encoding and language (Bug#16292). + * emacs.texi, emacs-xtra.texi: Add @documentlanguage directive. + 2013-12-28 Glenn Morris * trouble.texi (Understanding Bug Reporting): Brevity. === modified file 'doc/emacs/emacs-xtra.texi' --- doc/emacs/emacs-xtra.texi 2013-03-04 08:45:03 +0000 +++ doc/emacs/emacs-xtra.texi 2013-12-30 03:19:25 +0000 @@ -27,6 +27,7 @@ @end copying @documentencoding UTF-8 +@documentlanguage en @dircategory Emacs @direntry === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2013-12-22 02:55:43 +0000 +++ doc/emacs/emacs.texi 2013-12-30 03:19:25 +0000 @@ -45,6 +45,7 @@ @end copying @documentencoding UTF-8 +@documentlanguage en @dircategory Emacs @direntry === modified file 'doc/lispintro/ChangeLog' --- doc/lispintro/ChangeLog 2013-12-30 03:08:09 +0000 +++ doc/lispintro/ChangeLog 2013-12-30 03:19:25 +0000 @@ -1,3 +1,8 @@ +2013-12-30 Paul Eggert + + Specify info encoding and language (Bug#16292). + * emacs-lisp-intro.texi: Add @documentencoding, @documentlanguage. + 2013-12-30 Glenn Morris * emacs-lisp-intro.texi: Use @quotation for license notice. === modified file 'doc/lispintro/emacs-lisp-intro.texi' --- doc/lispintro/emacs-lisp-intro.texi 2013-12-30 03:08:09 +0000 +++ doc/lispintro/emacs-lisp-intro.texi 2013-12-30 03:19:25 +0000 @@ -4,6 +4,8 @@ @c setfilename emacs-lisp-intro.info @c sethtmlfilename emacs-lisp-intro.html @settitle Programming in Emacs Lisp +@documentencoding UTF-8 +@documentlanguage en @syncodeindex vr cp @syncodeindex fn cp @finalout === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-12-29 18:18:45 +0000 +++ doc/lispref/ChangeLog 2013-12-30 03:19:25 +0000 @@ -1,3 +1,9 @@ +2013-12-30 Paul Eggert + + Specify info encoding and language (Bug#16292). + * back.texi, book-spine.texi, elisp.texi, lay-flat.texi: + Add @documentencoding, @documentlanguage as needed. + 2013-12-29 Paul Eggert Plain copy-file no longer chmods an existing destination (Bug#16133). === modified file 'doc/lispref/back.texi' --- doc/lispref/back.texi 2013-01-01 09:11:05 +0000 +++ doc/lispref/back.texi 2013-12-30 03:19:25 +0000 @@ -6,6 +6,8 @@ @c %**start of header @setfilename back-cover @settitle GNU Emacs Lisp Reference Manual +@documentencoding UTF-8 +@documentlanguage en @c %**end of header . @sp 7 === modified file 'doc/lispref/book-spine.texi' --- doc/lispref/book-spine.texi 2012-04-26 00:48:08 +0000 +++ doc/lispref/book-spine.texi 2013-12-30 03:19:25 +0000 @@ -2,6 +2,8 @@ @c %**start of header @setfilename book-spine @settitle book-spine +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @include emacsver.texi === modified file 'doc/lispref/elisp.texi' --- doc/lispref/elisp.texi 2013-12-12 22:41:31 +0000 +++ doc/lispref/elisp.texi 2013-12-30 03:19:25 +0000 @@ -116,6 +116,7 @@ @end copying @documentencoding UTF-8 +@documentlanguage en @dircategory Emacs lisp @direntry === modified file 'doc/lispref/lay-flat.texi' --- doc/lispref/lay-flat.texi 2013-01-01 09:11:05 +0000 +++ doc/lispref/lay-flat.texi 2013-12-30 03:19:25 +0000 @@ -7,6 +7,8 @@ @setfilename inner-covers.info @settitle Inner Covers @smallbook +@documentencoding UTF-8 +@documentlanguage en @comment %**end of header @headings off === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2013-12-28 00:31:33 +0000 +++ doc/misc/ChangeLog 2013-12-30 03:19:25 +0000 @@ -1,3 +1,21 @@ +2013-12-30 Paul Eggert + + Specify info encoding and language (Bug#16292). + * ada-mode.texi, auth.texi, autotype.texi, bovine.texi, calc.texi: + * cc-mode.texi, cl.texi, dbus.texi, dired-x.texi, ebrowse.texi: + * ede.texi, ediff.texi, edt.texi, efaq-w32.texi, efaq.texi: + * eieio.texi, emacs-gnutls.texi, emacs-mime.texi, epa.texi, erc.texi: + * ert.texi, eshell.texi, eudc.texi, flymake.texi, forms.texi: + * gnus-coding.texi, gnus-faq.texi, gnus.texi, htmlfontify.texi: + * idlwave.texi, ido.texi, info.texi, mairix-el.texi, message.texi: + * mh-e.texi, newsticker.texi, nxml-mode.texi, octave-mode.texi: + * org.texi, pcl-cvs.texi, pgg.texi, rcirc.texi, reftex.texi: + * remember.texi, sasl.texi, sc.texi, semantic.texi, ses.texi: + * sieve.texi, smtpmail.texi, speedbar.texi, srecode.texi: + * todo-mode.texi, tramp.texi, url.texi, vip.texi, viper.texi: + * widget.texi, wisent.texi, woman.texi: + Add @documentencoding, @documentlanguage as needed. + 2013-12-23 Teodor Zlatanov * emacs-gnutls.texi (Help For Users): Document `gnutls-verify-error'. === modified file 'doc/misc/ada-mode.texi' --- doc/misc/ada-mode.texi 2013-02-13 04:31:09 +0000 +++ doc/misc/ada-mode.texi 2013-12-30 03:19:25 +0000 @@ -1,6 +1,8 @@ \input texinfo @c -*-texinfo-*- @setfilename ../../info/ada-mode @settitle Ada Mode +@documentencoding UTF-8 +@documentlanguage en @copying Copyright @copyright{} 1999--2013 Free Software Foundation, Inc. === modified file 'doc/misc/auth.texi' --- doc/misc/auth.texi 2013-01-05 16:19:53 +0000 +++ doc/misc/auth.texi 2013-12-30 03:19:25 +0000 @@ -6,6 +6,8 @@ @setfilename ../../info/auth @settitle Emacs auth-source Library @value{VERSION} +@documentencoding UTF-8 +@documentlanguage en @copying This file describes the Emacs auth-source library. === modified file 'doc/misc/autotype.texi' --- doc/misc/autotype.texi 2013-12-12 03:37:38 +0000 +++ doc/misc/autotype.texi 2013-12-30 03:19:25 +0000 @@ -5,6 +5,8 @@ @c @node Autotypist, Picture, Abbrevs, Top @c @chapter Features for Automatic Typing @settitle Features for Automatic Typing +@documentencoding UTF-8 +@documentlanguage en @c @cindex text @c @cindex selfinserting text @c @cindex autotypist === modified file 'doc/misc/bovine.texi' --- doc/misc/bovine.texi 2013-07-03 03:03:47 +0000 +++ doc/misc/bovine.texi 2013-12-30 03:19:25 +0000 @@ -4,6 +4,8 @@ @set TITLE Bovine parser development @set AUTHOR Eric M. Ludlam, David Ponce, and Richard Y. Kim @settitle @value{TITLE} +@documentencoding UTF-8 +@documentlanguage en @c ************************************************************************* @c @ Header === modified file 'doc/misc/calc.texi' --- doc/misc/calc.texi 2013-12-20 04:53:24 +0000 +++ doc/misc/calc.texi 2013-12-30 03:19:25 +0000 @@ -4,6 +4,8 @@ @setfilename ../../info/calc @c [title] @settitle GNU Emacs Calc Manual +@documentencoding UTF-8 +@documentlanguage en @setchapternewpage odd @comment %**end of header (This is for running Texinfo on a region.) @@ -11801,7 +11803,7 @@ leaving the first, third, fourth, and so on; @kbd{M-3 M-@key{DEL}} deletes the third stack element. -The above commands do not depend on the location of the cursor. +The above commands do not depend on the location of the cursor. If the customizable variable @code{calc-context-sensitive-enter} is non-@code{nil} (@pxref{Customizing Calc}), these commands will become context sensitive. For example, instead of duplicating the top of the stack, @@ -33326,7 +33328,7 @@ 99@dots{}9. The least significant digit is @var{d0}; the last digit, @var{dn}, which is always nonzero, is the most significant digit. For example, the integer @mathit{-12345678} might be stored as -@samp{(bigneg 678 345 12)}. +@samp{(bigneg 678 345 12)}. The distinction between small and large integers is entirely hidden from the user. In @code{defmath} definitions, the Lisp predicate @code{integerp} @@ -35712,10 +35714,10 @@ The commands @code{calc-enter} and @code{calc-pop} will typically duplicate the top of the stack. If @code{calc-context-sensitive-enter} is non-@code{nil}, then the -@code{calc-enter} will copy the element at the cursor to the +@code{calc-enter} will copy the element at the cursor to the top of the stack and @code{calc-pop} will delete the element at the cursor. The default value of @code{calc-context-sensitive-enter} is -@code{nil}. +@code{nil}. @end defvar @defvar calc-undo-length === modified file 'doc/misc/cc-mode.texi' --- doc/misc/cc-mode.texi 2013-12-12 03:37:38 +0000 +++ doc/misc/cc-mode.texi 2013-12-30 03:19:25 +0000 @@ -83,6 +83,8 @@ @setfilename ../../info/ccmode @settitle CC Mode Manual +@documentencoding UTF-8 +@documentlanguage en @footnotestyle end @c The following four macros generate the filenames and titles of the === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2013-10-14 22:25:14 +0000 +++ doc/misc/cl.texi 2013-12-30 03:19:25 +0000 @@ -1,6 +1,8 @@ \input texinfo @c -*-texinfo-*- @setfilename ../../info/cl @settitle Common Lisp Extensions +@documentencoding UTF-8 +@documentlanguage en @include emacsver.texi @copying @@ -1495,7 +1497,7 @@ @node Blocks and Exits @section Blocks and Exits -@cindex block +@cindex block @noindent Common Lisp @dfn{blocks} provide a non-local exit mechanism very === modified file 'doc/misc/dbus.texi' --- doc/misc/dbus.texi 2013-12-08 15:33:27 +0000 +++ doc/misc/dbus.texi 2013-12-30 03:19:25 +0000 @@ -2,6 +2,8 @@ @setfilename ../../info/dbus @c %**start of header @settitle Using of D-Bus +@documentencoding UTF-8 +@documentlanguage en @c @setchapternewpage odd @c %**end of header === modified file 'doc/misc/dired-x.texi' --- doc/misc/dired-x.texi 2013-10-23 17:20:09 +0000 +++ doc/misc/dired-x.texi 2013-12-30 03:19:25 +0000 @@ -9,6 +9,8 @@ @comment %**start of header (This is for running Texinfo on a region.) @setfilename ../../info/dired-x @settitle Dired Extra User's Manual +@documentencoding UTF-8 +@documentlanguage en @include emacsver.texi === modified file 'doc/misc/ebrowse.texi' --- doc/misc/ebrowse.texi 2013-10-23 17:20:09 +0000 +++ doc/misc/ebrowse.texi 2013-12-30 03:19:25 +0000 @@ -3,6 +3,8 @@ @comment %**start of header @setfilename ../../info/ebrowse @settitle A Class Browser for C++ +@documentencoding UTF-8 +@documentlanguage en @setchapternewpage odd @syncodeindex fn cp @comment %**end of header === modified file 'doc/misc/ede.texi' --- doc/misc/ede.texi 2013-10-23 17:20:09 +0000 +++ doc/misc/ede.texi 2013-12-30 03:19:25 +0000 @@ -1,6 +1,8 @@ \input texinfo @setfilename ../../info/ede @settitle Emacs Development Environment +@documentencoding UTF-8 +@documentlanguage en @copying This file describes EDE, the Emacs Development Environment. === modified file 'doc/misc/ediff.texi' --- doc/misc/ediff.texi 2013-12-12 03:37:38 +0000 +++ doc/misc/ediff.texi 2013-12-30 03:19:25 +0000 @@ -10,6 +10,8 @@ @setfilename ../../info/ediff @settitle Ediff User's Manual +@documentencoding UTF-8 +@documentlanguage en @synindex vr cp @synindex fn cp @synindex pg cp === modified file 'doc/misc/edt.texi' --- doc/misc/edt.texi 2013-08-13 06:55:21 +0000 +++ doc/misc/edt.texi 2013-12-30 03:19:25 +0000 @@ -1,6 +1,8 @@ \input texinfo @setfilename ../../info/edt @settitle EDT Emulation for Emacs +@documentencoding UTF-8 +@documentlanguage en @copying This file documents the EDT emulation package for Emacs. === modified file 'doc/misc/efaq-w32.texi' --- doc/misc/efaq-w32.texi 2013-08-27 08:14:58 +0000 +++ doc/misc/efaq-w32.texi 2013-12-30 03:19:25 +0000 @@ -162,7 +162,7 @@ Emacs binaries are distributed as zip files, digitally signed by the developer who built them. Generally most users will want the file @file{emacs-@value{EMACSVER}-bin-i386.zip}, which -contains everything you need to get started. +contains everything you need to get started. @cindex where to get sources @cindex Emacs source code @@ -286,7 +286,7 @@ The command to unpack a source distribution from the command line is: @example -tar xzf emacs-@value{EMACSVER}.tar.gz +tar xzf emacs-@value{EMACSVER}.tar.gz @end example If this does not work with the versions of tar and gzip that you have, @@ -573,9 +573,9 @@ Subject: Re: Re[2]: problem with caps/ctrl swap on NT 4.0 @end ignore @example -It's a binary value that lets you map keystrokes in the low-level keyboard -drivers in NT. As a result you don't have to worry about applications -bypassing mappings that you've done at a higher level (i.e. it just works). +It's a binary value that lets you map keystrokes in the low-level keyboard +drivers in NT. As a result you don't have to worry about applications +bypassing mappings that you've done at a higher level (i.e. it just works). Here's the format of the value: @@ -587,11 +587,11 @@ DWORD: mapping n DWORD: 0x00000000 terminating null DWORD -Each mapping DWORD has two parts: the input scancode, and an output -scancode. To map scancode 0x1d (left control) to scancode 0x3a (caps -lock), you want a value of 0x003a001d. Note that this does not swap the -keys. Using just this mapping value, both the left control and the caps -lock key will behave as caps-lock. To swap, you also need to map 0x3a to +Each mapping DWORD has two parts: the input scancode, and an output +scancode. To map scancode 0x1d (left control) to scancode 0x3a (caps +lock), you want a value of 0x003a001d. Note that this does not swap the +keys. Using just this mapping value, both the left control and the caps +lock key will behave as caps-lock. To swap, you also need to map 0x3a to 0x1d, using 0x001d003a. This registry value is system wide, and can't be made user-specific. It @@ -1426,7 +1426,7 @@ You can start an interactive shell in Emacs by typing @kbd{M-x shell}. Emacs uses the @env{SHELL} environment variable to determine which program to use as the shell. To instruct Emacs to use a non-default -shell, you can either set this environment variable, or customize +shell, you can either set this environment variable, or customize @code{explicit-shell-file-name}. You can also customize @code{shell-file-name} to change the shell that will be used by subprocesses that are started with @code{shell-command} and === modified file 'doc/misc/efaq.texi' --- doc/misc/efaq.texi 2013-08-27 19:40:24 +0000 +++ doc/misc/efaq.texi 2013-12-30 03:19:25 +0000 @@ -2,6 +2,8 @@ @c %**start of header @setfilename ../../info/efaq @settitle GNU Emacs FAQ +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @include emacsver.texi === modified file 'doc/misc/eieio.texi' --- doc/misc/eieio.texi 2013-10-23 17:20:09 +0000 +++ doc/misc/eieio.texi 2013-12-30 03:19:25 +0000 @@ -3,6 +3,8 @@ @set TITLE Enhanced Implementation of Emacs Interpreted Objects @set AUTHOR Eric M. Ludlam @settitle @value{TITLE} +@documentencoding UTF-8 +@documentlanguage en @c ************************************************************************* @c @ Header === modified file 'doc/misc/emacs-gnutls.texi' --- doc/misc/emacs-gnutls.texi 2013-12-23 12:50:47 +0000 +++ doc/misc/emacs-gnutls.texi 2013-12-30 03:19:25 +0000 @@ -4,6 +4,8 @@ @setfilename ../../info/emacs-gnutls @settitle Emacs GnuTLS Integration @value{VERSION} +@documentencoding UTF-8 +@documentlanguage en @copying This file describes the Emacs GnuTLS integration. === modified file 'doc/misc/emacs-mime.texi' --- doc/misc/emacs-mime.texi 2013-08-19 05:10:33 +0000 +++ doc/misc/emacs-mime.texi 2013-12-30 03:19:25 +0000 @@ -26,8 +26,8 @@ @end quotation @end copying -@c Node ``Interface Functions'' uses non-ASCII characters @documentencoding UTF-8 +@documentlanguage en @dircategory Emacs lisp libraries @direntry === modified file 'doc/misc/epa.texi' --- doc/misc/epa.texi 2013-11-08 08:49:40 +0000 +++ doc/misc/epa.texi 2013-12-30 03:19:25 +0000 @@ -2,6 +2,8 @@ @c %**start of header @setfilename ../../info/epa @settitle EasyPG Assistant User's Manual +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @set VERSION 1.0.0 === modified file 'doc/misc/erc.texi' --- doc/misc/erc.texi 2013-07-25 07:10:56 +0000 +++ doc/misc/erc.texi 2013-12-30 03:19:25 +0000 @@ -4,6 +4,8 @@ @settitle ERC Manual @syncodeindex fn cp @include emacsver.texi +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @copying === modified file 'doc/misc/ert.texi' --- doc/misc/ert.texi 2013-12-12 03:37:38 +0000 +++ doc/misc/ert.texi 2013-12-30 03:19:25 +0000 @@ -2,6 +2,8 @@ @c %**start of header @setfilename ../../info/ert @settitle Emacs Lisp Regression Testing +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @dircategory Emacs misc features === modified file 'doc/misc/eshell.texi' --- doc/misc/eshell.texi 2013-10-23 17:20:09 +0000 +++ doc/misc/eshell.texi 2013-12-30 03:19:25 +0000 @@ -4,6 +4,8 @@ @settitle Eshell: The Emacs Shell @defindex cm @synindex vr fn +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @copying === modified file 'doc/misc/eudc.texi' --- doc/misc/eudc.texi 2013-07-06 01:39:21 +0000 +++ doc/misc/eudc.texi 2013-12-30 03:19:25 +0000 @@ -3,6 +3,8 @@ @setfilename ../../info/eudc @settitle Emacs Unified Directory Client (EUDC) Manual @afourpaper +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @copying === modified file 'doc/misc/flymake.texi' --- doc/misc/flymake.texi 2013-06-21 14:36:13 +0000 +++ doc/misc/flymake.texi 2013-12-30 03:19:25 +0000 @@ -5,6 +5,8 @@ @set UPDATED April 2004 @settitle GNU Flymake @value{VERSION} @syncodeindex pg cp +@documentencoding UTF-8 +@documentlanguage en @comment %**end of header @copying === modified file 'doc/misc/forms.texi' --- doc/misc/forms.texi 2013-02-12 17:36:54 +0000 +++ doc/misc/forms.texi 2013-12-30 03:19:25 +0000 @@ -14,6 +14,8 @@ @end iftex @c @smallbook @comment %**end of header (This is for running Texinfo on a region.) +@documentencoding UTF-8 +@documentlanguage en @copying This file documents Forms mode, a form-editing major mode for GNU Emacs. === modified file 'doc/misc/gnus-coding.texi' --- doc/misc/gnus-coding.texi 2013-03-07 07:28:51 +0000 +++ doc/misc/gnus-coding.texi 2013-12-30 03:19:25 +0000 @@ -2,6 +2,8 @@ @setfilename gnus-coding @settitle Gnus Coding Style and Maintenance Guide +@documentencoding UTF-8 +@documentlanguage en @syncodeindex fn cp @syncodeindex vr cp @syncodeindex pg cp === modified file 'doc/misc/gnus-faq.texi' --- doc/misc/gnus-faq.texi 2013-07-06 23:40:56 +0000 +++ doc/misc/gnus-faq.texi 2013-12-30 03:19:25 +0000 @@ -5,6 +5,8 @@ @c @c @setfilename gnus-faq.info @c @settitle Frequently Asked Questions +@c @documentencoding UTF-8 +@c @documentlanguage en @c %**end of header @c === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2013-10-13 00:31:19 +0000 +++ doc/misc/gnus.texi 2013-12-30 03:19:25 +0000 @@ -9,6 +9,7 @@ @syncodeindex pg cp @documentencoding UTF-8 +@documentlanguage en @copying Copyright @copyright{} 1995--2013 Free Software Foundation, Inc. === modified file 'doc/misc/htmlfontify.texi' --- doc/misc/htmlfontify.texi 2013-12-12 03:37:38 +0000 +++ doc/misc/htmlfontify.texi 2013-12-30 03:19:25 +0000 @@ -3,6 +3,8 @@ @setfilename ../../info/htmlfontify @settitle Htmlfontify User Manual @exampleindent 2 +@documentencoding UTF-8 +@documentlanguage en @comment %**end of header @copying === modified file 'doc/misc/idlwave.texi' --- doc/misc/idlwave.texi 2013-02-13 04:31:09 +0000 +++ doc/misc/idlwave.texi 2013-12-30 03:19:25 +0000 @@ -12,6 +12,8 @@ @set DATE April, 2007 @set AUTHOR J.D. Smith & Carsten Dominik @set MAINTAINER J.D. Smith +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @finalout === modified file 'doc/misc/ido.texi' --- doc/misc/ido.texi 2013-12-12 03:37:38 +0000 +++ doc/misc/ido.texi 2013-12-30 03:19:25 +0000 @@ -1,6 +1,8 @@ \input texinfo @c -*-texinfo-*- @setfilename ../../info/ido @settitle Interactive Do +@documentencoding UTF-8 +@documentlanguage en @include emacsver.texi @copying === modified file 'doc/misc/info.texi' --- doc/misc/info.texi 2013-12-20 16:03:12 +0000 +++ doc/misc/info.texi 2013-12-30 03:19:25 +0000 @@ -8,6 +8,8 @@ @syncodeindex fn cp @syncodeindex vr cp @syncodeindex ky cp +@documentencoding UTF-8 +@documentlanguage en @comment %**end of header @copying === modified file 'doc/misc/mairix-el.texi' --- doc/misc/mairix-el.texi 2013-08-13 07:02:00 +0000 +++ doc/misc/mairix-el.texi 2013-12-30 03:19:25 +0000 @@ -4,6 +4,7 @@ @settitle Emacs Interface for Mairix @documentencoding UTF-8 +@documentlanguage en @copying Copyright @copyright{} 2008--2013 Free Software Foundation, Inc. === modified file 'doc/misc/message.texi' --- doc/misc/message.texi 2013-02-13 08:50:44 +0000 +++ doc/misc/message.texi 2013-12-30 03:19:25 +0000 @@ -4,6 +4,8 @@ @setfilename ../../info/message @settitle Message Manual +@documentencoding UTF-8 +@documentlanguage en @synindex fn cp @synindex vr cp @synindex pg cp === modified file 'doc/misc/mh-e.texi' --- doc/misc/mh-e.texi 2013-07-06 01:39:21 +0000 +++ doc/misc/mh-e.texi 2013-12-30 03:19:25 +0000 @@ -5,6 +5,8 @@ @c %**start of header @setfilename ../../info/mh-e @settitle The MH-E Manual +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @c Version of the software and manual. === modified file 'doc/misc/newsticker.texi' --- doc/misc/newsticker.texi 2013-08-07 12:44:16 +0000 +++ doc/misc/newsticker.texi 2013-12-30 03:19:25 +0000 @@ -7,6 +7,8 @@ @syncodeindex vr cp @syncodeindex fn cp @syncodeindex pg cp +@documentencoding UTF-8 +@documentlanguage en @comment %**end of header @copying === modified file 'doc/misc/nxml-mode.texi' --- doc/misc/nxml-mode.texi 2013-07-04 01:53:56 +0000 +++ doc/misc/nxml-mode.texi 2013-12-30 03:19:25 +0000 @@ -2,6 +2,8 @@ @c %**start of header @setfilename ../../info/nxml-mode @settitle nXML Mode +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @copying === modified file 'doc/misc/octave-mode.texi' --- doc/misc/octave-mode.texi 2013-12-12 03:37:38 +0000 +++ doc/misc/octave-mode.texi 2013-12-30 03:19:25 +0000 @@ -2,6 +2,8 @@ @c %**start of header @setfilename ../../info/octave-mode @settitle Octave Mode +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @copying === modified file 'doc/misc/org.texi' --- doc/misc/org.texi 2013-12-12 03:37:38 +0000 +++ doc/misc/org.texi 2013-12-30 03:19:25 +0000 @@ -15,6 +15,8 @@ @set MAINTAINER Carsten Dominik @set MAINTAINEREMAIL @email{carsten at orgmode dot org} @set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer} +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @finalout === modified file 'doc/misc/pcl-cvs.texi' --- doc/misc/pcl-cvs.texi 2013-10-23 17:20:09 +0000 +++ doc/misc/pcl-cvs.texi 2013-12-30 03:19:25 +0000 @@ -3,6 +3,8 @@ @setfilename ../../info/pcl-cvs @settitle PCL-CVS---Emacs Front-End to CVS @syncodeindex vr fn +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @copying === modified file 'doc/misc/pgg.texi' --- doc/misc/pgg.texi 2013-07-03 06:42:43 +0000 +++ doc/misc/pgg.texi 2013-12-30 03:19:25 +0000 @@ -7,6 +7,9 @@ @set VERSION 0.1 @settitle PGG @value{VERSION} +@documentencoding UTF-8 +@documentlanguage en + @copying This file describes PGG @value{VERSION}, an Emacs interface to various PGP implementations. === modified file 'doc/misc/rcirc.texi' --- doc/misc/rcirc.texi 2013-01-02 16:13:04 +0000 +++ doc/misc/rcirc.texi 2013-12-30 03:19:25 +0000 @@ -2,6 +2,8 @@ @c %**start of header @setfilename ../../info/rcirc @settitle rcirc Manual +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @copying === modified file 'doc/misc/reftex.texi' --- doc/misc/reftex.texi 2013-08-13 07:02:00 +0000 +++ doc/misc/reftex.texi 2013-12-30 03:19:25 +0000 @@ -2,6 +2,8 @@ @c %**start of header @setfilename ../../info/reftex @settitle RefTeX User Manual +@documentencoding UTF-8 +@documentlanguage en @synindex ky cp @syncodeindex vr cp @syncodeindex fn cp === modified file 'doc/misc/remember.texi' --- doc/misc/remember.texi 2013-02-13 04:31:09 +0000 +++ doc/misc/remember.texi 2013-12-30 03:19:25 +0000 @@ -3,6 +3,8 @@ @setfilename ../../info/remember @settitle Remember Manual @syncodeindex fn cp +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @copying === modified file 'doc/misc/sasl.texi' --- doc/misc/sasl.texi 2013-01-01 09:11:05 +0000 +++ doc/misc/sasl.texi 2013-12-30 03:19:25 +0000 @@ -7,6 +7,9 @@ @set VERSION 0.2 @settitle Emacs SASL Library @value{VERSION} +@documentencoding UTF-8 +@documentlanguage en + @copying This file describes the Emacs SASL library, version @value{VERSION}. === modified file 'doc/misc/sc.texi' --- doc/misc/sc.texi 2013-10-23 17:20:09 +0000 +++ doc/misc/sc.texi 2013-12-30 03:19:25 +0000 @@ -3,6 +3,8 @@ @comment %**start of header (This is for running Texinfo on a region.) @setfilename ../../info/sc @settitle Supercite User's Manual +@documentencoding UTF-8 +@documentlanguage en @iftex @finalout @end iftex === modified file 'doc/misc/semantic.texi' --- doc/misc/semantic.texi 2013-02-22 17:13:05 +0000 +++ doc/misc/semantic.texi 2013-12-30 03:19:25 +0000 @@ -3,6 +3,8 @@ @set TITLE Semantic Manual @set AUTHOR Eric M. Ludlam, David Ponce, and Richard Y. Kim @settitle @value{TITLE} +@documentencoding UTF-8 +@documentlanguage en @c ************************************************************************* @c @ Header === modified file 'doc/misc/ses.texi' --- doc/misc/ses.texi 2013-11-20 08:52:15 +0000 +++ doc/misc/ses.texi 2013-12-30 03:19:25 +0000 @@ -6,6 +6,8 @@ @syncodeindex fn cp @syncodeindex vr cp @syncodeindex ky cp +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @copying === modified file 'doc/misc/sieve.texi' --- doc/misc/sieve.texi 2013-06-14 09:48:49 +0000 +++ doc/misc/sieve.texi 2013-12-30 03:19:25 +0000 @@ -4,6 +4,8 @@ @setfilename ../../info/sieve @settitle Emacs Sieve Manual +@documentencoding UTF-8 +@documentlanguage en @synindex fn cp @synindex vr cp @synindex pg cp === modified file 'doc/misc/smtpmail.texi' --- doc/misc/smtpmail.texi 2013-01-05 16:19:53 +0000 +++ doc/misc/smtpmail.texi 2013-12-30 03:19:25 +0000 @@ -1,6 +1,8 @@ \input texinfo @c -*-texinfo-*- @setfilename ../../info/smtpmail @settitle Emacs SMTP Library +@documentencoding UTF-8 +@documentlanguage en @syncodeindex vr fn @copying Copyright @copyright{} 2003--2013 Free Software Foundation, Inc. === modified file 'doc/misc/speedbar.texi' --- doc/misc/speedbar.texi 2013-02-22 17:13:05 +0000 +++ doc/misc/speedbar.texi 2013-12-30 03:19:25 +0000 @@ -1,6 +1,8 @@ \input texinfo @c -*-texinfo-*- @setfilename ../../info/speedbar @settitle Speedbar: File/Tag summarizing utility +@documentencoding UTF-8 +@documentlanguage en @syncodeindex fn cp @copying === modified file 'doc/misc/srecode.texi' --- doc/misc/srecode.texi 2013-12-12 03:37:38 +0000 +++ doc/misc/srecode.texi 2013-12-30 03:19:25 +0000 @@ -4,6 +4,8 @@ @set TITLE SRecoder Manual @set AUTHOR Eric M. Ludlam @settitle @value{TITLE} +@documentencoding UTF-8 +@documentlanguage en @c Merge all indexes into a single index for now. @c We can always separate them later into two or more as needed. === modified file 'doc/misc/todo-mode.texi' --- doc/misc/todo-mode.texi 2013-12-12 03:37:38 +0000 +++ doc/misc/todo-mode.texi 2013-12-30 03:19:25 +0000 @@ -5,6 +5,8 @@ @syncodeindex fn cp @syncodeindex vr cp @syncodeindex ky cp +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @copying === modified file 'doc/misc/tramp.texi' --- doc/misc/tramp.texi 2013-12-12 09:57:56 +0000 +++ doc/misc/tramp.texi 2013-12-30 03:19:25 +0000 @@ -2,6 +2,8 @@ @setfilename ../../info/tramp @c %**start of header @settitle TRAMP User Manual +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @c This is *so* much nicer :) === modified file 'doc/misc/url.texi' --- doc/misc/url.texi 2013-07-03 03:20:04 +0000 +++ doc/misc/url.texi 2013-12-30 03:19:25 +0000 @@ -2,6 +2,9 @@ @setfilename ../../info/url @settitle URL Programmer's Manual +@documentencoding UTF-8 +@documentlanguage en + @iftex @c @finalout @end iftex === modified file 'doc/misc/vip.texi' --- doc/misc/vip.texi 2013-10-23 17:20:09 +0000 +++ doc/misc/vip.texi 2013-12-30 03:19:25 +0000 @@ -2,6 +2,9 @@ @setfilename ../../info/vip @settitle VIP +@documentencoding UTF-8 +@documentlanguage en + @copying Copyright @copyright{} 1987, 2001--2013 Free Software Foundation, Inc. === modified file 'doc/misc/viper.texi' --- doc/misc/viper.texi 2013-10-23 17:20:09 +0000 +++ doc/misc/viper.texi 2013-12-30 03:19:25 +0000 @@ -6,6 +6,9 @@ @comment @setfilename viper.info @setfilename ../../info/viper +@documentencoding UTF-8 +@documentlanguage en + @copying Copyright @copyright{} 1995--1997, 2001--2013 Free Software Foundation, Inc. === modified file 'doc/misc/widget.texi' --- doc/misc/widget.texi 2013-10-23 17:20:09 +0000 +++ doc/misc/widget.texi 2013-12-30 03:19:25 +0000 @@ -5,6 +5,8 @@ @syncodeindex fn cp @syncodeindex vr cp @syncodeindex ky cp +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @copying === modified file 'doc/misc/wisent.texi' --- doc/misc/wisent.texi 2013-07-06 01:39:21 +0000 +++ doc/misc/wisent.texi 2013-12-30 03:19:25 +0000 @@ -20,6 +20,8 @@ @c @footnotestyle separate @c @paragraphindent 2 @c @@smallbook +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @copying === modified file 'doc/misc/woman.texi' --- doc/misc/woman.texi 2013-12-22 23:13:18 +0000 +++ doc/misc/woman.texi 2013-12-30 03:19:25 +0000 @@ -8,6 +8,8 @@ @c Look for @page and @need commands. @setchapternewpage off @paragraphindent 0 +@documentencoding UTF-8 +@documentlanguage en @c %**end of header @copying ------------------------------------------------------------ revno: 115806 committer: Glenn Morris branch nick: trunk timestamp: Sun 2013-12-29 19:08:09 -0800 message: * emacs-lisp-intro.texi: Use @quotation for license notice. diff: === modified file 'doc/lispintro/ChangeLog' --- doc/lispintro/ChangeLog 2013-12-12 22:41:31 +0000 +++ doc/lispintro/ChangeLog 2013-12-30 03:08:09 +0000 @@ -1,3 +1,7 @@ +2013-12-30 Glenn Morris + + * emacs-lisp-intro.texi: Use @quotation for license notice. + 2013-12-12 Glenn Morris * emacs-lisp-intro.texi: Tweak dircategory. === modified file 'doc/lispintro/emacs-lisp-intro.texi' --- doc/lispintro/emacs-lisp-intro.texi 2013-12-12 22:41:31 +0000 +++ doc/lispintro/emacs-lisp-intro.texi 2013-12-30 03:08:09 +0000 @@ -141,6 +141,7 @@ @sp 1 ISBN 1-882114-43-4 +@quotation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; there @@ -152,6 +153,7 @@ (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and modify this GNU manual. Buying copies from the FSF supports it in developing GNU and promoting software freedom.'' +@end quotation @end copying @c half title; two lines here, so do not use `shorttitlepage' ------------------------------------------------------------ revno: 115805 fixes bug: http://debbugs.gnu.org/16133 committer: Paul Eggert branch nick: trunk timestamp: Sun 2013-12-29 10:18:45 -0800 message: Plain copy-file no longer chmods an existing destination. * doc/lispref/files.texi (Changing Files): Document this. * etc/NEWS: Document this. * src/fileio.c (realmask): Now a static var, not a local. (barf_or_query_if_file_exists): New arg KNOWN_TO_EXIST. Remove arg STATPTR. All uses changed. (Fcopy_file): Do not alter permissions of existing destinations, unless PRESERVE-PERMISSIONS (renamed from PRESERVE-EXTENDED-ATTRIBUTES) is non-nil. Avoid race when testing for existing destinations and for when input and output files are the same. If changing the group fails, adjust both default and preserved permissions so that access is not granted to the wrong group. (Fset_default_file_modes, init_fileio): Update realmask. (Fdefault_file_modes): Use realmask instead of calling umask. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-12-28 04:30:19 +0000 +++ doc/lispref/ChangeLog 2013-12-29 18:18:45 +0000 @@ -1,3 +1,8 @@ +2013-12-29 Paul Eggert + + Plain copy-file no longer chmods an existing destination (Bug#16133). + * files.texi (Changing Files): Document this. + 2013-12-28 Chong Yidong * modes.texi (Auto Major Mode): Document interpreter-mode-alist === modified file 'doc/lispref/files.texi' --- doc/lispref/files.texi 2013-12-23 08:50:31 +0000 +++ doc/lispref/files.texi 2013-12-29 18:18:45 +0000 @@ -1563,8 +1563,6 @@ interactive call, a prefix argument specifies a non-@code{nil} value for @var{time}. -This function copies the file modes, too. - If argument @var{preserve-uid-gid} is @code{nil}, we let the operating system decide the user and group ownership of the new file (this is usually set to the user running Emacs). If @var{preserve-uid-gid} is @@ -1572,10 +1570,11 @@ file. This works only on some operating systems, and only if you have the correct permissions to do so. -If the optional argument @var{preserve-extended-attributes} is -non-@code{nil}, and Emacs has been built with the appropriate support, -this function attempts to copy the file's extended attributes, such as -its SELinux context and ACL entries (@pxref{File Attributes}). +If the optional argument @var{preserve-permissions} is non-@code{nil}, +this function copies the file's permissions, such as its file modes, +its SELinux context, and ACL entries (@pxref{File Attributes}). +Otherwise, if the destination is created its file permission bits are +those of the source, masked by the default file permissions. @end deffn @deffn Command make-symbolic-link filename newname &optional ok-if-exists === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-12-28 00:42:59 +0000 +++ etc/ChangeLog 2013-12-29 18:18:45 +0000 @@ -1,3 +1,8 @@ +2013-12-29 Paul Eggert + + Plain copy-file no longer chmods an existing destination (Bug#16133). + * NEWS: Document this. + 2013-12-26 João Távora * NEWS: Describe new features of Electric Pair mode. === modified file 'etc/NEWS' --- etc/NEWS 2013-12-28 04:30:19 +0000 +++ etc/NEWS 2013-12-29 18:18:45 +0000 @@ -952,6 +952,12 @@ `file-extended-attributes'. The attributes can be applied to another file using `set-file-extended-attributes'. +** By default `copy-file' no longer copies file permission bits to an +existing destination; and it sets the file permission bits of a newly +created destination to those of the source, masked by the default file +permissions. To copy the file permission bits, pass t as the +PRESERVE-PERMISSIONS argument of `copy-file'. + +++ ** `visited-file-modtime' now returns -1 for nonexistent files. Formerly it returned a list (-1 LOW USEC PSEC), but this was ambiguous @@ -1100,8 +1106,8 @@ +++ *** The 6th argument to `copy-file' has been renamed to -PRESERVE-EXTENDED-ATTRIBUTES as it now handles both SELinux context -and ACL entries. +PRESERVE-PERMISSIONS as it now handles ACL entries and the traditional +Unix file permission bits as well as SELinux context. +++ *** The function `file-ownership-preserved-p' now has an optional === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-28 22:56:58 +0000 +++ src/ChangeLog 2013-12-29 18:18:45 +0000 @@ -1,3 +1,20 @@ +2013-12-29 Paul Eggert + + Plain copy-file no longer chmods an existing destination (Bug#16133). + * fileio.c (realmask): Now a static var, not a local. + (barf_or_query_if_file_exists): New arg KNOWN_TO_EXIST. + Remove arg STATPTR. All uses changed. + (Fcopy_file): Do not alter permissions of existing destinations, + unless PRESERVE-PERMISSIONS (renamed from + PRESERVE-EXTENDED-ATTRIBUTES) is non-nil. + Avoid race when testing for existing destinations and for + when input and output files are the same. + If changing the group fails, adjust both default and + preserved permissions so that access is not granted to the + wrong group. + (Fset_default_file_modes, init_fileio): Update realmask. + (Fdefault_file_modes): Use realmask instead of calling umask. + 2013-12-28 Paul Eggert Fix pipe bug with OS X emacs --daemon (Bug#16262). === modified file 'src/fileio.c' --- src/fileio.c 2013-12-17 17:46:31 +0000 +++ src/fileio.c 2013-12-29 18:18:45 +0000 @@ -95,6 +95,9 @@ /* True during writing of auto-save files. */ static bool auto_saving; +/* Emacs's real umask. */ +static mode_t realmask; + /* Nonzero umask during creation of auto-save directories. */ static mode_t auto_saving_dir_umask; @@ -1858,20 +1861,16 @@ } /* Signal an error if the file ABSNAME already exists. + If KNOWN_TO_EXIST, the file is known to exist. + QUERYSTRING is a name for the action that is being considered + to alter the file. If INTERACTIVE, ask the user whether to proceed, and bypass the error if the user says to go ahead. - QUERYSTRING is a name for the action that is being considered - to alter the file. - - *STATPTR is used to store the stat information if the file exists. - If the file does not exist, STATPTR->st_mode is set to 0. - If STATPTR is null, we don't store into it. - If QUICK, ask for y or n, not yes or no. */ static void -barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring, - bool interactive, struct stat *statptr, +barf_or_query_if_file_exists (Lisp_Object absname, bool known_to_exist, + const char *querystring, bool interactive, bool quick) { Lisp_Object tem, encoded_filename; @@ -1880,14 +1879,16 @@ encoded_filename = ENCODE_FILE (absname); - /* `stat' is a good way to tell whether the file exists, - regardless of what access permissions it has. */ - if (lstat (SSDATA (encoded_filename), &statbuf) >= 0) + if (! known_to_exist && lstat (SSDATA (encoded_filename), &statbuf) == 0) { if (S_ISDIR (statbuf.st_mode)) xsignal2 (Qfile_error, build_string ("File is a directory"), absname); + known_to_exist = true; + } + if (known_to_exist) + { if (! interactive) xsignal2 (Qfile_already_exists, build_string ("File already exists"), absname); @@ -1902,15 +1903,7 @@ if (NILP (tem)) xsignal2 (Qfile_already_exists, build_string ("File already exists"), absname); - if (statptr) - *statptr = statbuf; - } - else - { - if (statptr) - statptr->st_mode = 0; - } - return; + } } DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 6, @@ -1937,16 +1930,21 @@ If PRESERVE-UID-GID is non-nil, we try to transfer the uid and gid of FILE to NEWNAME. -If PRESERVE-EXTENDED-ATTRIBUTES is non-nil, we try to copy additional -attributes of FILE to NEWNAME, such as its SELinux context and ACL -entries (depending on how Emacs was built). */) - (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists, Lisp_Object keep_time, Lisp_Object preserve_uid_gid, Lisp_Object preserve_extended_attributes) +If PRESERVE-PERMISSIONS is non-nil, copy permissions of FILE to NEWNAME; +this includes the file modes, along with ACL entries and SELinux +context if present. Otherwise, if NEWNAME is created its file +permission bits are those of FILE, masked by the default file +permissions. */) + (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists, + Lisp_Object keep_time, Lisp_Object preserve_uid_gid, + Lisp_Object preserve_permissions) { - struct stat out_st; Lisp_Object handler; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; ptrdiff_t count = SPECPDL_INDEX (); Lisp_Object encoded_file, encoded_newname; + bool already_exists = false; + mode_t new_mask; #if HAVE_LIBSELINUX security_context_t con; int conlength = 0; @@ -1981,22 +1979,20 @@ if (!NILP (handler)) RETURN_UNGCPRO (call7 (handler, Qcopy_file, file, newname, ok_if_already_exists, keep_time, preserve_uid_gid, - preserve_extended_attributes)); + preserve_permissions)); encoded_file = ENCODE_FILE (file); encoded_newname = ENCODE_FILE (newname); +#ifdef WINDOWSNT if (NILP (ok_if_already_exists) || INTEGERP (ok_if_already_exists)) - barf_or_query_if_file_exists (newname, "copy to it", - INTEGERP (ok_if_already_exists), &out_st, 0); - else if (stat (SSDATA (encoded_newname), &out_st) < 0) - out_st.st_mode = 0; + barf_or_query_if_file_exists (newname, false, "copy to it", + INTEGERP (ok_if_already_exists), false); -#ifdef WINDOWSNT result = w32_copy_file (SSDATA (encoded_file), SSDATA (encoded_newname), !NILP (keep_time), !NILP (preserve_uid_gid), - !NILP (preserve_extended_attributes)); + !NILP (preserve_permissions)); switch (result) { case -1: @@ -2022,7 +2018,7 @@ if (fstat (ifd, &st) != 0) report_file_error ("Input file status", file); - if (!NILP (preserve_extended_attributes)) + if (!NILP (preserve_permissions)) { #if HAVE_LIBSELINUX if (is_selinux_enabled ()) @@ -2034,32 +2030,44 @@ #endif } - if (out_st.st_mode != 0 - && st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino) - report_file_errno ("Input and output files are the same", - list2 (file, newname), 0); - /* We can copy only regular files. */ if (!S_ISREG (st.st_mode)) report_file_errno ("Non-regular file", file, S_ISDIR (st.st_mode) ? EISDIR : EINVAL); - { #ifndef MSDOS - int new_mask = st.st_mode & (!NILP (preserve_uid_gid) ? 0600 : 0666); + new_mask = st.st_mode & (!NILP (preserve_uid_gid) ? 0700 : 0777); #else - int new_mask = S_IREAD | S_IWRITE; + new_mask = S_IREAD | S_IWRITE; #endif - ofd = emacs_open (SSDATA (encoded_newname), - (O_WRONLY | O_TRUNC | O_CREAT - | (NILP (ok_if_already_exists) ? O_EXCL : 0)), - new_mask); - } + + ofd = emacs_open (SSDATA (encoded_newname), O_WRONLY | O_CREAT | O_EXCL, + new_mask); + if (ofd < 0 && errno == EEXIST) + { + if (NILP (ok_if_already_exists) || INTEGERP (ok_if_already_exists)) + barf_or_query_if_file_exists (newname, true, "copy to it", + INTEGERP (ok_if_already_exists), false); + already_exists = true; + ofd = emacs_open (SSDATA (encoded_newname), O_WRONLY, 0); + } if (ofd < 0) report_file_error ("Opening output file", newname); record_unwind_protect_int (close_file_unwind, ofd); + if (already_exists) + { + struct stat out_st; + if (fstat (ofd, &out_st) != 0) + report_file_error ("Output file status", newname); + if (st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino) + report_file_errno ("Input and output files are the same", + list2 (file, newname), 0); + if (ftruncate (ofd, 0) != 0) + report_file_error ("Truncating output file", newname); + } + immediate_quit = 1; QUIT; while ((n = emacs_read (ifd, buf, sizeof buf)) > 0) @@ -2071,26 +2079,41 @@ /* Preserve the original file permissions, and if requested, also its owner and group. */ { - mode_t mode_mask = 07777; + mode_t preserved_permissions = st.st_mode & 07777; + mode_t default_permissions = st.st_mode & 0777 & ~realmask; if (!NILP (preserve_uid_gid)) { /* Attempt to change owner and group. If that doesn't work attempt to change just the group, as that is sometimes allowed. Adjust the mode mask to eliminate setuid or setgid bits - that are inappropriate if the owner and group are wrong. */ + or group permissions bits that are inappropriate if the + owner or group are wrong. */ if (fchown (ofd, st.st_uid, st.st_gid) != 0) { - mode_mask &= ~06000; if (fchown (ofd, -1, st.st_gid) == 0) - mode_mask |= 02000; + preserved_permissions &= ~04000; + else + { + preserved_permissions &= ~06000; + + /* Copy the other bits to the group bits, since the + group is wrong. */ + preserved_permissions &= ~070; + preserved_permissions |= (preserved_permissions & 7) << 3; + default_permissions &= ~070; + default_permissions |= (default_permissions & 7) << 3; + } } } - switch (!NILP (preserve_extended_attributes) + switch (!NILP (preserve_permissions) ? qcopy_acl (SSDATA (encoded_file), ifd, SSDATA (encoded_newname), ofd, - st.st_mode & mode_mask) - : fchmod (ofd, st.st_mode & mode_mask)) + preserved_permissions) + : (already_exists + || (new_mask & ~realmask) == default_permissions) + ? 0 + : fchmod (ofd, default_permissions)) { case -2: report_file_error ("Copying permissions from", file); case -1: report_file_error ("Copying permissions to", newname); @@ -2307,8 +2330,8 @@ #endif if (NILP (ok_if_already_exists) || INTEGERP (ok_if_already_exists)) - barf_or_query_if_file_exists (newname, "rename to it", - INTEGERP (ok_if_already_exists), 0, 0); + barf_or_query_if_file_exists (newname, false, "rename to it", + INTEGERP (ok_if_already_exists), false); if (rename (SSDATA (encoded_file), SSDATA (encoded_newname)) < 0) { int rename_errno = errno; @@ -2387,8 +2410,8 @@ if (NILP (ok_if_already_exists) || INTEGERP (ok_if_already_exists)) - barf_or_query_if_file_exists (newname, "make it a new name", - INTEGERP (ok_if_already_exists), 0, 0); + barf_or_query_if_file_exists (newname, false, "make it a new name", + INTEGERP (ok_if_already_exists), false); unlink (SSDATA (newname)); if (link (SSDATA (encoded_file), SSDATA (encoded_newname)) < 0) @@ -2449,8 +2472,8 @@ if (NILP (ok_if_already_exists) || INTEGERP (ok_if_already_exists)) - barf_or_query_if_file_exists (linkname, "make it a link", - INTEGERP (ok_if_already_exists), 0, 0); + barf_or_query_if_file_exists (linkname, false, "make it a link", + INTEGERP (ok_if_already_exists), false); if (symlink (SSDATA (encoded_filename), SSDATA (encoded_linkname)) < 0) { /* If we didn't complain already, silently delete existing file. */ @@ -3137,10 +3160,17 @@ This setting is inherited by subprocesses. */) (Lisp_Object mode) { + mode_t oldrealmask, oldumask, newumask; CHECK_NUMBER (mode); - - umask ((~ XINT (mode)) & 0777); - + oldrealmask = realmask; + newumask = ~ XINT (mode) & 0777; + + block_input (); + realmask = newumask; + oldumask = umask (newumask); + unblock_input (); + + eassert (oldumask == oldrealmask); return Qnil; } @@ -3149,14 +3179,7 @@ The value is an integer. */) (void) { - mode_t realmask; Lisp_Object value; - - block_input (); - realmask = umask (0); - umask (realmask); - unblock_input (); - XSETINT (value, (~ realmask) & 0777); return value; } @@ -4697,7 +4720,7 @@ filename = Fexpand_file_name (filename, Qnil); if (!NILP (mustbenew) && !EQ (mustbenew, Qexcl)) - barf_or_query_if_file_exists (filename, "overwrite", 1, 0, 1); + barf_or_query_if_file_exists (filename, false, "overwrite", true, true); if (STRINGP (visit)) visit_file = Fexpand_file_name (visit, Qnil); @@ -5765,6 +5788,9 @@ void init_fileio (void) { + realmask = umask (0); + umask (realmask); + valid_timestamp_file_system = 0; /* fsync can be a significant performance hit. Often it doesn't ------------------------------------------------------------ revno: 115804 committer: Jan D. branch nick: trunk timestamp: Sun 2013-12-29 14:17:09 +0100 message: * configure.ac (xcsdkdir): Only set if using xcrun. diff: === modified file 'ChangeLog' --- ChangeLog 2013-12-29 07:15:01 +0000 +++ ChangeLog 2013-12-29 13:17:09 +0000 @@ -1,3 +1,7 @@ +2013-12-29 Jan Djärv + + * configure.ac (xcsdkdir): Only set if using xcrun. + 2013-12-29 Paul Eggert * configure.ac (LIBXML2_CFLAGS): Fix xcrun-related quoting problem. === modified file 'configure.ac' --- configure.ac 2013-12-29 07:52:53 +0000 +++ configure.ac 2013-12-29 13:17:09 +0000 @@ -92,9 +92,9 @@ if test -z "$MAKE_PROG"; then MAKE="$XCRUN MAKE" export MAKE + xcsdkdir=`$XCRUN --show-sdk-path 2>/dev/null` fi fi - xcsdkdir=`$XCRUN --show-sdk-path 2>/dev/null` fi dnl Fairly arbitrary, older versions might work too. ------------------------------------------------------------ revno: 115803 committer: Paul Eggert branch nick: trunk timestamp: Sat 2013-12-28 23:52:53 -0800 message: Revert quoting of xcrun-related library. diff: === modified file 'configure.ac' --- configure.ac 2013-12-29 07:15:01 +0000 +++ configure.ac 2013-12-29 07:52:53 +0000 @@ -3296,7 +3296,7 @@ # Built-in libxml2 on OS X 10.8 lacks libxml-2.0.pc. if test "${HAVE_LIBXML2}" != "yes" -a "$opsys" = "darwin"; then SAVE_CPPFLAGS="$CPPFLAGS" - CPPFLAGS=$CPPFLAGS' -I"$xcsdkdir"/usr/include/libxml2' + CPPFLAGS="$CPPFLAGS -I$xcsdkdir/usr/include/libxml2" AC_CHECK_HEADER(libxml/HTMLparser.h, [AC_CHECK_DECL(HTML_PARSE_RECOVER, HAVE_LIBXML2=yes, , [#include ])])