[Top][All Lists]

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

Problem with window-configuration-change-hook

From: bza
Subject: Problem with window-configuration-change-hook
Date: 19 Mar 2007 15:52:25 -0700
User-agent: G2/1.0

Hi.  I'm not sure if this should be a bug report or if I'm confused
about the way this hook should work.

According to its info description, "[t]he frame whose window
configuration has changed is the selected frame when this hook runs."
This does not seem to be the case in the following situation:

  (add-hook 'window-configuration-change-hook 'test-function)
  (defun test-function ()
    (setq frame-name (frame-parameter (selected-frame) 'name)))
  (setq frame-name nil)
  (setq frame1 (make-frame '((name . "frame1"))))
  (setq frame2 (make-frame '((name . "frame2"))))
  (select-frame-set-input-focus frame2)
  (switch-to-buffer (get-buffer-create "test buffer"))
  (select-frame-set-input-focus frame1)
  (kill-buffer "test buffer"))

Here, we create two frames, display a buffer "test buffer" on frame2,
then switch to frame1 and kill the buffer.  This runs the window-
configuration-change-hook, but instead of

   => "frame2"

we have:

   => "frame1"

That is, the selected frame when the hook is run is *not* the frame
whose window configuration has changed.  If this is the expected
behavior, could someone explain it to me?


Alp Aker

reply via email to

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