chiark / gitweb /
Merge branch 'master' of metalzone:etc/profile
authorMark Wooding <mdw@distorted.org.uk>
Tue, 14 Dec 2010 15:37:43 +0000 (15:37 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 14 Dec 2010 15:37:43 +0000 (15:37 +0000)
* 'master' of metalzone:etc/profile:
  el/dot-emacs.el: New command for SSH terminal buffers.
  dot/emacs, el/Makefile: Random fixes from vampire.

dot/bashrc
dot/rcrc [new file with mode: 0644]
el/dot-emacs.el
setup

index 17e18bb5af1d82706a8e70ca0334e6c3def9bf52..3ca074829a7c2a79039cc2364510e09df8d9ef67 100644 (file)
@@ -137,6 +137,7 @@ alias zgrep="greplike zgrep"
 
 alias cx='chmod a+x'
 alias which="command -v"
+alias rc="rc -l"
 alias ssync="rsync -e ssh"
 alias rootly=$__MDW_ROOTLY
 alias r=rootly
diff --git a/dot/rcrc b/dot/rcrc
new file mode 100644 (file)
index 0000000..2723b2c
--- /dev/null
+++ b/dot/rcrc
@@ -0,0 +1,41 @@
+### rc profile
+
+###--------------------------------------------------------------------------
+### Prompt machinery.
+
+host = `hostname
+
+if (~ $TERM linux* screen* xterm* vt100* eterm*) {
+       bold = `{tput bold} unbold = `{tput sgr0}
+} else {
+       bold = '' unbold = ''
+}
+
+if (~ `{id -u} 0) {
+       left = `{iconv -f utf8 -t //translit <<< «}
+       right = `{iconv -f utf8 -t //translit <<< »}
+} else {
+       u = `{id -un}
+       if (~ $u mdw mwooding) {
+               u = '' left = '[' right = ']'
+       } else {
+               u = $u^@ left = '{' right = '}'
+       }
+       if (~ $__mdw_tty `tty) {
+               left = '<' right = '>'
+       } else {
+               __mdw_tty = `tty
+       }
+}
+
+if (~ $#SSH_CLIENT 0 && ! ~ $__mdw_sechost $host) {
+       sec_l = '(' sec_r = ')'
+}
+
+fn prompt {
+       cwd = `pwd
+       if (~ $cwd $home $home/*) {
+               cwd = `{sed 's:^' ^ $home ^':~:' <<< $cwd}
+       }
+       prompt = ($bold$left$sec_l$u$host$sec_r^' '^$cwd$right$unbold '')
+}
index b5bdfd07cde0142d645235b65d45dcc1735af0d0..8dc526771f4a0341600ad14606a580a753339ce2 100644 (file)
@@ -1026,13 +1026,14 @@                   (defun-open . (add 0 c-indent-one-line-block))
                  (arglist-cont-nonempty . mdw-c-lineup-arglist)
                  (topmost-intro . mdw-c-indent-extern-mumble)
                  (cpp-define-intro . 0)
+                 (knr-argdecl . 0)
                  (inextern-lang . [0])
                  (label . 0)
                  (case-label . +)
                  (access-label . -)
                  (inclass . +)
                  (inline-open . ++)
-                 (statement-cont . 0)
+                 (statement-cont . +)
                  (statement-case-intro . +)))
               t))
 
@@ -2139,8 +2140,8 @@ (defun mdw-eshell-prompt ()
                   (home (expand-file-name "~")) (nhome (length home)))
              (if (and (>= npwd nhome)
                       (or (= nhome npwd)
-                          (= (elt pwd nhome) ?/)
-                      (string= (substring pwd 0 nhome) home)))
+                          (= (elt pwd nhome) ?/))
+                      (string= (substring pwd 0 nhome) home))
                  (concat "~" (substring pwd (length home)))
                pwd))
            right)))
diff --git a/setup b/setup
index 499841e3197e64f151c27102a9bc012b2057bd27..5242bd81a6cb93028d9421517e063f4b434e928c 100755 (executable)
--- a/setup
+++ b/setup
@@ -135,6 +135,7 @@ dotfiles="
   cgrc tigrc
   gdbinit
   guile
+  rcrc
   toprc
   aspell.conf
   lisp-init.lisp:.cmucl-init.lisp