From: Po Lu Date: Mon, 24 Jul 2023 00:09:36 +0000 (+0800) Subject: Merge remote-tracking branch 'origin/master' into feature/android X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b7de14b56fac658411baeaede56416ad322fecfd;p=emacs.git Merge remote-tracking branch 'origin/master' into feature/android --- b7de14b56fac658411baeaede56416ad322fecfd diff --cc src/xdisp.c index ae9152847c1,e061b602e0d..174947c7f7e --- a/src/xdisp.c +++ b/src/xdisp.c @@@ -17626,42 -17498,14 +17626,49 @@@ mark_window_display_accurate_1 (struct else w->last_point = marker_position (w->pointm); + /* w->last_mark is recorded for text conversion purposes. + Input methods aren't interested in the value of the mark + if it is inactive, so set it to -1 if it's not. */ + + if (XMARKER (BVAR (b, mark))->buffer == b + && !NILP (BVAR (b, mark_active))) + w->last_mark = marker_position (BVAR (b, mark)); + else + w->last_mark = -1; + +#ifdef HAVE_TEXT_CONVERSION + /* See the description of this field in struct window. */ + w->ephemeral_last_point = w->last_point; + + /* Point motion is only propagated to the input method for use + in text conversion during a redisplay. While this can lead + to inconsistencies when point has moved but the change has + not yet been displayed, it leads to better results most of + the time, as point often changes within calls to + `save-excursion', and the only way to detect such calls is to + observe that the next redisplay never ends with those changes + applied. + + Changes to buffer text are immediately propagated to the + input method, and the position of point is also updated + during such a change, so the consequences are not that + severe. */ + + if ((prev_point != w->last_point + || prev_mark != w->last_mark) + && FRAME_WINDOW_P (WINDOW_XFRAME (w)) + && w == XWINDOW (WINDOW_XFRAME (w)->selected_window)) + report_point_change (WINDOW_XFRAME (w), w, b); +#endif /* HAVE_TEXT_CONVERSION */ + - w->window_end_valid = true; + struct glyph_row *row; + /* These conditions should be consistent with CHECK_WINDOW_END. */ + if (w->window_end_vpos < w->current_matrix->nrows + && ((row = MATRIX_ROW (w->current_matrix, w->window_end_vpos), + !row->enabled_p + || MATRIX_ROW_DISPLAYS_TEXT_P (row) + || MATRIX_ROW_VPOS (row, w->current_matrix) == 0))) + w->window_end_valid = true; w->update_mode_line = false; w->preserve_vscroll_p = false; }