]> git.eshelyaron.com Git - emacs.git/commitdiff
Disable text conversion within read-char-from-minibuffer
authorPo Lu <luangruo@yahoo.com>
Sat, 19 Aug 2023 00:48:20 +0000 (08:48 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 19 Aug 2023 00:48:20 +0000 (08:48 +0800)
* lisp/subr.el (read-char-from-minibuffer): Disable text
conversion.  (bug#65370)
(y-or-n-p): Remove redundant binding of
`override-text-conversion-style', given that read-key already
disables text conversion.

* src/textconv.c (Fset_text_conversion_style): Always reset text
conversion for the selected frame in addition to any displaying
current_buffer.

lisp/subr.el
src/textconv.c

index 51545fb5f11c01743ef0c2f170fa73778985d700..f6332ce35e6edef2cca233149857484ea69e2c76 100644 (file)
@@ -3569,7 +3569,12 @@ There is no need to explicitly add `help-char' to CHARS;
                 read-char-from-minibuffer-map))
          ;; Protect this-command when called from pre-command-hook (bug#45029)
          (this-command this-command)
-         (result (read-from-minibuffer prompt nil map nil (or history t)))
+         (result (progn
+                   ;; Disable text conversion if it is enabled.
+                   ;; (bug#65370)
+                   (when (fboundp 'set-text-conversion-style)
+                     (set-text-conversion-style text-conversion-style))
+                   (read-from-minibuffer prompt nil map nil (or history t))))
          (char
           (if (> (length result) 0)
               ;; We have a string (with one character), so return the first one.
@@ -3753,9 +3758,6 @@ like) while `y-or-n-p' is running)."
       (while
           (let* ((scroll-actions '(recenter scroll-up scroll-down
                                             scroll-other-window scroll-other-window-down))
-                 ;; Disable text conversion so that real key events
-                 ;; are sent.
-                 (overriding-text-conversion-style nil)
                  (key
                   (let ((cursor-in-echo-area t))
                     (when minibuffer-auto-raise
index 60f3ba805771665bd328f05bf8cb679ecf2358ed..a4de991ef026baf6edb6c32b4f6a37aae2932316 100644 (file)
@@ -2138,7 +2138,10 @@ replacement key sequence returned starts a new key sequence and makes
          if (WINDOW_LIVE_P (f->old_selected_window)
              && FRAME_WINDOW_P (f)
              && EQ (XWINDOW (f->old_selected_window)->contents,
-                    buffer))
+                    buffer)
+             /* Always reset the text conversion style of the
+                selected frame.  */
+             || (f == SELECTED_FRAME ()))
            {
              block_input ();
              reset_frame_state (f);