Subject: Re: 23.0.96; regression: minibuffer-message interferes with C-u

From: Chong Yidong <[email-masked]>
Date: Tue, 28 Jul 2009 11:46:30 -0400

> (defun test-univ-arg ()
>   (interactive)
>   (setq prefix-arg                     (list 4)
>         universal-argument-num-events  (length (this-command-keys)))
>   (minibuffer-message "FOO") ; NO GOOD. OK ONLY IF THIS IS REMOVED
>   (ensure-overriding-map-is-bound))
>
> (defun test2 () (interactive) (describe-function '+))
>
> (define-key minibuffer-local-completion-map "\C-f" 'test2)
> (define-key minibuffer-local-completion-map
>   (vector 'remap 'universal-argument) 'test-univ-arg)
>
> 1. Now do this, without waiting for the 2-sec delay after C-u.
> That is, hit C-f immediately after C-u.
>
> M-x C-u C-f

The function `sit-for', which `minibuffer-message' uses, treats C-u
specially.  It's easy to get your code to work; just put the call to
`minibuffer-message' after `ensure-overriding-map-is-bound':

(defun test-univ-arg ()
  (interactive)
  (setq prefix-arg                     (list 4)
        universal-argument-num-events  (length (this-command-keys)))
  (ensure-overriding-map-is-bound)
  (minibuffer-message "FOO"))