diff options
| author | Glenn Morris | 2020-01-24 07:50:22 -0800 |
|---|---|---|
| committer | Glenn Morris | 2020-01-24 07:50:22 -0800 |
| commit | 635e55e81240b40fe587e3e2e9fa97550a63203b (patch) | |
| tree | 1aaa94548ad7045a921a44dbfcddae43ef425410 /src | |
| parent | d9385acac25ace1b41f34f120805ef14ccb93bd9 (diff) | |
| parent | 92f080dda8892861be7c175dc57f71dee0909d82 (diff) | |
| download | emacs-635e55e81240b40fe587e3e2e9fa97550a63203b.tar.gz emacs-635e55e81240b40fe587e3e2e9fa97550a63203b.zip | |
Merge from origin/emacs-27
92f080dda8 Tab-bar related finishing touches.
224e8d1464 Make call_process call signal_after_change. This fixes bu...
d02f2a793e * lisp/simple.el: Minor fixes to commentary.
196c42b8bf Fix a few typos
4f2b967795 Fix doc strings for image-dired rotation commands
# Conflicts:
# etc/NEWS
Diffstat (limited to 'src')
| -rw-r--r-- | src/callproc.c | 37 | ||||
| -rw-r--r-- | src/dispnew.c | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 4 |
3 files changed, 37 insertions, 6 deletions
diff --git a/src/callproc.c b/src/callproc.c index 52b89504205..6bd4ae22f63 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -746,6 +746,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 746 | int carryover = 0; | 746 | int carryover = 0; |
| 747 | bool display_on_the_fly = display_p; | 747 | bool display_on_the_fly = display_p; |
| 748 | struct coding_system saved_coding = process_coding; | 748 | struct coding_system saved_coding = process_coding; |
| 749 | ptrdiff_t prepared_pos = 0; /* prepare_to_modify_buffer was last | ||
| 750 | called here. */ | ||
| 749 | 751 | ||
| 750 | while (1) | 752 | while (1) |
| 751 | { | 753 | { |
| @@ -773,6 +775,33 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 773 | if (display_on_the_fly) | 775 | if (display_on_the_fly) |
| 774 | break; | 776 | break; |
| 775 | } | 777 | } |
| 778 | /* CHANGE FUNCTIONS | ||
| 779 | For each iteration of the enclosing while (1) loop which | ||
| 780 | yields data (i.e. nread > 0), before- and | ||
| 781 | after-change-functions are each invoked exactly once. | ||
| 782 | This is done directly from the current function only, by | ||
| 783 | calling prepare_to_modify_buffer and signal_after_change. | ||
| 784 | It is not done here by directing another function such as | ||
| 785 | insert_1_both to call them. The call to | ||
| 786 | prepare_to_modify_buffer follows this comment, and there | ||
| 787 | is one call to signal_after_change in each of the | ||
| 788 | branches of the next `else if'. | ||
| 789 | |||
| 790 | Exceptionally, the insertion into the buffer is aborted | ||
| 791 | at the call to del_range_2 ~45 lines further down, this | ||
| 792 | function removing the newly inserted data. At this stage | ||
| 793 | prepare_to_modify_buffer has been called, but | ||
| 794 | signal_after_change hasn't. A continue statement | ||
| 795 | restarts the enclosing while (1) loop. A second, | ||
| 796 | unwanted, call to `prepare_to_modify_buffer' is inhibited | ||
| 797 | by the test perpared_pos < PT. The data are inserted | ||
| 798 | again, and this time signal_after_change gets called, | ||
| 799 | balancing the previous call to prepare_to_modify_buffer. */ | ||
| 800 | if ((prepared_pos < PT) && nread) | ||
| 801 | { | ||
| 802 | prepare_to_modify_buffer (PT, PT, NULL); | ||
| 803 | prepared_pos = PT; | ||
| 804 | } | ||
| 776 | 805 | ||
| 777 | /* Now NREAD is the total amount of data in the buffer. */ | 806 | /* Now NREAD is the total amount of data in the buffer. */ |
| 778 | 807 | ||
| @@ -780,15 +809,16 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 780 | ; | 809 | ; |
| 781 | else if (NILP (BVAR (current_buffer, enable_multibyte_characters)) | 810 | else if (NILP (BVAR (current_buffer, enable_multibyte_characters)) |
| 782 | && ! CODING_MAY_REQUIRE_DECODING (&process_coding)) | 811 | && ! CODING_MAY_REQUIRE_DECODING (&process_coding)) |
| 783 | insert_1_both (buf, nread, nread, 0, 1, 0); | 812 | { |
| 813 | insert_1_both (buf, nread, nread, 0, 0, 0); | ||
| 814 | signal_after_change (PT, 0, nread); | ||
| 815 | } | ||
| 784 | else | 816 | else |
| 785 | { /* We have to decode the input. */ | 817 | { /* We have to decode the input. */ |
| 786 | Lisp_Object curbuf; | 818 | Lisp_Object curbuf; |
| 787 | ptrdiff_t count1 = SPECPDL_INDEX (); | 819 | ptrdiff_t count1 = SPECPDL_INDEX (); |
| 788 | 820 | ||
| 789 | XSETBUFFER (curbuf, current_buffer); | 821 | XSETBUFFER (curbuf, current_buffer); |
| 790 | /* FIXME: Call signal_after_change! */ | ||
| 791 | prepare_to_modify_buffer (PT, PT, NULL); | ||
| 792 | /* We cannot allow after-change-functions be run | 822 | /* We cannot allow after-change-functions be run |
| 793 | during decoding, because that might modify the | 823 | during decoding, because that might modify the |
| 794 | buffer, while we rely on process_coding.produced to | 824 | buffer, while we rely on process_coding.produced to |
| @@ -824,6 +854,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 824 | 854 | ||
| 825 | TEMP_SET_PT_BOTH (PT + process_coding.produced_char, | 855 | TEMP_SET_PT_BOTH (PT + process_coding.produced_char, |
| 826 | PT_BYTE + process_coding.produced); | 856 | PT_BYTE + process_coding.produced); |
| 857 | signal_after_change (PT, 0, process_coding.produced_char); | ||
| 827 | carryover = process_coding.carryover_bytes; | 858 | carryover = process_coding.carryover_bytes; |
| 828 | if (carryover > 0) | 859 | if (carryover > 0) |
| 829 | memcpy (buf, process_coding.carryover, | 860 | memcpy (buf, process_coding.carryover, |
diff --git a/src/dispnew.c b/src/dispnew.c index d094ca61798..d79ae836c56 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -4361,7 +4361,7 @@ scrolling_window (struct window *w, int tab_line_p) | |||
| 4361 | 4361 | ||
| 4362 | /* Can't scroll the display of w32 GUI frames when position of point | 4362 | /* Can't scroll the display of w32 GUI frames when position of point |
| 4363 | is indicated by the system caret, because scrolling the display | 4363 | is indicated by the system caret, because scrolling the display |
| 4364 | will then "copy" the pixles used by the caret. */ | 4364 | will then "copy" the pixels used by the caret. */ |
| 4365 | #ifdef HAVE_NTGUI | 4365 | #ifdef HAVE_NTGUI |
| 4366 | if (w32_use_visible_system_caret) | 4366 | if (w32_use_visible_system_caret) |
| 4367 | return 0; | 4367 | return 0; |
diff --git a/src/xdisp.c b/src/xdisp.c index a5efbb39bed..68a504fb2d4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -19193,7 +19193,7 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 19193 | 19193 | ||
| 19194 | /* Can't scroll the display of w32 GUI frames when position of point | 19194 | /* Can't scroll the display of w32 GUI frames when position of point |
| 19195 | is indicated by the system caret, because scrolling the display | 19195 | is indicated by the system caret, because scrolling the display |
| 19196 | will then "copy" the pixles used by the caret. */ | 19196 | will then "copy" the pixels used by the caret. */ |
| 19197 | #ifdef HAVE_NTGUI | 19197 | #ifdef HAVE_NTGUI |
| 19198 | if (w32_use_visible_system_caret) | 19198 | if (w32_use_visible_system_caret) |
| 19199 | return false; | 19199 | return false; |
| @@ -20185,7 +20185,7 @@ try_window_id (struct window *w) | |||
| 20185 | 20185 | ||
| 20186 | /* Can't let scroll_run_hook below run on w32 GUI frames when | 20186 | /* Can't let scroll_run_hook below run on w32 GUI frames when |
| 20187 | position of point is indicated by the system caret, because | 20187 | position of point is indicated by the system caret, because |
| 20188 | scrolling the display will then "copy" the pixles used by the | 20188 | scrolling the display will then "copy" the pixels used by the |
| 20189 | caret. */ | 20189 | caret. */ |
| 20190 | #ifdef HAVE_NTGUI | 20190 | #ifdef HAVE_NTGUI |
| 20191 | if (FRAME_W32_P (f) && w32_use_visible_system_caret) | 20191 | if (FRAME_W32_P (f) && w32_use_visible_system_caret) |