Re: xemacs like a server
- From: Imbaud Pierre <pierre@xxxxxxxxx>
- Date: Wed, 05 Jul 2006 16:36:12 +0200
Looks like what I have been looking for, thanks a lot!
Ill need time to try this...
Floyd L. Davidson wrote :
Imbaud Pierre <pierre@xxxxxxxxx> wrote:.
gnuserv is JUST what I need: the xemacs session lives on the server,
when the client dies, is suspended, or network goes down, my precious
session continues!
The problem is:
- (gnuserv-start) must be executed from a live xemacs session, on the
server
- The session can be started automatically, from the command line,
- BUT I found no way to start it without an X or a terminal, or to close
that terminal without killing the session.
So my question is: does someone know a way to start an xemacs session
not linked to a terminal?
I have a separate init file used only when invoking the server
process. I then invoke the server with a shell function that is
defined like this:
function startxemacs {
(cd ~/ #put nohup.out file in home directory
nohup /usr/local/bin/xemacs -unmapped -l ~/.semacs -g 100x30+60+60 \
-T "GNUserver" 2>/dev/null &)
}
There is no icon and the process is not displayed on the
desktop. It is executed by /nohup/, and hence will continue to
run after the user logs out, so it does not need to be started
at every login unless the system has been rebooted.
Currently I manually run that command to start the server, but
it wouldn't be horribly difficult to add something to a user's
~/.profile to determine if there is a running server, and invoke
one if not, to make it entirely automatic.
The commands in ~/.semacs set up the proper environment for
gnuserve, and then execute the gnuserv-start command. It also
remaps C-x C-c to prevent accidentally killing the serve process
(which can only be done via the menu).
This is what I have in ~/.semacs,
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Load these modules to provide symbol definitions for compilation
;;;
(eval-when-compile
(when (featurep 'xemacs)
(defun current-frame () "dummy to quiet XEmacs byte-compiler" ()))
(require 'gnuserv))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Setup for running gnuserv, then run it
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; for GNU Emacs only
(unless (featurep 'xemacs)
(setq gnuserv-frame (current-frame)))
;;;
;;; Start up the gnu edit server process
;;;
(gnuserv-start)
;;;
;;; disallow exiting from a command (menu option only)
;;;
(defun do-exit ()
"Exits Emacs or an Emacs client"
(interactive)
(if (gnuserv-running-p)
(if (eq gnuserv-clients nil) (delete-frame) (gnuserv-edit)))
)
(define-key ctl-x-map "\C-c" 'do-exit)
- References:
- Re: xemacs like a server
- From: Imbaud Pierre
- Re: xemacs like a server
- From: Floyd L. Davidson
- Re: xemacs like a server
- Prev by Date: efs installation with WinXP from behind firewall
- Next by Date: Re: problem with compile error lines
- Previous by thread: Re: xemacs like a server
- Next by thread: Re: rename-file primitive signalling beginning of buffer
- Index(es):
Relevant Pages
|