--- /dev/null
+### 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 '')
+}
(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))
(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)))