Function: repeat-post-hook

repeat-post-hook is a byte-compiled function defined in repeat.el.gz.

Signature

(repeat-post-hook)

Documentation

Function run after commands to set transient keymap for repeatable keys.

Source Code

;; Defined in /usr/src/emacs/lisp/repeat.el.gz
(defun repeat-post-hook ()
  "Function run after commands to set transient keymap for repeatable keys."
  (let ((was-in-progress repeat-in-progress))
    (setq repeat-in-progress nil)
    (let ((map (repeat-get-map)))
      (when (repeat-check-map map)
        ;; Messaging
        (funcall repeat-echo-function map)

        ;; Adding an exit key
        (when repeat-exit-key
          (setq map (copy-keymap map))
          (define-key map (if (key-valid-p repeat-exit-key)
                              (kbd repeat-exit-key)
                            repeat-exit-key)
                      'ignore))

        (setq repeat-in-progress t)
        (repeat--clear-prev)
        (let ((exitfun (set-transient-map map)))
          (setq repeat--transient-exitfun exitfun)

          (let* ((prop (repeat--command-property 'repeat-exit-timeout))
                 (timeout (unless (eq prop 'no) (or prop repeat-exit-timeout))))
            (when timeout
              (setq repeat-exit-timer
                    (run-with-idle-timer timeout nil #'repeat-exit)))))))

    (setq repeat-map nil)
    (setq repeat--prev-mb (cons (minibuffer-depth) current-minibuffer-command))
    (when (and was-in-progress (not repeat-in-progress))
      (repeat-exit))))