From: Eli Zaretskii Date: Sat, 14 Nov 2020 13:20:30 +0000 (+0200) Subject: Fix input method translation near read-only text X-Git-Tag: emacs-27.1.90~58 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=19da602991538e03648a82214cbb1bcc9a6ec14a;p=emacs.git 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. --- 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