Emacs Tip #1 -- make-frame-on-display

make-frame-on-display creates a new emacs window on a different X display (machine or session). The new window shares buffers, history, etc. with the original frame. When you are done with the new frame, use delete-frame to get rid of it.

This is incredibly useful. You can share a session with a colleague. You can use emacs that's running on a remote host as if it was a local window. You can run emacs on a server, pop up the new frame on your latptop, then destroy the frame when you shut down the laptop. Come back the next day and use make-frame-on-display to continue where you left off.

Other Options

There are two other options to achieve similar results:
  • screen
  • VNC


screen is an excellent program which lets you have multiple virtual terminals in one ssh/telnet session. Hotkeys let you toggle between the virtual terminals. Best of all, you can leave the session running, log out, and then reconnect later. You can leave emacs running in one of the virtual terminals. Then its buffers and history are intact when you next log in.


VNC is a pair of programs, one of which shares a desktop for other computers to see and another that allows you to look at a desktop on another machine. On a GNU/Linux machine, run vncserver to start a new VNC desktop and use vncviewer to connect to an existing desktop. In recent distributions, you can share your current desktop using "System/Preferences/Remote Desktop".

Last modified on 23 Jan 2008 by AO

Copyright © 2016 Andrew Oliver