$hostname =~ m/\.(ncipherusa\.com$)/ ? 'bos' :
           0;
 
+$chiark=  $hostname =~ m/chiark/;
+
 %ncipherdom= ('cam' => 'ncipher.com',
              'bos' => 'ncipherusa.com');
 
 export PWD
 
 # My own functions
-ls() { /bin/ls -FC "$@" ; }
-ll() { /bin/ls -FClag "$@" ; }
+ls() { /bin/ls -FC "$@"; }
+ll() { /bin/ls -FClag "$@"; }
 setprompt() { PS1=`autotitle`; export PS1; }
 rs() { eval `/usr/openwin/bin/resize` ; setprompt ; }
 cd() { builtin cd "$@"; setprompt; }
 pu() { builtin pushd "$@"; setprompt; }
 po() { builtin popd "$@"; setprompt; }
 
-# newgrp() { 
-#      NEWGRPSHELL="${LOGINSHELL:-}"; export NEWGRPSHELL
-#      exec /bin/newgrp $*
-# }
-
-setenv () {
-       varname=`echo $1 | tr '[a-z]' '[A-Z]'`
-       eval "$varname=\"$2\"" ; export $varname ;
-}
-
-# if [ "${NEWGRPSHELL:-}" ]
-# then
-#      unset NEWGRPSHELL
-#      LOGINSHELL=true
-# fi
-
 # Set up history and prompt
 if [ "$PS1" ]
 then
        HISTFILE=$HOME/.history/$HOST~$$~
-       AUTOTITLE_STDOUT="${LOGINSHELL:+-}%?u%U%!%?g(%G)%!%?u@%!%h:%d1~.> "
+       AUTOTITLE_STDOUT="@@?
+ $chiark && $username eq 'ian' ?@@-@@;%?u%U%!%?g(%G)%!%?u@%!%h:%d1~.> "
        AUTOTITLE_WINDOW="%h - %d~. %Y.[U..[M..[D./..%X.L]..M]..R]./.. %U%?G(%G)%!"
        AUTOTITLE_ICON="%h: %d3~. %Y.[U..[M..[D./..%X.L]..M]..R]./.."
        export AUTOTITLE_STDOUT AUTOTITLE_WINDOW AUTOTITLE_ICON
        setprompt
 fi
-
-# Set up the terminal:
-# stty new intr '^c' erase '^?' kill '^x' susp '^z' dsusp '^y' eof '^d' \
-#      hupcl ixon ixoff -tostop quit '^\' 2>/dev/null
 
 
 xv*geometry:                   +10+10
 
+wish*foreground:               grey90
+wish*background:               grey25
+wish*activeForeground:         white
+wish*activeBackground:         grey35
+wish*disabledForeground:       black
+wish*disabledBackground:       grey25
+
 povray*geometry:               +40+10
 povray*background:             black
 povray*foreground:             black
 
 # Set up the environment:
 
 PATH=$HOME/personal/@@$platform@@/bin:$HOME/personal/scripts/bin
-@@?$ncipher?@@@@#
+
+@@?$ncipher?@@
 PATH=$PATH:$HOME/personal/crypto/scripts
-@@;@@#
-@@? -d '/opt/bin' ?@@@@#
+@@;
+
+@@? -d '/opt/bin' ?@@
 PATH=$PATH:/opt/bin
-@@;@@#
-@@? $uname eq 'HP-UX' ?@@@@#
+@@;
+
+@@? $uname eq 'HP-UX' ?@@
 PATH=$PATH:/usr/contrib/bin
-@@;@@#
+@@;
+
 PATH=$PATH:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/sbin:/usr/sbin
-@@? $uname eq 'SunOS' ?@@@@#
+
+@@? $uname eq 'SunOS' ?@@
 PATH=$PATH:/usr/ccs/bin
-@@;@@#
-@@? $uname eq 'AIX' ?@@@@#
+@@;
+
+@@? $uname eq 'AIX' ?@@
 PATH=$PATH:/usr/vac/bin
-@@;@@#
+@@;
+
 PATH=$PATH:@@$xbindir@@
 
 export PATH
 
 CDPATH=:..:$HOME:$HOME/things
 CVS_RSH=ssh
+
+unset MAILPATH
+
+@@?$ncipher?@@
 CVSROOT=:ext:cvs:/ncipher/local-CVS
