chiark / gitweb /
dot/tclshrc: Tcl configuration.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 23 Jun 2011 08:17:09 +0000 (09:17 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 23 Jun 2011 08:17:09 +0000 (09:17 +0100)
Currently just readline.

dot/tclshrc [new file with mode: 0644]
setup

diff --git a/dot/tclshrc b/dot/tclshrc
new file mode 100644 (file)
index 0000000..a25c8e1
--- /dev/null
@@ -0,0 +1,18 @@
+### -*-tcl-*-
+
+if {$tcl_interactive} {
+  if {![catch { package require tclreadline }]} {
+    proc _set_prompt {} {
+      set bold [exec tput bold]
+      set unbold [exec tput sgr0]
+      set interp [file tail [info nameofexecutable]]
+      proc ::tclreadline::prompt1 {} \
+         [list return "$bold$interp%$unbold "]
+      proc ::tclreadline::prompt2 {} \
+         [list return "$bold$interp>$unbold "]
+    }
+    _set_prompt
+    rename _set_prompt {}
+    ::tclreadline::Loop
+  }
+}
diff --git a/setup b/setup
index 307e3d001055584d6907f1e3493d62b95a4d8229..d5111d82576a540a95a3299608f4a23e576261f4 100755 (executable)
--- a/setup
+++ b/setup
@@ -140,6 +140,7 @@ dotfiles="
   toprc
   mc-ini:.mc/ini mc-panels.ini:.mc/panels.ini
   aspell.conf
+  tclshrc:.tclshrc tclshrc:.wishrc
   lisp-init.lisp:.cmucl-init.lisp
     lisp-init.lisp:.sbclrc
     lisp-init.lisp:.clisprc.lisp