Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 601703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:44:39+00:00 2026-05-13T16:44:39+00:00

This is probably a somewhat out-of-wack question. I use tramp to edit remote files,

  • 0

This is probably a somewhat out-of-wack question. I use tramp to edit remote files, but I also open several terminals ssh-ing to that remote machine as well for other works (I had problems running ssh shell inside emacs).

Often times during the terminal work I would like to edit some file, and my current procedure is to copy the file name, and then use emacs tramp to open that file (after messing all around with getting the file path in the tramp format). This is way too much work for a quick edit and quite error prone in the path handling part.

The question is: Can I execute some command in the remote ssh session that takes the filename, transform that to tramp format (that’s the easy part), and run a local command (like emacsclient blahblahblah) so that I can edit the remote file using tramp in my local emacs?

I’m not sure if I’m clear enough. I don’t want to run emacs on the remote machine (either on the terminal or through an x session), but I do want to send file to my local emacs from a remote prompt, like this:

user@remote-machien ~/ $ run_local_emacs somefile
# then the file "/ssh:user@remote-machine/:/home/user/somefile" shows up 
# in my local emacs
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:44:39+00:00Added an answer on May 13, 2026 at 4:44 pm

    You can set up your emacs-server to use a tcp connection (not just a local socket), and then on the remote side, tell emacsclient to connect to that tcp connection:

    In your .emacs

    (setq server-use-tcp t)
    (setq server-host "name_of_local_machine")
    (server-start)
    

    And then on the remote side:

    emacsclient -f ~/.emacs.d/server/server /`hostname`:/path/to/local/file
    

    The above call to emacsclient brings up a file local to the “remote” machine in your Emacs running in the “local” machine. Obviously you can wrap the call to emacsclient in whatever kind of script you want to make it easier.

    If your home directory is not visible on the remote machine, you will need
    to customize the server-auth-dir variable like so:

    (setq server-auth-dir "/some/path/visible/on/both/machines")
    

    For more documentation, see Emacsclient options.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im sorry for this probably dumm question, but I want to simply open modals
This probably is a dummy question but I cannot find a clear indication. I
I'm somewhat new to PHP, so this will probably sound stupid, but how you
this is somewhat a newbie question probably. I'm generating keypairs with Java: KeyPairGenerator keyGen
[This question is somewhat related to this question , but the answers are not...]
This probably sounds like a terrible idea at first glance, but here is my
I know this probably really simple but Im not sure what im doing wrong...
I know this probably has been asked before but I am having issues with
I am using ASP.Net MVC but this probably applies to all MVC patterns in
OK, this probably is supposed to be the easiest thing in the world, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.