diff options
| author | Richard M. Stallman | 1998-01-01 06:35:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-01-01 06:35:47 +0000 |
| commit | d5d57b92e26ba3d1e188e0692ad6710af067e04e (patch) | |
| tree | 22181a16016c34501ae605090673d50b258fa7b8 /src | |
| parent | 6a140a74abd15b8f4a78bdc10e4095b6a41b91b1 (diff) | |
| download | emacs-d5d57b92e26ba3d1e188e0692ad6710af067e04e.tar.gz emacs-d5d57b92e26ba3d1e188e0692ad6710af067e04e.zip | |
(scan_newline): Always restore prev value of immediate_quit.
Diffstat (limited to 'src')
| -rw-r--r-- | src/search.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/search.c b/src/search.c index 82a64e900a9..1b045f80841 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -670,7 +670,7 @@ scan_buffer (target, start, end, count, shortage, allow_quit) | |||
| 670 | the limit we bumped up against. | 670 | the limit we bumped up against. |
| 671 | 671 | ||
| 672 | If ALLOW_QUIT is non-zero, set immediate_quit. That's good to do | 672 | If ALLOW_QUIT is non-zero, set immediate_quit. That's good to do |
| 673 | except when inside redisplay. */ | 673 | except in special cases. */ |
| 674 | 674 | ||
| 675 | int | 675 | int |
| 676 | scan_newline (start, start_byte, limit, limit_byte, count, allow_quit) | 676 | scan_newline (start, start_byte, limit, limit_byte, count, allow_quit) |
| @@ -687,6 +687,8 @@ scan_newline (start, start_byte, limit, limit_byte, count, allow_quit) | |||
| 687 | register int ceiling; | 687 | register int ceiling; |
| 688 | register unsigned char *ceiling_addr; | 688 | register unsigned char *ceiling_addr; |
| 689 | 689 | ||
| 690 | int old_immediate_quit = immediate_quit; | ||
| 691 | |||
| 690 | /* If we are not in selective display mode, | 692 | /* If we are not in selective display mode, |
| 691 | check only for newlines. */ | 693 | check only for newlines. */ |
| 692 | int selective_display = (!NILP (current_buffer->selective_display) | 694 | int selective_display = (!NILP (current_buffer->selective_display) |
| @@ -695,7 +697,8 @@ scan_newline (start, start_byte, limit, limit_byte, count, allow_quit) | |||
| 695 | /* The code that follows is like scan_buffer | 697 | /* The code that follows is like scan_buffer |
| 696 | but checks for either newline or carriage return. */ | 698 | but checks for either newline or carriage return. */ |
| 697 | 699 | ||
| 698 | immediate_quit = allow_quit; | 700 | if (allow_quit) |
| 701 | immediate_quit++; | ||
| 699 | 702 | ||
| 700 | start_byte = CHAR_TO_BYTE (start); | 703 | start_byte = CHAR_TO_BYTE (start); |
| 701 | 704 | ||
| @@ -716,7 +719,7 @@ scan_newline (start, start_byte, limit, limit_byte, count, allow_quit) | |||
| 716 | { | 719 | { |
| 717 | if (--count == 0) | 720 | if (--count == 0) |
| 718 | { | 721 | { |
| 719 | immediate_quit = 0; | 722 | immediate_quit = old_immediate_quit; |
| 720 | start_byte = start_byte + cursor - base + 1; | 723 | start_byte = start_byte + cursor - base + 1; |
| 721 | start = BYTE_TO_CHAR (start_byte); | 724 | start = BYTE_TO_CHAR (start_byte); |
| 722 | TEMP_SET_PT_BOTH (start, start_byte); | 725 | TEMP_SET_PT_BOTH (start, start_byte); |
| @@ -750,7 +753,7 @@ scan_newline (start, start_byte, limit, limit_byte, count, allow_quit) | |||
| 750 | { | 753 | { |
| 751 | if (++count == 0) | 754 | if (++count == 0) |
| 752 | { | 755 | { |
| 753 | immediate_quit = 0; | 756 | immediate_quit = old_immediate_quit; |
| 754 | /* Return the position AFTER the match we found. */ | 757 | /* Return the position AFTER the match we found. */ |
| 755 | start_byte = start_byte + cursor - base + 1; | 758 | start_byte = start_byte + cursor - base + 1; |
| 756 | start = BYTE_TO_CHAR (start_byte); | 759 | start = BYTE_TO_CHAR (start_byte); |
| @@ -768,6 +771,7 @@ scan_newline (start, start_byte, limit, limit_byte, count, allow_quit) | |||
| 768 | } | 771 | } |
| 769 | 772 | ||
| 770 | TEMP_SET_PT_BOTH (limit, limit_byte); | 773 | TEMP_SET_PT_BOTH (limit, limit_byte); |
| 774 | immediate_quit = old_immediate_quit; | ||
| 771 | 775 | ||
| 772 | return count * direction; | 776 | return count * direction; |
| 773 | } | 777 | } |