diff options
| author | Paul Eggert | 2017-02-01 15:18:44 -0800 |
|---|---|---|
| committer | Paul Eggert | 2017-02-01 15:23:19 -0800 |
| commit | b4c9f9120d8b0da0593f2fbde69b40374f56451d (patch) | |
| tree | 8f40be80730a41e83e58e0632ff539ac752eb453 /src/sysdep.c | |
| parent | b01ac672be1277833964d2d53f6dd26560c70343 (diff) | |
| download | emacs-b4c9f9120d8b0da0593f2fbde69b40374f56451d.tar.gz emacs-b4c9f9120d8b0da0593f2fbde69b40374f56451d.zip | |
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) | |||
| 2508 | #endif | 2508 | #endif |
| 2509 | 2509 | ||
| 2510 | /* Read from FD to a buffer BUF with size NBYTE. | 2510 | /* Read from FD to a buffer BUF with size NBYTE. |
| 2511 | If interrupted, either quit or retry the read. | 2511 | If interrupted, process any quits and pending signals immediately |
| 2512 | Process any quits and pending signals immediately if INTERRUPTIBLE. | 2512 | if INTERRUPTIBLE, and then retry the read unless quitting. |
| 2513 | Return the number of bytes read, which might be less than NBYTE. | 2513 | Return the number of bytes read, which might be less than NBYTE. |
| 2514 | On error, set errno to a value other than EINTR, and return -1. */ | 2514 | On error, set errno to a value other than EINTR, and return -1. */ |
| 2515 | static ptrdiff_t | 2515 | static ptrdiff_t |
| 2516 | emacs_nointr_read (int fd, void *buf, ptrdiff_t nbyte, bool interruptible) | 2516 | emacs_intr_read (int fd, void *buf, ptrdiff_t nbyte, bool interruptible) |
| 2517 | { | 2517 | { |
| 2518 | ssize_t result; | 2518 | ssize_t result; |
| 2519 | 2519 | ||
| @@ -2537,14 +2537,14 @@ emacs_nointr_read (int fd, void *buf, ptrdiff_t nbyte, bool interruptible) | |||
| 2537 | ptrdiff_t | 2537 | ptrdiff_t |
| 2538 | emacs_read (int fd, void *buf, ptrdiff_t nbyte) | 2538 | emacs_read (int fd, void *buf, ptrdiff_t nbyte) |
| 2539 | { | 2539 | { |
| 2540 | return emacs_nointr_read (fd, buf, nbyte, false); | 2540 | return emacs_intr_read (fd, buf, nbyte, false); |
| 2541 | } | 2541 | } |
| 2542 | 2542 | ||
| 2543 | /* Like emacs_read, but also process quits and pending signals. */ | 2543 | /* Like emacs_read, but also process quits and pending signals. */ |
| 2544 | ptrdiff_t | 2544 | ptrdiff_t |
| 2545 | emacs_read_quit (int fd, void *buf, ptrdiff_t nbyte) | 2545 | emacs_read_quit (int fd, void *buf, ptrdiff_t nbyte) |
| 2546 | { | 2546 | { |
| 2547 | return emacs_nointr_read (fd, buf, nbyte, true); | 2547 | return emacs_intr_read (fd, buf, nbyte, true); |
| 2548 | } | 2548 | } |
| 2549 | 2549 | ||
| 2550 | /* Write to FILEDES from a buffer BUF with size NBYTE, retrying if | 2550 | /* Write to FILEDES from a buffer BUF with size NBYTE, retrying if |