+@@;
+
+@@?$chiark?@@
+CVSROOT=/usr/src/CVS
+NNTPAUTH="md5cookie1way ian"
+MAILPATH=/var/spool/mail/@@$username@@:$HOME/mail/SINBOX.DROP
+ORGANIZATION="Linux Unlimited"
+
+export MAILPATH NNTPAUTH ORGANISATION
+@@;
+
 EDITOR=emacs
-ESHELL=/usr/bin/bash
 HISTORY=256
 HOST=`hostname`
 LANG=C
 export NC_SITES
 @@;
 
-unset MAILPATH
 unset ignoreeof
 
 umask 002
 
-#!/bin/bash
+#!/bin/sh
 
 eval `.configs/configure`
 
 >".counters/v.$DISPLAY"
 
-# if [ $xauth = true ]
-# then
-#      nice -15 sh -c '
-#   xhost | perl -ne "s//xhost\t-/; print unless m/ /;" | sh 2>&1 \
-#         | perl -pe "s/^\S+ being removed from access control list\s+\$/-/";
-#        xhost -
-#      ' &
-# fi
-
 echo -n 'starting clients '
 
+#       xsetroot -fg '#883030' -bg '#204050' -bitmap bitmap/root
+#       xsetroot -cursor bitmap/circle bitmap/circle-inv -fg white -bg black
+#        xset b 75 300
+#if [ "x$1" != "xnotwm" ]; then
+# echo -n . ;   twm &
+#fi
+#echo -n . ;    xload &
+#echo -n . ;    xterm -n 'xterm d' -T xterm -geometry 80x25+0-10 &
+#echo -n . ;    emacs -f make-session &
+#echo -n . ;    unclutter -noevents &
+#echo -n . ;    xbiff -name xbiffs & xbiff & xbiff -name xbiff2 &
+#echo -n . ;    stty -isig
+#echo -n . ;    (while cat /dev/xconsole; do sleep 10; done) & sleep 1
+#really start-stop-daemon --stop --exec /usr/bin/X11/xconsole --user root --quie
+#
+#echo    . ;     exec xclock
+
 echo -n .
 
 sh .configs/x11start-colours=$colours
 
 echo -n .
 
-# if [ "x$chost" = x ]
-# then
-#      .configs/xclients &
-#      $echo -n .
-#         if [ "x$HOST" != xleek ]
-#         then
-#              xrsh leek /usr/bin/X11/xload -geometry 120x120+34+0 &
-#      fi
-# else
-#      $brokenserver && xhost +$chost +quince
-#      cat .configs/setenvir - .configs/xclients <<END | rsh $chost sh &
-#              DISPLAY=$display:0 export DISPLAY
-# END
-#      /usr/bin/X11/xload -geometry 120x120+34+0 &
-#      $echo -n .
-# fi
-
 .configs/xclients &
 # /usr/bin/X11/xload -geometry 120x120+34+0 &
 
 
 
 xterm -n 'xterm d' -T xterm -geometry 80x25+0-10 &
 
+@@?!$chiark?@@
 .configs/chiarks
+@@;
 
+@@?$ncipher?@@
 remoteshell -rrsh keynes -geometry 80x25+172+159 &
-
-echo -n :
-#
-#xbiff &
-
-# xab -iconic &
-# perl -e '$xab="xab"; exec $xab "other-xab"' &
-
-echo -n :
-
-remoteshell -rrsh dover -geometry 80x25-0-71
+@@;
 
 .configs/xbiffs
 
 
 # to cus.cam.ac.uk.
 
 echo '\e[10;0H'
-#(hidebackups &)
+
 echo -n 'Hit return for windows... '
 read inputline
 if [ "x$inputline" = x ]
 
 #   ^N = down    ^P = up
 #   ^B = left    ^F = right
 # will be enabled.
-emacs_keys=off
+emacs_keys=on
 
 # show_dotfiles specifies that the directory listing should include
 # "hidden" (dot) files/directories.  If set "on", this will be
 
-# Ian Jackson's .profile, mostly copied from.... (eng.cam.ac.uk)
-# CUED default .profile for /bin/sh or /bin/ksh initialization,
-# then customised for Engineering dept system. This version copied
-# to cl then customised for cl, thence to cam-orl.co.uk, thence
-# to chiark, thence to ncipher
+# Ian Jackson's .profile now in CVS
 
 . .configs/setenvir
 
 
 1024 35 155700069287664501281681012869914271738712974299223445134728148917038244934339506504036512587991354975597079464444531884524081235753658398521680648485217523189744866663620343244202894740688556556622894141027300629903247301893674346724263212189132860262301370559174882976578675034232773283098826237416726866517 iwj@newry
 1024 35 167024110043807390607791306968454709497383749367015887174525332872314230930819309173928755814031476357971033137981565695750851881200107954702727545222482244305854125457318066584672832766743125764695178980303010103131554068164375735120099921543449674127090714858103433637118604657374828557743842903894941567989 iwj@glastonbury
 @@:@@#
