commit 5fd1f7f931163ddf04f0ba0c362840fc91fba54a (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Sat Sep 10 19:13:36 2016 -0700 * etc/NEWS: Remove comment lost in emacs-25 merge. diff --git a/etc/NEWS b/etc/NEWS index 82eb2b8..9b992d0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -15,6 +15,13 @@ and NEWS.1-17 for changes in older Emacs versions. You can narrow news to a specific version by calling 'view-emacs-news' with a prefix argument or by typing C-u C-h C-n. +Temporary note: ++++ indicates that all necessary documentation updates are complete. + (This means all relevant manuals in doc/ AND lisp doc-strings.) +--- means no change in the manuals is needed. +When you add a new item, use the appropriate mark if you are sure it applies, +otherwise leave it unmarked. + * Installation Changes in Emacs 25.2 commit 31407634f77c9e40bb3c3ca87013672528cffa57 Author: Paul Eggert Date: Sat Sep 10 19:12:21 2016 -0700 Document file synchronization issues * doc/lispref/files.texi (Files and Storage): New section. diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index f195a41..7bf4690 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1554,8 +1554,8 @@ delete-file}. @xref{VC Delete/Rename}. @findex copy-file @cindex copying files - @kbd{M-x copy-file} reads the file @var{old} and writes a new file -named @var{new} with the same contents. + @kbd{M-x copy-file} copies the contents of the file @var{old} to the +file @var{new}. @findex copy-directory @kbd{M-x copy-directory} copies directories, similar to the diff --git a/doc/lispref/backups.texi b/doc/lispref/backups.texi index b9e6466..35a1865 100644 --- a/doc/lispref/backups.texi +++ b/doc/lispref/backups.texi @@ -41,6 +41,11 @@ You can alternatively request numbered backups; then each new backup file gets a new name. You can delete old numbered backups when you don't want them any more, or Emacs can delete them automatically. + For performance, the operating system may not write the backup +file's contents to secondary storage immediately, or may alias the +backup data with the original until one or the other is later +modified. @xref{Files and Storage}. + @menu * Making Backups:: How Emacs makes backup files, and when. * Rename or Copy:: Two alternatives: renaming the old file or copying it. diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 0aea1df..b912d7b 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -41,6 +41,7 @@ to locale @code{system-messages-locale}, and decoded using coding system simultaneous editing by two people. * Information about Files:: Testing existence, accessibility, size of files. * Changing Files:: Renaming files, changing permissions, etc. +* Files and Storage:: Surviving power and media failures * File Names:: Decomposing and expanding file names. * Contents of Directories:: Getting a list of the files in a directory. * Create/Delete Dirs:: Creating and Deleting Directories. @@ -1496,6 +1497,10 @@ error if they fail to perform their function, reporting the system-dependent error message that describes the reason for the failure. + For performance, the operating system may cache or alias changes +made by these functions instead of writing them immediately to +secondary storage. @xref{Files and Storage}. + In the functions that have an argument @var{newname}, if a file by the name of @var{newname} already exists, the actions taken depend on the value of the argument @var{ok-if-already-exists}: @@ -1794,6 +1799,26 @@ The function returns @code{t} if it successfully sets the ACL of @var{filename}, @code{nil} otherwise. @end defun +@node Files and Storage +@section Files and Secondary Storage +@cindex secondary storage + +After Emacs changes a file, there are two reasons the changes might +not survive later failures of power or media, both having to do with +efficiency. First, the operating system might alias written data with +data already stored elsewhere on secondary storage until one file or +the other is later modified; this will lose both files if the only +copy on secondary storage is lost due to media failure. Second, the +operating system might not write data to secondary storage +immediately, which will lose the data if power is lost. + +Although both sorts of failures can largely be avoided by a suitably +configured file system, such systems are typically more expensive or +less efficient. In more-typical systems, to survive media failure you +can copy the file to a different device, and to survive a power +failure you can invoke the @command{sync} utility (@pxref{sync +invocation,,, coreutils, The @sc{gnu} @code{Coreutils} Manual}). + @node File Names @section File Names @cindex file names commit 9b21d9f9110445846dce25c3505c4ee04572fade Author: Paul Eggert Date: Sat Sep 10 12:51:27 2016 -0700 copy-file now uses GNU/Linux file cloning From a suggestion by Kieran Colford (see Bug#23904). * configure.ac: Check for linux/fs.h. * src/fileio.c [HAVE_LINUX_FS_H]: Include sys/ioctl.h and linux/fs.h. (clone_file): New function. (Fcopy_file): Use it. diff --git a/configure.ac b/configure.ac index 9856228..82a672b 100644 --- a/configure.ac +++ b/configure.ac @@ -1638,6 +1638,7 @@ fi dnl checks for header files AC_CHECK_HEADERS_ONCE( + linux/fs.h malloc.h sys/systeminfo.h sys/sysinfo.h diff --git a/src/fileio.c b/src/fileio.c index bf6bf62..b4316b3 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -52,6 +52,11 @@ along with GNU Emacs. If not, see . */ #include "region-cache.h" #include "frame.h" +#ifdef HAVE_LINUX_FS_H +# include +# include +#endif + #ifdef WINDOWSNT #define NOMINMAX 1 #include @@ -1829,6 +1834,16 @@ barf_or_query_if_file_exists (Lisp_Object absname, bool known_to_exist, } } +/* Copy data to DEST from SOURCE if possible. Return true if OK. */ +static bool +clone_file (int dest, int source) +{ +#ifdef FICLONE + return ioctl (dest, FICLONE, source) == 0; +#endif + return false; +} + DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 6, "fCopy file: \nGCopy %s to file: \np\nP", doc: /* Copy FILE to NEWNAME. Both args must be strings. @@ -1975,7 +1990,7 @@ permissions. */) record_unwind_protect_int (close_file_unwind, ofd); - off_t oldsize = 0, newsize = 0; + off_t oldsize = 0, newsize; if (already_exists) { @@ -1991,17 +2006,19 @@ permissions. */) immediate_quit = 1; QUIT; - while (true) + + if (clone_file (ofd, ifd)) + newsize = st.st_size; + else { char buf[MAX_ALLOCA]; - ptrdiff_t n = emacs_read (ifd, buf, sizeof buf); + ptrdiff_t n; + for (newsize = 0; 0 < (n = emacs_read (ifd, buf, sizeof buf)); + newsize += n) + if (emacs_write_sig (ofd, buf, n) != n) + report_file_error ("Write error", newname); if (n < 0) report_file_error ("Read error", file); - if (n == 0) - break; - if (emacs_write_sig (ofd, buf, n) != n) - report_file_error ("Write error", newname); - newsize += n; } /* Truncate any existing output file after writing the data. This commit 0fca290ddff9eabcd2e866b1361cd5b5ba868281 Author: Alan Third Date: Sat Sep 10 23:46:09 2016 +0100 Invert y coord of NS image files (bug#7847) * src/nsterm.m (ns_dumpglyphs_image): Invert y co-ordinate of the image when compositing. diff --git a/src/nsterm.m b/src/nsterm.m index ceda30b..26977e4 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3478,7 +3478,8 @@ Function modeled after x_draw_glyph_string_box (). { #ifdef NS_IMPL_COCOA NSRect dr = NSMakeRect (x, y, s->slice.width, s->slice.height); - NSRect ir = NSMakeRect (s->slice.x, s->slice.y, + NSRect ir = NSMakeRect (s->slice.x, + s->img->height - s->slice.y - s->slice.height, s->slice.width, s->slice.height); [img drawInRect: dr fromRect: ir commit 68f4b5292781bc331b040105c4079902b993835c Author: Noam Postavsky Date: Sat Sep 3 23:38:35 2016 -0400 Don't require isearch-update before isearch-done It is useful to be able to call `isearch-done' unconditionally to ensure a non-isearching state. * lisp/isearch.el (isearch-done): Check that `isearch--current-buffer' is a live buffer before using it (Bug #21091). * test/lisp/isearch-tests.el (isearch--test-done): Test it. diff --git a/lisp/isearch.el b/lisp/isearch.el index b50379a..39ed8af 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1045,9 +1045,10 @@ NOPUSH is t and EDIT is t." (remove-hook 'mouse-leave-buffer-hook 'isearch-done) (remove-hook 'kbd-macro-termination-hook 'isearch-done) (setq isearch-lazy-highlight-start nil) - (with-current-buffer isearch--current-buffer - (setq isearch--current-buffer nil) - (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit))) + (when (buffer-live-p isearch--current-buffer) + (with-current-buffer isearch--current-buffer + (setq isearch--current-buffer nil) + (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit)))) ;; Called by all commands that terminate isearch-mode. ;; If NOPUSH is non-nil, we don't push the string on the search ring. diff --git a/test/lisp/isearch-tests.el b/test/lisp/isearch-tests.el index 48c3424..52f312d 100644 --- a/test/lisp/isearch-tests.el +++ b/test/lisp/isearch-tests.el @@ -28,5 +28,13 @@ (isearch-update) (should (equal isearch--current-buffer (current-buffer))))) +(ert-deftest isearch--test-done () + ;; Normal operation. + (isearch-update) + (isearch-done) + (should-not isearch--current-buffer) + ;; Bug #21091: let `isearch-done' work without `isearch-update'. + (isearch-done)) + (provide 'isearch-tests) ;;; isearch-tests.el ends here