Skip to navigation

GnuClient: faster access to XEmacs

XEmacs is a great text editor, but it takes some time to start up. I use GnuClient to get around this problem. GnuClient opens a window that looks like a new XEmacs window, but is in fact part of a running XEmacs process. It ships with XEmacs, but you need to tell XEmacs via the init.el file that it should start with a gnuserv process:
(load "gnuserv")

Then, to start it, just type:


I’ve added some more stuff in my ~/.xemacs/init.el to configure the behavior of GnuClient:

; gnuclient lets you open files in a running xemacs process, but only
; if the existing process is associated with a gnuserv server. So
; start it:
(load "gnuserv")

; set some gnuserv options
; gnuserv-frame nil means open a new frame for every gnuclient
; gnuserv-frame t means open gnuclient in exisiting frame
(setq gnuserv-frame nil)
; don't ask for confirm when killing gnuclient buffers:
(setq gnuserv-kill-quietly t)

;;; Instead of closing XEmacs, just close a frame.  Or if the frame
;;; was opened by gnuserv, use gnuserv to close it.
(defun exit-from-screen-or-xemacs ()
  "Close the screen and if we're on the last screen, close XEmacs"
  (cond ((and (featurep 'gnuserv) (gnuserv-buffer-p (current-buffer)))
        ((= (length (frame-list)) 1)

; then, we bind it to C-x C-c: 
(global-set-key "\C-x\C-c" 'exit-from-screen-or-xemacs)

Another alternative for quick file editing if you’re used to XEmacs key bindings is JED.

Comments are closed.