From a361f84426650fcaa24d2f2732ead4605f71ee64 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 20 Jul 2025 13:43:32 -0700 Subject: [PATCH] Say why quit is captured in insert-file-contents * src/fileio.c (Finsert_file_contents): Add comment. (cherry picked from commit d04182d52ad275960bfacd7d9d3853f718c23a3b) --- src/fileio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fileio.c b/src/fileio.c index 93ca8508ced..8f25facdcae 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -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) -- 2.39.5