Open an Emacs buffer when a command tries to open an editor in shell-mode
You can attach to an Emacs session through emacsclient
. First, start the emacs server with
M-x server-start
or add (server-start)
to your .emacs
. Then,
export VISUAL=emacsclient
Edit away.
Note:
- The versions of
emacs
andemacsclient
must agree. If you have multiple versions of Emacs installed, make sure you invoke the version ofemacsclient
corresponding to the version of Emacs running the server. - If you start the server in multiple Emacs processes/frames (e.g., because
(server-start)
is in your.emacs
), the buffer will be created in the last frame to start the server.