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")
(gnuserv-start)

Then, to start it, just type:

gnuclient

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")
(gnuserv-start)

; 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"
  (interactive)
  (cond ((and (featurep 'gnuserv) (gnuserv-buffer-p (current-buffer)))
         (gnuserv-edit))
        ((= (length (frame-list)) 1)
         (save-buffers-kill-emacs))
        (t
         (delete-frame)))) 

; 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.