diff options
| author | Po Lu | 2024-05-07 09:02:00 +0800 |
|---|---|---|
| committer | Po Lu | 2024-05-07 09:02:00 +0800 |
| commit | d4d9db8dc6ee20d3c0c1b2e647f40ebf2cc719f3 (patch) | |
| tree | 63031e3822cfd46d71a726e987ca80e625f3bf5a | |
| parent | 6583916a058324f857d83af5a716d1142f94758f (diff) | |
| download | emacs-d4d9db8dc6ee20d3c0c1b2e647f40ebf2cc719f3.tar.gz emacs-d4d9db8dc6ee20d3c0c1b2e647f40ebf2cc719f3.zip | |
Disable text-conversion in map-ynp
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Bind
overriding-text-conversion-style to nil around read-event and
arrange that the input method be reset.
| -rw-r--r-- | lisp/emacs-lisp/map-ynp.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el index b603f2e6d0b..60e572fba30 100644 --- a/lisp/emacs-lisp/map-ynp.el +++ b/lisp/emacs-lisp/map-ynp.el | |||
| @@ -35,6 +35,9 @@ | |||
| 35 | ;;; Code: | 35 | ;;; Code: |
| 36 | 36 | ||
| 37 | (declare-function x-popup-dialog "menu.c" (position contents &optional header)) | 37 | (declare-function x-popup-dialog "menu.c" (position contents &optional header)) |
| 38 | (declare-function set-text-conversion-style "textconv.c") | ||
| 39 | |||
| 40 | (defvar overriding-text-conversion-style) | ||
| 38 | 41 | ||
| 39 | (defun map-y-or-n-p (prompter actor list &optional help action-alist | 42 | (defun map-y-or-n-p (prompter actor list &optional help action-alist |
| 40 | no-cursor-in-echo-area) | 43 | no-cursor-in-echo-area) |
| @@ -168,7 +171,11 @@ The function's value is the number of actions taken." | |||
| 168 | (key-description (vector help-char))) | 171 | (key-description (vector help-char))) |
| 169 | (if minibuffer-auto-raise | 172 | (if minibuffer-auto-raise |
| 170 | (raise-frame (window-frame (minibuffer-window)))) | 173 | (raise-frame (window-frame (minibuffer-window)))) |
| 171 | (setq char (read-event)) | 174 | (unwind-protect |
| 175 | (let ((overriding-text-conversion-style nil)) | ||
| 176 | (set-text-conversion-style text-conversion-style) | ||
| 177 | (setq char (read-event))) | ||
| 178 | (set-text-conversion-style text-conversion-style)) | ||
| 172 | ;; Show the answer to the question. | 179 | ;; Show the answer to the question. |
| 173 | (message "%s(y, n, !, ., q, %sor %s) %s" | 180 | (message "%s(y, n, !, ., q, %sor %s) %s" |
| 174 | prompt user-keys | 181 | prompt user-keys |