Reputation: 143
When I'm coding I'm using multiple "emacs nowindow mode", each one oppened in different terminal. It is really annoying when you have the same file on multiple emacs. Is there a way to synchronize them on save? (to update the other instances of emacs?)
I know that the best solution is not to do this :), but it is hard to break old habbits :)
Cheers, Stole p.s I work on Linux systems
Upvotes: 0
Views: 602
Reputation: 1259
It sounds like the ultimate problem you want to solve is working with the common files across Emacs frames. Emacs allows multiple client frames for a single running instance of Emacs. Unless you have technical motivations for entirely isolated instances of Emacs (i.e. isolated global state) I would recommend using this feature. That way you entirely avoid issues arising from concurrent edits to files.
Start the Emacs server from the command line via:
$ emacs --daemon
Alternately you can start the server after emacs has started using M-x server-start
.
Then you can create client frames as you need them. Instead of typing emacs -nw
, use:
$ emacsclient -nw
Depending on how you work you may need to exit Emacs differently to preserve other clients. Use C-x 5 0
(delete-frame
) to close a single client rather than
C-x C-c
(save-buffers-kill-terminal
).
Upvotes: 4
Reputation: 4461
Start your emacs instance in background when your session starts and then use emacsclient -nw
to open a new frame in each terminal session. It's not exactly what you're doing but it is the closest I can think of.
Upvotes: 2