Hey! This is Mort!

I'm software engineer and open source enthusiast especially in C/C++ & Python and GNU/Linux.
Home Resume Github LinkedIn Twitter m@0t1.me

Speed up Emacs Startup 2017 Nov 11

Emacs is a fantastic editor for developers with many features. Unfortunatelly emacs boot time is not good enough and it takes a while to load server and client services.

To solve this issue, try to apply these steps:

Add this line in /etc/profile:

if [ ! $(ps -x | grep emacs | grep daemon | awk '{ print $2 }') ]; then
	emacs --daemon 2> /dev/null

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 has Try 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

All rights reserved by Morteza NourelahiAlamdari ©
All contents are under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.