diff options
author | Eli Zaretskii <eliz@gnu.org> | 2021-05-29 11:17:53 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2021-05-29 11:17:53 +0300 |
commit | e3fc16fd71a46990503a71b11a2ad592e99d9edb (patch) | |
tree | 19bd99b018fa40d8eedd13ed8821b08f9d1cb3a8 /lisp/international/quail.el | |
parent | bd5c7404195e45f11946b4e0933a1f8b697d8b87 (diff) | |
download | emacs-e3fc16fd71a46990503a71b11a2ad592e99d9edb.tar.gz |
Fix last change
* lisp/international/quail.el (quail-add-unread-command-events):
Fix wording of the doc string. Move the rationale for the
function out of the doc string and into a comment.
Diffstat (limited to 'lisp/international/quail.el')
-rw-r--r-- | lisp/international/quail.el | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 33851f09a13..5d1311530a5 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -1368,19 +1368,22 @@ If STR has `advice' text property, append the following special event: (delete-region (overlay-start quail-overlay) (overlay-end quail-overlay)))) +;; Quail puts keys back in `unread-command-events' to be re-read +;; again, but these keys have already been recorded in recent-keys and +;; in the keyboard macro, if one is being defined, which means that +;; recording them again creates duplicates. This function is a +;; wrapper around adding input events to `unread-command-events', but +;; it makes sure these events will not be recorded a second time. (defun quail-add-unread-command-events (key &optional reset) - "Add KEY to `unread-command-events', ensuring that it is not recorded. + "Add KEY to `unread-command-events', but avoid recording it a second time. If KEY is a character, it is prepended to `unread-command-events' as a cons cell of the form (no-record . KEY). If KEY is a vector of events, the events in the vector are prepended to `unread-command-events', after converting each event to a cons cell of the form (no-record . EVENT). -Quail puts keys back in `unread-command-events' to be handled again, -and when it does this these keys have already been recorded in the -recent keys and in the keyboard macro being defined, which means that -recording them again creates duplicates. -When RESET is non-nil, the events in `unread-command-events' are first -discarded." +If RESET is non-nil, the events in `unread-command-events' are first +discarded, i.e. in this case KEY will end up being the only key +in `unread-command-events'." (if reset (setq unread-command-events nil)) (setq unread-command-events (if (characterp key) |