Re: xemacs like a server



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)

.



Relevant Pages

  • Re: Explanation of macros; Haskell macros
    ... > server and I got to dictate the form of the commands and arguments. ... it boiled down to (funcall command client-session args). ... Let's assume there is a type "Session" for sessions. ... You don't need the first constraint, ...
    (comp.lang.python)
  • Re: Explanation of macros; Haskell macros
    ... > server and I got to dictate the form of the commands and arguments. ... it boiled down to (funcall command client-session args). ... Let's assume there is a type "Session" for sessions. ... You don't need the first constraint, ...
    (comp.lang.lisp)
  • Re: xemacs like a server
    ... must be executed from a live xemacs session, ... The session can be started automatically, from the command line, ... I have a separate init file used only when invoking the server ... and then execute the gnuserv-start command. ...
    (comp.emacs.xemacs)
  • Storing and Accessing email Addresses
    ... As I continue to work on an email parsing and forwarding application my ... 'Change current state of the session ... 'Send MAIL FROM command to the server ...
    (comp.lang.basic.visual.misc)
  • Re: terminal server has exeeded the maximum number of allowed conn
    ... You can also use the command rwinsta to directly end a session. ... specify IP address if the server name can't be resolved for some reason. ...
    (microsoft.public.win2000.termserv.clients)