Gnus is an awesome mail and
news reader, but it can be a bit of a performance bear,
especially when using IMAP. Since Emacs is
single-threaded, IMAP operations that take too long can
disconnect you from IRC, Jabber, or any number of other network
services you also use from Emacs.
The typical solution to this problem is to run Gnus in a
dedicated Emacs instance. Doing so is really easy—just
alias like so:
alias gnus 'emacs -f gnus'
The catch is, such an Emacs doesn't know it's a dedicated,
Gnus-only Emacs. When I used this technique, it was always
confusing that quitting Gnus didn't quit its Emacs.
We can use
define a custom
-gnus command line
argument that does what we want. Here's what I have in my
'("gnus" . (lambda (&rest ignore)
(add-hook 'emacs-startup-hook 'gnus t)
To use the above, we just alter our shell alias to use our new
alias gnus 'emacs -gnus'
The only other thing to keep in mind is how this sort of setup
emacsclient. (This is a command that lets you
edit files in an already-running Emacs.) I really only want
emacsclient to open
files in the other Emacs I have running, and not in my Gnus-only
Emacs. Let's fix this by restricting when we start the server
(defvar ted-server-emacs t
"If non-null, this emacs should run emacsclient.")
Now that we have a flag we can use, let's only call
server-start when the flag's been
The only bit left to do is to
ted-server-emacs nil) inside the custom command line
argument handler above.