-1024 33 117385851636815625794682045272670348226429528350378659864768391051250351542749258151009620656468243493947746468877869045185455056624320499676925131648425561713585082385383007825961112176954557838606529291118468652728777501137394895737487546704720843287182661898072134181879704222022988749029714875365204438999 ian@anarres
+ssh-dss AAAAB3NzaC1kc3MAAACBAJijbPuhQjRlFW3q1aSakxzxjt2Im88MUQHwnBlFWNdnTiB8A4rXs6uq/XiF/NMf2SsgYxyVSps33t/fSIYs+cg17TCXHvznD4MUc0imk05wKPVLVVKrUJ89KeB3fa5s/1kU7FDqTiglpwx8dla7ZxAkWfnrr6y+lG6MTs7EoptRAAAAFQDXqO1IrImPCFPVEZsr9Mr6ytv4PwAAAIBXCSOIyMdfxdfRYRS+m/Xz7ayvS6K4XSe2n1UtzGRA+eFTPljFnxGJ5pin8cs/HhfDq5cRHCl4c8aXNDuX6weC1HBiNlWC72fqf2rg/oPpfr1lf/psP72qnaohdxgif0+vHr+XkAdvmIJbveZjEbfR/BGm3clPZBOfBW2jcJFJ0AAAAIBDjN08EurM7/fUuEY5o+3XmK4mjE5ItBzDLAXm3M5jzJSDqE71paDYm8/T/rBk+epJXNt0/pU+ncAPnntAts/9NY7nO4+ZyYU6rWtmylhGrDZVgIOsmJ8ctzlf5h4WYseoT4UdKqZzQnLIqVulN3XBpOCj67zt+hmR13CGOfyVsw== ian@davenant
 @@;@@#
 
 display_link 1
 frame 1
 tabstop 8
+@@?$chiark?@@@@#
+http_proxy http://www-cache.chiark.greenend.org.uk:3128/
+gopher_proxy http://www-cache.chiark.greenend.org.uk:3128/
+ftp_proxy http://www-cache.chiark.greenend.org.uk:3128/
+@@;@@#
 
 ; Un-disable narrow and eval-expression
 (put 'narrow-to-region 'disabled nil)
 (put 'eval-expression 'disabled nil)
+(standard-display-european t)
 ;
 ; Make sure we don't disturb links or change ownership, use numbers
 (setq backup-by-copying-when-mismatch t)
 ;
 ; Use auto-fill when editing text
 (add-hook 'text-mode-hook '(lambda () (auto-fill-mode 1)))
