(car elt)))
tmm-km-list)))))
(setq history-len (length tmm--history))
- (setq tmm--history (append tmm--history tmm--history
- tmm--history tmm--history))
(setq tmm-c-prompt (nth (- history-len 1 index-of-default)
tmm--history))
(setq out
(car (nth index-of-default tmm-km-list))
(minibuffer-with-setup-hook #'tmm-add-prompt
;; tmm-km-list is reversed, because history
- ;; needs it in LIFO order. But completion
+ ;; needs it in LIFO order. But default list
;; needs it in non-reverse order, so that the
- ;; menu items are displayed as completion
- ;; candidates in the order they are shown on
- ;; the menu bar. So pass completing-read the
+ ;; menu items are displayed by M-n as default
+ ;; values in the order they are shown on
+ ;; the menu bar. So pass the DEFAULT arg the
;; reversed copy of the list.
(completing-read-default
(concat gl-str
" (up/down to change, PgUp to menu): ")
- (tmm--completion-table (reverse tmm-km-list)) nil t nil
- (cons 'tmm--history
- (- (* 2 history-len) index-of-default))))))))
+ (tmm--completion-table tmm-km-list) nil t nil
+ 'tmm--history (reverse tmm--history)))))))
(setq choice (cdr (assoc out tmm-km-list)))
(and (null choice)
(string-prefix-p tmm-c-prompt out)
;; Try to show everything just inserted and preserve height of
;; *Completions* window. This should fix a behavior described
;; in Bug#1291.
- (fit-window-to-buffer window nil nil nil nil t)))))
- (insert tmm-c-prompt))
+ (fit-window-to-buffer window nil nil nil nil t))))))
(defun tmm-shortcut ()
"Choose the shortcut that the user typed."