From b697bb91a1334e70bd7c8364e5ff6505b0edb21a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 13 Nov 2020 17:02:54 -0800 Subject: [PATCH 1/4] ; * .gitignore: src/fingerprint.c not generated since 2019-04-09. --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 014970f96b2..1271dec0df7 100644 --- a/.gitignore +++ b/.gitignore @@ -188,7 +188,6 @@ src/bootstrap-emacs src/emacs src/emacs-[0-9]* src/temacs -src/fingerprint.c src/dmpstruct.h src/*.pdmp From daff3bda10d15fe20f5f6e9c5f5ca60b97cf80df Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Nov 2020 13:43:16 +0200 Subject: [PATCH 2/4] Avoid crashes when a reversed glyph row starts with a composition * src/dispnew.c (build_frame_matrix_from_leaf_window): Add an assertion to prevent us from overwriting non-char glyphs with the vertical border glyph. * src/xdisp.c (extend_face_to_end_of_line): Account for one glyph possibly inserted by append_space_for_newline. (Bug#44506) Remove a kludgey correction for an off-by-one error in column counting, which is no longer needed. --- src/dispnew.c | 10 +++++++--- src/xdisp.c | 15 ++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index df55b32c718..7822829d648 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -2559,11 +2559,15 @@ build_frame_matrix_from_leaf_window (struct glyph_matrix *frame_matrix, struct w the corresponding frame row to be updated. */ frame_row->enabled_p = true; - /* Maybe insert a vertical border between horizontally adjacent + /* Maybe insert a vertical border between horizontally adjacent windows. */ - if (GLYPH_CHAR (right_border_glyph) != 0) + if (GLYPH_CHAR (right_border_glyph) != 0) { - struct glyph *border = window_row->glyphs[LAST_AREA] - 1; + struct glyph *border = window_row->glyphs[LAST_AREA] - 1; + /* It's a subtle bug if we are overwriting some non-char + glyph with the vertical border glyph. */ + eassert (border->type == CHAR_GLYPH); + border->type = CHAR_GLYPH; SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph); } diff --git a/src/xdisp.c b/src/xdisp.c index 71a5f1c34f0..681df093418 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22074,13 +22074,14 @@ extend_face_to_end_of_line (struct it *it) default_face->id : face->id); /* Display fill-column indicator if needed. */ - /* We need to subtract 1 to the indicator_column here because we - will add the indicator IN the column indicator number, not - after it. We compare the variable it->current_x before - producing the glyph. When FRAME_WINDOW_P we subtract - CHAR_WIDTH calculating STRETCH_WIDTH for the same reason. */ - const int indicator_column = - fill_column_indicator_column (it, 1) - 1; + const int indicator_column = fill_column_indicator_column (it, 1); + + /* Make sure our idea of current_x is in sync with the glyphs + actually in the glyph row. They might differ because + append_space_for_newline can insert one glyph without + updating current_x. */ + it->current_x = it->glyph_row->used[TEXT_AREA]; + do { if (it->current_x != indicator_column) From 5aabf2cc7f90a168fda694c6c5360f1df398255c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Nov 2020 13:56:12 +0200 Subject: [PATCH 3/4] Fix display of truncated R2L lines on TTY frames * src/xdisp.c (extend_face_to_end_of_line): Use a while-loop, not a do-while loop, to avoid appending an extra glyph at the end of a line that is one character shorter than the window-width. This is needed to fix display of reversed glyph rows that are almost as wide as the window, because append_space_for_newline already added one space glyph. --- src/xdisp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 681df093418..c9175a68a02 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22082,7 +22082,7 @@ extend_face_to_end_of_line (struct it *it) updating current_x. */ it->current_x = it->glyph_row->used[TEXT_AREA]; - do + while (it->current_x <= it->last_visible_x) { if (it->current_x != indicator_column) PRODUCE_GLYPHS (it); @@ -22100,7 +22100,6 @@ extend_face_to_end_of_line (struct it *it) it->c = it->char_to_display = ' '; } } - while (it->current_x <= it->last_visible_x); if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0 && (it->glyph_row->used[RIGHT_MARGIN_AREA] From 19da602991538e03648a82214cbb1bcc9a6ec14a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Nov 2020 15:20:30 +0200 Subject: [PATCH 4/4] Fix input method translation near read-only text * lisp/international/quail.el (quail-input-method): Don't disable input method when the character after point has the read-only property. Suggested by Evgeny Zajcev (Bug#44466) * doc/emacs/mule.texi (Input Methods): Document that input methods are inhibited in read-only text. --- doc/emacs/mule.texi | 6 ++++++ lisp/international/quail.el | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 0f07d286cda..3421ce66904 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -563,6 +563,12 @@ method's keys by defining key bindings in the keymap returned by the function @code{quail-translation-keymap}, using @code{define-key}. @xref{Init Rebinding}. + Input methods are inhibited when the text in the buffer is read-only +for some reason. This is so single-character key bindings work in +modes that make buffer text or parts of it read-only, such as +@code{read-only-mode} and @code{image-mode}, even when an input method +is active. + Another facility for typing characters not on your keyboard is by using @kbd{C-x 8 @key{RET}} (@code{insert-char}) to insert a single character based on its Unicode name or code-point; see @ref{Inserting diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 3299cc55a28..63371bce4fb 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -1330,7 +1330,8 @@ If STR has `advice' text property, append the following special event: (defun quail-input-method (key) (if (or (and (or buffer-read-only - (get-char-property (point) 'read-only)) + (and (get-char-property (point) 'read-only) + (get-char-property (point) 'front-sticky))) (not (or inhibit-read-only (get-char-property (point) 'inhibit-read-only)))) (and overriding-terminal-local-map