]> git.eshelyaron.com Git - emacs.git/commitdiff
Say why quit is captured in insert-file-contents
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 20 Jul 2025 20:43:32 +0000 (13:43 -0700)
committerEshel Yaron <me@eshelyaron.com>
Fri, 25 Jul 2025 08:11:48 +0000 (10:11 +0200)
* src/fileio.c (Finsert_file_contents): Add comment.

(cherry picked from commit d04182d52ad275960bfacd7d9d3853f718c23a3b)

src/fileio.c

index 93ca8508ced91700c089a7e649450b936960d9f0..8f25facdcae2e12226e3f6a1fbce8953d7f075b7 100644 (file)
@@ -4901,7 +4901,8 @@ by calling `format-decode', which see.  */)
 
            /* Read from the file, capturing `quit'.  When an
               error occurs, end the loop, and arrange for a quit
-              to be signaled after decoding the text we read.  */
+              to be signaled after decoding the text we read.
+              This way, we do not lose any data read.  */
            union read_non_regular data
              = {{fd, buf == read_buf ? buf : NULL, inserted, bufsize}};
            nbytes = internal_condition_case_1
@@ -4920,7 +4921,8 @@ by calling `format-decode', which see.  */)
        else
          /* Allow quitting out of the actual I/O.  We don't make text
             part of the buffer until all the reading is done, so a
-            C-g here doesn't do any harm.  */
+            C-g here doesn't do any harm: though the data read are discarded,
+            the original data is still in the input file.  */
          {
            this = emacs_fd_read (fd, buf, bufsize);
            if (this < 0)