I have 2 files

/ssh:[email protected]:/home/user/myproject/myfile.el

Content of both of them are same. I want to make same change in both of them. I can do it like:

1. Edit file in local machine.
2. Push the file to server.

Instead, I'd like to connect both files to same buffer.

  • 5
    Idea: set after-save-hook to push the file to server.
    – JeanPierre
    Mar 2, 2016 at 6:48
  • "I'd like to connect both files to same buffer." A buffer can visit only one file.
    – Drew
    Nov 27, 2018 at 23:30

1 Answer 1


You can try using Magnar's multifiles.el. You will find it on MELPA.

Like the README says:

Bind a key to mf/mirror-region-in-multifile, let's say C-!. Now mark a part of the buffer and press it. A new multifile buffer pops up. Mark some other part of another file, and press C-! again. This is added to the multifile.

You can now edit the multifile buffer, and watch the original files change. Or you can edit the original files and watch the multifile buffer change.

Saving the multifile buffer will save all the original files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.