Index: sample.tclshrc ================================================================== --- sample.tclshrc +++ sample.tclshrc @@ -1,8 +1,8 @@ #!/bin/sh # FILE: "/home/joze/src/tclreadline/sample.tclshrc" -# LAST MODIFICATION: "Mon Aug 23 00:00:23 1999 (joze)" +# LAST MODIFICATION: "Mon Aug 23 00:55:51 1999 (joze)" # (C) 1999 by Johannes Zellner, # $Id$ # vim:set ft=tcl: \ exec tclsh "$0" "$@" @@ -20,11 +20,11 @@ # rename cd ::tclreadline::Cd # proc cd {args} { # if {[catch {eval ::tclreadline::Cd $args} message]} { # puts stderr "$message" # } - # ls + # tclreadline::ls # } # } # uncomment the following line to use # tclreadline's fancy ls proc. Index: tclreadlineSetup.tcl.in ================================================================== --- tclreadlineSetup.tcl.in +++ tclreadlineSetup.tcl.in @@ -1,8 +1,8 @@ #!/usr/local/bin/tclsh -# FILE: "/diska/home/joze/src/tclreadline/tclreadlineSetup.tcl.in" -# LAST MODIFICATION: "Mon Aug 23 00:34:14 1999 (joze)" +# FILE: "/home/joze/src/tclreadline/tclreadlineSetup.tcl.in" +# LAST MODIFICATION: "Mon Aug 23 00:54:01 1999 (joze)" # (C) 1998, 1999 by Johannes Zellner, # $Id$ # --- # # tclreadline -- gnu readline for tcl @@ -220,10 +220,18 @@ } else { return "" } return "NOTREACHED (this is probably an error)" } + +proc tclreadline::ls {args} { + if {[exec uname -s] == "Linux"} { + eval exec ls --color -FC [::tclreadline::Glob $args] + } else { + eval exec ls -FC [::tclreadline::Glob $args] + } +} proc ::tclreadline::Setup {} { uplevel #0 { @@ -264,29 +272,10 @@ return "$prompt_string \[$pwd\]" } } } - proc ls {args} { - if {[exec uname -s] == "Linux"} { - eval exec ls --color -FC [::tclreadline::Glob $args] - } else { - eval exec ls -FC [::tclreadline::Glob $args] - } - } - - if {[info procs cd] == ""} { - catch {rename ::tclreadline::Cd ""} - rename cd ::tclreadline::Cd - proc cd {args} { - if {[catch {eval ::tclreadline::Cd $args} message]} { - puts stderr "$message" - } - ls - } - } - if {[info procs exit] == ""} { catch {rename ::tclreadline::Exit ""} rename exit ::tclreadline::Exit