-(add-hook 'text-mode-hook '(lambda () (local-set-key " " 'self-insert-command)))
+; (add-hook 'text-mode-hook '(lambda () (local-set-key "       " 'self-insert-command)))
 ;
 ; Set up newline to auto-indent & other stuff for perl, c++ and c modes.
 (setq perl-mode-hook '(lambda () 
       vm-folder-directory "~/mail/"
       vm-delete-after-saving t
       vm-delete-empty-folders t
-      vm-mutable-windows nil
+      vm-mutable-windows t
       vm-auto-get-new-mail nil
       vm-auto-next-message nil
       vm-jump-to-new-messages nil
       vm-jump-to-unread-messages nil
+      vm-mime-digest-discard-header-regexp "only-drop-this-header"
       vm-preview-lines nil
       vm-included-text-prefix "> "
       vm-confirm-quit 1
       vm-frame-per-folder nil
       vm-tale-is-an-idiot t
       vm-primary-inbox (concat vm-folder-directory "INBOX")
-      vm-sysadmin-inbox (concat vm-folder-directory "SINBOX")
+      vm-sinbin-inbox (concat vm-folder-directory "SINBOX")
       vm-uninteresting-senders "ian"
       vm-reply-ignored-addresses
       (make-regexps-ignore-non-address
          "iwj10@cam.ac.uk" "Ian.Jackson@cl.cam.ac.uk"))
       mail-archive-file-name "~/mail/Outbound"
 
-@@?$ncipher?@@@@#
+@@?!$ncipher?@@
+      vm-spool-files
+      '((vm-primary-inbox "/var/spool/mail/@@$username@@"
+                         "~/mail/INBOX.CRASH")
+        (vm-primary-inbox "~/News/r" "~/mail/INBOX.CRASH")
+       (vm-primary-inbox "~/mbox" "~/mail/INBOX.CRASH")
+       (vm-primary-inbox "~/mail/Outbound" "~/mail/INBOX.CRASH")
+       (vm-primary-inbox "~/mail/Import" "~/mail/INBOX.CRASH")
+       (vm-primary-inbox "~/mail/Record" "~/mail/INBOX.CRASH")
+       (vm-sinbin-inbox "/var/spool/mail/ian" "~/mail/SINBOX.CRASH"))
+      vm-startup-with-summary t
+@@? $chiark && $username eq 'ian' ?@@
+
+@@:
       vm-spool-files (list
                       "~/mbox"
                       "~/mail/Outbound"
                       "~/News/r")
       mail-host-address "ncipher.com"
       user-mail-address "iwj@ncipher.com"
-@@;@@#
+@@;
 
 ;      vm-spool-files
 ;      (list
                    (setq mail-archive-file-name
                          "~/mail/SOutbound")))))
 ;
+;(defun vmi ()
+;  (interactive)
+;  (vm "/u/ijackson/mail/INBOX"))
+;;
 (defun vms ()
   (interactive)
-  (vm vm-sysadmin-inbox))
+  (vm vm-sinbin-inbox))
 ;
 (defun make-session ()
   "Makes this emacs hard to kill by requiring ^X^Cy to kill it
 
  >/dev/null && exit 0
 xload -geometry 120x120+@@
 
-@hostlist= ($ncipher eq 'bos' ? qw(viking dover pell arrakis) :
-            $ncipher eq 'cam' ? qw(jura islay dover dounreay marple belgrano greenock) :
-            qw(davenant anarres lsd));
+@hostlist=
+($ncipher eq 'bos' ? qw(viking dover pell arrakis) :
+ $ncipher eq 'cam' ? qw(jura islay dover dounreay marple belgrano greenock) :
+ $chiark ? qw(chiark) :
+ qw(davenant anarres lsd));
+
 for ($i=0; $i<@hostlist; $i++) { last if $hostlist[$i] eq $nodename; }
 if ($i>=@hostlist) {
     print STDERR "!! nodename $nodename not in $ncipher list @hostlist\n";
 
 #   @@;     vA      <------------------------------------
 #           ||         then
 #   comment ||          ?@@
-#       @@# ||
-#           ||       included text fragment as
+#       @@# \/
+#           /\       included text fragment as
 #      else ||         string value    code to write out
 #       @@: ||          (@@             {@@
 #           ||      <------------------------------------
 
 .bash_history                          0400
 
 .configs/checkconfig                   +x
-.configs/chiarks                       +x
 .configs/configure                     +x
 .configs/rxprofile                     +x
 .configs/startemacs                    +x
 .configs/xclients                      +x
 .configs/xprofile                      +x
 .configs/xtools                                +x
+
+@@?$ncipher?@@
+.configs/chiarks                       +x
+@@:
+.configs/chiarks                       --
+@@;
+
 personal/scripts/bin/iwjendian         +x
 personal/scripts/bin/remoteshell       +x
 personal/scripts/bin/xloadt            +x
 .ssh/authorized_keys                   644
 
 bitmap/root -> fischer
+
 .
 
     last if m/^\.$/;
     if (m/(.*\S)\s+\-\>\s+(\S.*)/) {
        $linktargs{$1}= $2;
+    } elsif (m/^(.*\S)\s+\-\-$/) {
+       $exclude{$1}= 1;
     } elsif (m/^(.*\S)\s+(\S+)$/) {
        ($of,$pe)=($1,$2);
        $isdir= $of =~ s,/$,,;
        length $1 eq 1 ? $1 : sprintf '%c', hex $1 
            /ge;
 
+    next if $exclude{$of};
+
     mkparents($of);
     $newf= 'new/'.$if;
     prep_proc('files/'.$if,$newf);
 
 nodename @@$nodename@@
 hostname @@$hostname@@
 ncipher  @@$ncipher@@
+chiark   @@$chiark@@