emacs-devel
[Top][All Lists]
Advanced

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

Re: emacsclient: --quiet/--verbose


From: Juanma Barranquero
Subject: Re: emacsclient: --quiet/--verbose
Date: Fri, 1 Dec 2006 02:10:35 +0100

On 12/1/06, Michael Mauger <address@hidden> wrote:

* Should it be used if the emacs is "remote" i.e. not at 127.0.0.1?  What if
emacsclientw is running on w32, Emacs is running on Unix, and you try to
foreground a Unix pid.  Is it possible to confirm that a remote host is
actually the local host?  Is it worthwhile to do so?

Of course, it is entirely possible to have server-host set to a
non-127.0.0.1 address which is, in fact, local. What emacsclient
should do is to check the address of the server (from the server file)
and, if not 127.0.0.1, get a list of the addresses of the local
machine it is running in, and detect whether the server-host address
is in fact local or not. The code to do that amounts to 10-15 lines of
C.

However, I don't think it is necessary right now. The worst that can
happen is that emacsclient calls AllowSetForegroundWindow on the pid
of a process which doesn't expect it (and which won't grab the focus
unless it is doing something like moving a window, etc.), or on an
nonexistent pid (in which case ASFW will return an error, which is
ignored anyway).

* Is the AllowSetForegroundWindow really necessary since it isn't called
when emacsclient is run on Unix to a w32 Emacs yet the w32 Emacs responds
and raises in the window stack as you'd expect.

Obviously, because the Emacs on Windows is not fighting for the focus
against the Unix emacsclient. However, it is necessary on Windows,
when called from the same machine, because Emacs and the console
session you're using to run emacsclient fight for the focus. That
doesn't happen if some other program executes emacsclient as a
subprocess, perhaps. But 99% of my uses of emasclient are from a CMD
(4NT, really) console.

Finally, if people could take another look at the Tramp changes I proposed
for emacsclient.

I don't have anything about emacsclient using Tramp, as long as it is
not the only way, of course. TCP sockets are fine for my uses.

                   /L/e/k/t/u




reply via email to

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