home *** CD-ROM | disk | FTP | other *** search
- proc key_'^K' {} {
- browse message {Edit key }
- set key [get key]
- set func key_[get keyname $key]
- set file [get env HOME]/.function
- if { [length [info procs $func] ] != 0 } {
- set def [list proc $func {} [info body $func]]
- } else {
- set def [list proc $func {} { ... }]
- }
- print $def\n $file
- browse message !vi $file
- browse shell [concat vi $file]
- source $file
- }
-
- proc save {file args} {
- if { [length $args chars] == 0 } {
- print "# *** all procs ***" $file
- print \n $file append
- set args [info procs]
- } else {
- print [concat {#} $args] $file
- print \n $file append
- }
- foreach proc $args {
- set def [list proc $proc [info args $proc] [info body $proc]]
- print \n$def\n $file append
- }
- }
-
- set helpfile [get env HOME]browse.help
-
- proc key_'?' {} {
- global helpfile more
- set key [get keyname [get key {Help on what key (? for all)? }]]
- if { [string compare '?' $key] == 0 } {
- browse message !$more $helpfile
- browse shell [concat $more $helpfile]
- } else {
- set line [exec grep ^$key $helpfile]
- if { [length $line chars] > 0 } {
- browse message $line
- } else {
- browse message {No help available on} $key
- }
- }
- }
-
-