Function: quail-add-unread-command-events

quail-add-unread-command-events is a byte-compiled function defined in quail.el.gz.

Signature

(quail-add-unread-command-events KEY &optional RESET)

Documentation

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). If KEY is an event, it is prepended to unread-command-events as a cons cell of the form (no-record . EVENT). 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.

Source Code

;; Defined in /usr/src/emacs/lisp/international/quail.el.gz
;; 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', 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).
If KEY is an event, it is prepended to `unread-command-events' as a cons
cell of the form (no-record . EVENT).
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)
            (cons (cons 'no-record key) unread-command-events)
          (append (mapcan (lambda (e) (list (cons 'no-record e)))
                          (append (if (vectorp key) key (vector key)) nil))
                  unread-command-events))))