[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: closing emacsclient always focuses another emacs window
From: |
Michael Heerdegen |
Subject: |
Re: closing emacsclient always focuses another emacs window |
Date: |
Mon, 10 Mar 2014 05:30:42 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Eli Zaretskii <eliz@gnu.org> writes:
> Not sure, because it doesn't match what we see. Could be.
I think I found something which I hope could explain the confusion.
When the OP hits C-x #, this is executed in `server-edit':
(apply 'server-switch-buffer (server-done))
`server-done' returns a list (nil ...), so this code at the beginning of
`server-switch-buffer' is executed:
(if (null next-buffer)
(progn
(let ((rest server-clients))
(while (and rest (not next-buffer))
(let ((proc (car rest)))
;; Only look at frameless clients, or those in the selected
;; frame.
(when (or (not (process-get proc 'frame))
(eq (process-get proc 'frame) (selected-frame)))
(setq next-buffer (car (process-get proc 'buffers))))
(setq rest (cdr rest)))))
(and next-buffer (server-switch-buffer next-buffer killed-one))
(unless (or next-buffer killed-one (window-dedicated-p))
;; (switch-to-buffer (other-buffer))
(message "No server buffers remain to edit"))) ...
It seems that (selected-frame) is intended to "mean" the frame focused
when we hit C-x #. But note that evaluating the argument (server-done)
has the side effect of deleting that frame. Under the right
circumstances, the selected frame now can be any frame, including the
other emacsclient frame. In this case, `next-buffer' will be set and
the newly selected frame will be focused by the recursive call of
`server-switch-buffer'.
Regards,
Michael.
- Re: closing emacsclient always focuses another emacs window, (continued)
- Message not available
- Re: closing emacsclient always focuses another emacs window, trygve . flathen, 2014/03/08
- Re: closing emacsclient always focuses another emacs window, Michael Heerdegen, 2014/03/08
- Message not available
- Re: closing emacsclient always focuses another emacs window, trygve . flathen, 2014/03/09
- Re: closing emacsclient always focuses another emacs window, Michael Heerdegen, 2014/03/09
- Message not available
- Re: closing emacsclient always focuses another emacs window, trygve . flathen, 2014/03/09
- Re: closing emacsclient always focuses another emacs window, Michael Heerdegen, 2014/03/09
- Re: closing emacsclient always focuses another emacs window, Eli Zaretskii, 2014/03/09
- Re: closing emacsclient always focuses another emacs window,
Michael Heerdegen <=
- Re: closing emacsclient always focuses another emacs window, Michael Heerdegen, 2014/03/10
- Re: closing emacsclient always focuses another emacs window, Eli Zaretskii, 2014/03/10
- Re: closing emacsclient always focuses another emacs window, Michael Heerdegen, 2014/03/10
- Re: closing emacsclient always focuses another emacs window, Eli Zaretskii, 2014/03/10
- Re: closing emacsclient always focuses another emacs window, Eli Zaretskii, 2014/03/10
- Re: closing emacsclient always focuses another emacs window, Michael Heerdegen, 2014/03/10
- Re: closing emacsclient always focuses another emacs window, Michael Heerdegen, 2014/03/10
- Re: closing emacsclient always focuses another emacs window, Michael Heerdegen, 2014/03/11
- Re: closing emacsclient always focuses another emacs window, Eli Zaretskii, 2014/03/11
- Re: closing emacsclient always focuses another emacs window, Michael Heerdegen, 2014/03/11