[Top][All Lists]

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

Re: emacsclient: --quiet/--verbose

From: Michael Mauger
Subject: Re: emacsclient: --quiet/--verbose
Date: Sat, 2 Dec 2006 14:02:04 -0800 (PST)

Lennart Borgman wrote:

>Michael Mauger wrote:
>> Juanma Barranquero wrote:
>>> On 12/1/06, Michael Mauger <address@hidden> wrote:
>>>> 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.
>> See http://lists.gnu.org/archive/html/emacs-devel/2006-11/msg01195.html for
>> the Tramp patch.
>> The use of Tramp doesn't impact how emacsclient and emacs communicate.  It
>> has to do with how does emacs addresses the file that resides on a remote
>> machine.  My patch allowed you on the remote machine to address the file
>> locally to emacsclient, but pass a filename that would appear remote to
>> emacs.  Obviously, if emacsclient and emacs were on the same machine, the
>> Tramp settings would not be set and things would work as they do now.  (The
>> version of gnuclient I use to use had a similar feature that spoiled me
>> rotten.)
>> An example:
>> address@hidden $ emacs &
>> address@hidden $ ssh bbb -l me
>> address@hidden $ scp address@hidden:.emacs.d/server/server 
>> ~/.emacs.d/server/me-aaa
>> address@hidden $ EMACS_SERVER_FILE=$HOME/.emacs.d/server/me-aaa
>> address@hidden $ export EMACS_SERVER_FILE
>> address@hidden $ cd /etc
>> (Now I want to edit the /etc/hosts file but there is no emacs available on
>> bbb,  so I ask to edit it in the emacs instance under address@hidden)
>> address@hidden $ emacsclient /address@hidden:/etc/hosts    # without Tramp 
>> support 
>>                       # Must specify Tramp prefix and absolute file name
>> address@hidden $ EMACS_TRAMP_PREFIX=/address@hidden:
>> address@hidden $ export EMACS_TRAMP_PREFIX
>> address@hidden $ emacsclient hosts                          # same as above 
>> with
>> Tramp support
>>                       # emacsclient sends Tramp prefix and makes filename
>> absolute
>I do not think this can work. (Or am I misunderstanding something?) 
>Emacsclient have to expand local file names before sending them to emacs 
>server since the server and the client may have different working 
>Could not your problem be solved with a shell script that adds 
>EMACS_TRAMP_PREFIX to the file names before calling emacsclient?

Actually it works very nicely.  emacsclient expands the local filename into an 
absolute filename (as it currenty does) and prefixes that with the Tramp prefix 
when it sends it to Emacs.  I use emacsclient no differently than if the emacs 
instance were local, and it communicates the correct filename (not only in the 
correct directory, but on the correct remote machine).

And yes this could be done with a script around emacsclient, but the script 
would have to make the filename absolute itself (because the Tramp prefix will 
make the filename look absolute already).  Obviously, not difficult, but with a 
small patch, emacsclient can do all of it out-of-the-box.

reply via email to

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