Add this line in /etc/profile
:
if [ ! `ps -x | grep emacs | grep daemon | awk '{ print $2 }'` ]; then
emacs --daemon 2> /dev/null
fi
Relogin again to start the daemon.
Now you can edit your files with emacsclient
command like so:
$ emacsclient sample.cpp
If you want to run emacsclient in gui mode, run this command:
$ emacsclient -c sample.cpp
To make your default emacs application to run emacsclient instead of emacs command,
edit your /usr/share/applications/emacs.desktop
file and change Exec
line to this:
Exec=emacsclient -c %F
If
emacs.desktop
hasTry
variable, change that too.
Note: if your emacsclient gui doens't load your theme or config, just load it via M-x
+load-file
+~/.emacs