emacs-devel
[Top][All Lists]
Advanced

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

Re: save-frame-excursion?


From: Stefan Monnier
Subject: Re: save-frame-excursion?
Date: Mon, 27 Jul 2009 13:49:50 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux)

> This patch makes sure that `make-frame' gives the focus back to the
> previously selected frame.
> Shall I apply this?

Don't know.  Here are some comments:
- does it work (as in "with Metacity/W32/macosx/xmonad/addyourfavoriteWMhere")?
- as Stephen pointed out, it should be run before the hook.
- it's not clear that it does the right thing if the selected-frame
  is not the frame with focus (basically we'd need a focussed-frame
  function to figure it out).
- it brings us back to this problem of "focus via activation".
- is x-focus-frame always defined when this code is run (i.e. can't
  this code be run also on emacs-nox)?
- x-focus-frame should really be renamed (so as to get rid of the "x-"
  prefix at least).


        Stefan


> --- frame.el.~1.300.~ 2009-07-27 03:20:02.000000000 +0800
> +++ frame.el  2009-07-27 11:40:23.000000000 +0800
> @@ -749,7 +749,8 @@
>  instance if the frame appears under the mouse pointer and your
>  setup is for focus to follow the pointer."
>    (interactive)
> -  (let* ((w (cond
> +  (let* ((f (selected-frame))
> +      (w (cond
>            ((assq 'terminal parameters)
>             (let ((type (terminal-live-p (cdr (assq 'terminal parameters)))))
>               (cond
> @@ -777,6 +778,7 @@
>          (let ((val (frame-parameter oldframe param)))
>            (when val (set-frame-parameter frame param val)))))
>      (run-hook-with-args 'after-make-frame-functions frame)
> +    (x-focus-frame f)
>      frame))
 
>  (defun filtered-frame-list (predicate)



> -- 
>  Bastien




reply via email to

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