Subject: Re: bug#1586: prefix arg when mouse clicking on header line

From: Chong Yidong <[email-masked]>
Date: Mon, 04 Jul 2011 16:50:42 -0400

Stefan Monnier <[email-masked]> writes:

> Does this actually fix the problem?  If so, I don't understand why:
> a down event that's not bound to anything should be dropped entirely by
> read-key-sequence.
>
> So my guess at the problem is that [header-line down-mouse-1] is not
> left unbound but instead is bound to something
> (e.g. `mouse-drag-header-line' or `ignore'), so your code won't be
> executed at all in that case.
>
> Now, I'm not sure if we should preserve the prefix arg even if the down
> event is bound, or rather just change `mouse-drag-header-line' and/or
> `ignore' to propagate the current-prefix-arg to the next event; but
> unless I'm missing something your fix should have no effect.

The patch does fix the test case:

(defun test-bug ()
  (interactive)
  (global-set-key [header-line mouse-1] 'foo)
  (setq header-line-format "a"))

(defun foo (event &optional arg)
  (interactive "e\nP")
  (setq foo (cons arg event))
  (message "%s" foo))

C-u mouse-1 on the header line with and without the patch, and you'll
see the prefix arg being passed through, and being dropped.