[Top][All Lists]

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

wrong frame is current when after-make-frame-functions

From: Drew Adams
Subject: wrong frame is current when after-make-frame-functions
Date: Sun, 29 May 2005 12:06:52 -0700

The Subject line might not describe this well. Do this:

1. emacs -q. The default (frame-char-width) is 8.

2. Reduce the frame character size (default font) to a small number,
   so that, for example, the (frame-char-width) is, say, 5. You can do
   this, for instance, with (modify-frame-parameters frame (list (cons
   'font new-font-name))), where new-font-name has a smaller size.

3. (setq after-make-frame-functions 
         (lambda (fr) (message "width: %s" (frame-char-width))))

4. C-x 5 f foobar

5. The message that appears shows that, at the time
   after-make-frame-functions was executed, the (frame-char-width) of
   the selected frame is 5, not 8.

However, debugging shows that the new frame is selected when
after-make-frame-functions is executed. The problem is that
frame-char-width does not take this selected frame into account, for
some reason - it uses the previous frame to calculate the character

In GNU Emacs (i386-mingw-nt5.1.2600)
 of 2005-04-16 on LAPTOP
Distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'

reply via email to

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