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
- }
- }
-
- proc macro_'#' {} { return [get cwd] }
-
- proc key_'s' {} {
- set f [stream open [get file .] r]
- for {} { [stream gets $f line] } {} {
- if {[string match Subject:* $line]} {
- browse message $line
- break
- }
- }
- stream close $f
- }
-
- proc key_'g' {} {
- set f [stream open [get file .] r]
- for {} { [stream gets $f line] } {} {
- if {[string match Newsgroups:* $line]} {
- browse message [range $line 1 end]
- break
- }
- }
- stream close $f
- }
-
- proc key_'i' {} {
- if { [string match *line [get mode]] } { browse redraw }
- }
-
- proc key_'^F' {} {
- set func [get line {Edit function }]
- if { [length $func chars] == 0 }
- return
- 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 key_'S' {} {
- set f [stream open [get file .] r]
- set newname [get file .]
- for {} { [stream gets $f line] } {} {
- if {[string match Subject:* $line]} {
- set newname [get line $line\ =\ ]
- break
- }
- }
- stream close $f
- browse rename [get file .] $newname
- }
-
- proc key_'?' {} {
- set fd [stream open [get file .] r]
- for {} { [stream gets $fd line] } {} {
- set line [range <$line> 0 78 chars]
- set key [get key $line]
- if { [string compare $key ?] != 0 } break
- }
- if { [string compare $key ?] == 0 } {
- browse message
- } else {
- eval key_[get keyname $key]
- }
- stream close $fd
- }
-