diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-02-01 15:18:44 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-02-01 15:23:19 -0800 |
commit | b4c9f9120d8b0da0593f2fbde69b40374f56451d (patch) | |
tree | 8f40be80730a41e83e58e0632ff539ac752eb453 /src/sysdep.c | |
parent | b01ac672be1277833964d2d53f6dd26560c70343 (diff) | |
download | emacs-b4c9f9120d8b0da0593f2fbde69b40374f56451d.tar.gz |
Fix quitting bug when buffers are frozen
Problem noted by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00721.html
This patch also fixes some other issues in that report.
* src/lisp.h (incr_rarely_quit): Remove.
All callers changed to use rarely_quit directly.
* src/search.c (freeze_buffer_relocation)
(thaw_buffer_relocation): New functions.
(looking_at_1, fast_looking_at, search_buffer):
Use them to fix bug when quitting when buffers are frozen.
* src/sysdep.c (emacs_intr_read): Rename from emacs_nointr_read.
All uses changed.
Diffstat (limited to 'src/sysdep.c')
-rw-r--r-- | src/sysdep.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 4155c205712..91b2a5cb943 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2508,12 +2508,12 @@ emacs_close (int fd) #endif /* Read from FD to a buffer BUF with size NBYTE. - If interrupted, either quit or retry the read. - Process any quits and pending signals immediately if INTERRUPTIBLE. + If interrupted, process any quits and pending signals immediately + if INTERRUPTIBLE, and then retry the read unless quitting. Return the number of bytes read, which might be less than NBYTE. On error, set errno to a value other than EINTR, and return -1. */ static ptrdiff_t -emacs_nointr_read (int fd, void *buf, ptrdiff_t nbyte, bool interruptible) +emacs_intr_read (int fd, void *buf, ptrdiff_t nbyte, bool interruptible) { ssize_t result; @@ -2537,14 +2537,14 @@ emacs_nointr_read (int fd, void *buf, ptrdiff_t nbyte, bool interruptible) ptrdiff_t emacs_read (int fd, void *buf, ptrdiff_t nbyte) { - return emacs_nointr_read (fd, buf, nbyte, false); + return emacs_intr_read (fd, buf, nbyte, false); } /* Like emacs_read, but also process quits and pending signals. */ ptrdiff_t emacs_read_quit (int fd, void *buf, ptrdiff_t nbyte) { - return emacs_nointr_read (fd, buf, nbyte, true); + return emacs_intr_read (fd, buf, nbyte, true); } /* Write to FILEDES from a buffer BUF with size NBYTE, retrying if |