Subject: bug#14676: 24.3.50; winner doesn't immediately notice windows created by server

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 09 Sep 2020 15:41:06 +0200

Michael Heerdegen <[email-masked]> writes:

>> Can you show me the patch you tested?
>
> I tested this:

This was the final message in this seven year old thread.  Miraculously,
the patch still applies:

>                 (message "%s" (substitute-command-keys
>                                "When done with a buffer, type \\[server-edit]")))))
>             (when (and frame (null tty-name))
> !             (server-unselect-display frame)))
>         ((quit error)
>          (when (eq (car err) 'quit)
>            (message "Quit emacsclient request"))
> --- 1292,1299 ----
>                 (message "%s" (substitute-command-keys
>                                "When done with a buffer, type \\[server-edit]")))))
>             (when (and frame (null tty-name))
> !             (server-unselect-display frame))
> ! 	  (run-hooks 'post-command-hook))
>         ((quit error)
>          (when (eq (car err) 'quit)
>            (message "Quit emacsclient request"))

[...]

> Note that I don't know anything about server.el, I just did what you
> proposed.
>
> Anyway, it fixes the problem - with my setup as well as for -Q.

I'm not very familiar with server.el myself...   this just changes it to
run post-command-hook slightly later?  I guess that could have
unforeseen consequences, but if it fixes this bug, then perhaps we
should give it a go?

Or did the problem fix itself through other means over the years?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no