xemacs in server mode
Add in ~/.emacs
(if (string-equal
     "XEmacs"
     (substring (emacs-version) 0 6))
     ( gnuserv-start )
     ( server-start ))
Use the following script
#!/bin/csh

if (`uname -s` == "SunOS") then
    set p=/outils/emacs/xemacs/sun5/bin
    set s=xemacs
    set c="gnuclient -q"
  else
    set p=/usr/bin
    set s=emacs
    set c="emacsclient -n"
  endif

ps -a -o user,comm | grep -v grep | egrep "`whoami`  *($p/$s|$s)" >& /dev/null
if ( $status ) then
    if ( $#argv > 0 ) then
        $p/$s "$1" &
        shift
      else
        $p/$s &
      endif
  else
    if ( $#argv > 0 ) then
        $p/$c "$1"
        shift
      else
        $p/$c
      endif
  endif

while ( $#argv > 0 )
    set f=1
    # loop to wait that the emacs server is up and listening
    while ($f)
        set f=0
        $p/$c "$1" >& /dev/null
        if ( $status ) set f=1
      end
    shift
  end

ClearCase shortkeys
defun lm-catcs ()
    "edit config spec"
    (interactive)
    ( progn
      ( switch-to-buffer ( generate-new-buffer "*catcs*" ) )
      ( shell-command
        "/usr/atria/bin/cleartool catcs"
        t ) )
)

(defun lm-savecs ()
    "save config spec"
    (interactive)
    ( shell-command-on-region (point-min) (point-max) "cat - > /tmp/cs.. ; /usr/atria/bin/cleartool setcs /tmp/cs.. ; rm /tmp/cs.." )
)

(defun lm-space-concat (&rest strings )
    "concatenate a list of strings separated by spaces"
    ()
    ( if (cdr strings)
      ( concat (car strings) " " (apply `lm-space-concat (cdr strings)) )
      (car strings) )
)

(defun lm-cleartool (&rest commands)
    "execute a clearcase command"
    ()
    ( message ( apply `lm-space-concat commands ) )
    ( apply 'call-process "/usr/atria/bin/cleartool" nil 0 nil commands )
)

(defun lm-diff ()
    "diff with predecessor"
    (interactive)
    ( lm-cleartool "diff" "-graphical" "-pred" (buffer-file-name) )
)

(defun lm-tree ()
    "diff with predecessor"
    (interactive)
    ( lm-cleartool "lsvtree" "-graphical" (buffer-file-name) )
)

(define-key global-map [(alt d)] 'lm-diff)
(define-key global-map [(alt t)] 'lm-tree)

build
(setq-default compile-command "clearmake -v -V -C gnu debug")

quick window destruction
(defun lm-killw ()
     "kill buffer and close window"
     (interactive)
     ( progn
       ( kill-buffer nil )
       ( delete-frame ) )
)

(define-key global-map [(alt k)] 'lm-killw)

printing
(setq lpr-switches `("-Phprtg3so_ps") )

coding
(global-set-key [f5] 'next-error) 
(setq-default indent-tabs-mode nil)

xterm
(defun lm-xterm ()
  "create a xterm"
  (interactive)
  (call-process "xterm" nil 0 nil "-title" default-directory "-sb" "-sl" "5000" "-bg" "#000" "-fg" "#FFF" "-fn" "fixed")
)
(define-key global-map [(alt x)] 'lm-xterm)

other stuff  (le deuxième marche sur xemacs)
(define-key global-map [(alt o)] 'other-frame)
(global-set-key [C-tab] 'other-window)



Last update: October 20th, 2004 - Laurent