The fix in 10.55 of exf.c had unwanted side effects.
[nvi.git] / tcl_scripts / gnats.tcl
blob623ea3d18b237983aa20841b40674e385fe2de95
1 # $Id: gnats.tcl,v 8.2 1995/11/18 12:59:07 bostic Exp $ (Berkeley) $Date: 1995/11/18 12:59:07 $
3 proc init {catFile} {
4 global viScreenId
5 global categories
6 set categories {}
7 set categoriesFile [open $catFile r]
8 while {[gets $categoriesFile line] >= 0} {
9 lappend categories $line
11 close $categoriesFile
12 viMsg $viScreenId $categories
13 viMapKey $viScreenId \x0e next
16 proc next {} {
17 global viScreenId
18 set cursor [viGetCursor $viScreenId]
19 set lineNum [lindex $cursor 0]
20 set line [viGetLine $viScreenId $lineNum]
21 viMsg $viScreenId [lindex $line 0]
22 if {[lindex $line 0] == ">Confidential:"} {
23 confNext $lineNum $line
24 } elseif {[lindex $line 0] == ">Severity:"} {
25 sevNext $lineNum $line
26 } elseif {[lindex $line 0] == ">Priority:"} {
27 priNext $lineNum $line
28 } elseif {[lindex $line 0] == ">Class:"} {
29 classNext $lineNum $line
30 } elseif {[lindex $line 0] == ">Category:"} {
31 catNext $lineNum $line
35 proc confNext {lineNum line} {
36 global viScreenId
37 viMsg $viScreenId [lindex $line 1]
38 if {[lindex $line 1] == "yes"} {
39 viSetLine $viScreenId $lineNum ">Confidential: no"
40 } else {
41 viSetLine $viScreenId $lineNum ">Confidential: yes"
45 proc sevNext {lineNum line} {
46 global viScreenId
47 viMsg $viScreenId [lindex $line 1]
48 if {[lindex $line 1] == "non-critical"} {
49 viSetLine $viScreenId $lineNum ">Severity: serious"
50 } elseif {[lindex $line 1] == "serious"} {
51 viSetLine $viScreenId $lineNum ">Severity: critical"
52 } elseif {[lindex $line 1] == "critical"} {
53 viSetLine $viScreenId $lineNum ">Severity: non-critical"
57 proc priNext {lineNum line} {
58 global viScreenId
59 viMsg $viScreenId [lindex $line 1]
60 if {[lindex $line 1] == "low"} {
61 viSetLine $viScreenId $lineNum ">Priority: medium"
62 } elseif {[lindex $line 1] == "medium"} {
63 viSetLine $viScreenId $lineNum ">Priority: high"
64 } elseif {[lindex $line 1] == "high"} {
65 viSetLine $viScreenId $lineNum ">Priority: low"
69 proc classNext {lineNum line} {
70 global viScreenId
71 viMsg $viScreenId [lindex $line 1]
72 if {[lindex $line 1] == "sw-bug"} {
73 viSetLine $viScreenId $lineNum ">Class: doc-bug"
74 } elseif {[lindex $line 1] == "doc-bug"} {
75 viSetLine $viScreenId $lineNum ">Class: change-request"
76 } elseif {[lindex $line 1] == "change-request"} {
77 viSetLine $viScreenId $lineNum ">Class: support"
78 } elseif {[lindex $line 1] == "support"} {
79 viSetLine $viScreenId $lineNum ">Class: sw-bug"
83 proc catNext {lineNum line} {
84 global viScreenId
85 global categories
86 viMsg $viScreenId [lindex $line 1]
87 set curr [lsearch -exact $categories [lindex $line 1]]
88 if {$curr == -1} {
89 set curr 0
91 viMsg $viScreenId $curr
92 viSetLine $viScreenId $lineNum ">Class: [lindex $categories $curr]"
95 init abekas