[Top][All Lists]

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

emacsclient: add support for Tramp

From: Michael Mauger
Subject: emacsclient: add support for Tramp
Date: Thu, 23 Nov 2006 23:12:45 -0800 (PST)

Emacsclient works great on a Unix host talking to a local w32 instance of 
Emacs.  The difficulty is that you must include the Tramp prefix in the 
filename for the w32 Emacs to be able to locate the file.  This patch allows 
the Tramp prefix to be supplied separately on the command line of Emacsclient 
or via the environment variable EMACS_TRAMP_PREFIX.  

Thus, the following two sequences are equivalent (assuming EMACS_SERVER_FILE is 
properly setup):

    $ emacsclient /address@hidden:/export/home/me/.profile   # must be an 
absolute filename


    $ EMACS_TRAMP_PREFIX=/address@hidden:
    $ emacsclient .profile     # relative and absolute filenames are supported

I set EMACS_TRAMP_PREFIX to "/address@hidden:" in my Unix .profile and can use 
emacsclient as if the Emacs instance were on the same machine.

This patch is mostly tested.  The basic feature works.  The command line 
handling has not been tested.

Here's the Changlog:

2006-11-24  Michael R. Mauger  <address@hidden>
 * emacsclient.c (SEND_FILENM): New macro for sending filename
 (tramp_prefix): New global variable for new option
 (longopts): Add -p, --tramp-prefix
 (decode_options): Add -p value capture
 (print_help_and_exit): Add -p, --tramp-prefix description
 (send_file_name): New function.  Send complete filename including
 (main): tramp_prefix falls back to environment variable
 EMACS_TRAMP_PREFIX and use SEND_FILENM to send filenames.

Attached is the patch.

BTW, Emacsclient will not port to openVMS properly now.  It assumes Posix/Unix 
style filenames witha slash directory separator.  My change factors the code 
that makes a relative filename an absolute filename so that the changes are 
only needed in one place.

Attachment: ec-tramp.diff
Description: Text document

reply via email to

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