[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

modify-frame-parameters seems to affect double-mouse binding

From: Drew Adams
Subject: modify-frame-parameters seems to affect double-mouse binding
Date: Sat, 8 Jan 2005 16:31:54 -0800

I'd really like to understand what's happening here, and know if this
is a bug or not. If not, what can I do to work around this behavior?

1. Open a new frame.

2. In the code below, change the font string to be the default font
   for the frame you opened - that is,
   (assq 'font (frame-parameters (selected-frame))).

3. Shift double-click in the new frame. This echoes first FOO, then
   BAR, as you would expect. Since the new font given with
   modify-frame-parameters is the same as the current font, there is
   in fact no change in the frame font size.

4. Now, change the font size in foo's font string to a slightly
   different size (e.g. change it from 14 to 18), so that the font
   will actually be changed by modify-frame-parameters in foo.

5. Shift double-click in the same frame. This now echoes FOO
   twice. Command bar is never executed.

I get the same behavior in Emacs 20 and Emacs 21.3.50 (from July).

Why is bar never executed? What can I do differently so that bar will
be executed on the second click?

(defun foo ()
  (message "FOO")(sit-for 1)
   (list (cons 'font "-*-Lucida

(defun bar () (interactive) (message "BAR")(sit-for 1))

(define-key global-map [S-mouse-1] 'foo)
(define-key global-map [S-double-mouse-1] 'bar)

(define-key global-map [S-down-mouse-1] nil)
(define-key global-map [S-double-down-mouse-1] nil)

In GNU Emacs (i386-mingw-nt5.1.2600)
 of 2004-07-26 on BERATUNG4
configured using `configure --with-gcc
(3.3) --cflags -I../../jpeg-6b-1/include -I../../libpng-1.2.4-1/include -I..
/../tiff-3.5.7/include -I../../xpm-nox-4.2.0/include -I../../zlib-1.1.4-1/in

reply via email to

[Prev in Thread] Current Thread [Next in Thread]