1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#!/bin/sh
#----------------------------------------------------------------------
#
# Eskil, a Graphical frontend to diff
#
# Copyright (c) 1998-2004, Peter Spjuth (peter.spjuth@space.se)
#
# Usage
# Do 'eskil.tcl' for interactive mode
# Do 'eskil.tcl --help' for command line usage
#
#----------------------------------------------------------------------
# $Revision$
#----------------------------------------------------------------------
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
package provide app-eskil 2.0
package require Tcl 8.4
package require Tk 8.4
catch {package require textSearch}
package require pstools
namespace import -force pstools::*
if {[catch {package require psballoon}]} {
# Add a dummy if it does not exists.
proc addBalloon {args} {}
} else {
namespace import -force psballoon::addBalloon
}
set debug 0
set diffver "Version 2.0 2004-01-28"
set thisScript [file join [pwd] [info script]]
set thisDir [file dirname $thisScript]
# Follow any link
set tmplink $thisScript
while {[file type $tmplink] eq "link"} {
set tmplink [file readlink $tmplink]
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#!/bin/sh
#----------------------------------------------------------------------
#
# Eskil, a Graphical frontend to diff
#
# Copyright (c) 1998-2004, Peter Spjuth (peter.spjuth@space.se)
#
# Usage
# Do 'eskil.tcl' for interactive mode
# Do 'eskil.tcl --help' for command line usage
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
#----------------------------------------------------------------------
# $Revision$
#----------------------------------------------------------------------
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
package provide app-eskil 2.0
package require Tcl 8.4
# Stop Tk from meddling with the command line by copying it first.
set ::eskil(argv) $::argv
set ::eskil(argc) $::argc
set ::argv {}
set ::argc 0
package require Tk 8.4
catch {package require textSearch}
package require pstools
namespace import -force pstools::*
if {[catch {package require psballoon}]} {
# Add a dummy if it does not exists.
proc addBalloon {args} {}
} else {
namespace import -force psballoon::addBalloon
}
set debug 0
set diffver "Version 2.0.1 2004-02-10"
set thisScript [file join [pwd] [info script]]
set thisDir [file dirname $thisScript]
# Follow any link
set tmplink $thisScript
while {[file type $tmplink] eq "link"} {
set tmplink [file readlink $tmplink]
|
︙ | | | ︙ | |
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
|
# Save the merge result.
proc saveMerge {top} {
global diff
set w $top.merge.t
if {$diff($top,mergeFile) eq ""} {
if {[info exists diff($top,rightDir)]} {
set initDir $diff($top,rightDir)
} elseif {[info exists diff($top,leftDir)]} {
set initDir $diff($top,leftDir)
} else {
set initDir [pwd]
}
set apa [tk_getSaveFile -title "Save merge file" -initialdir $initDir]
if {$apa eq ""} return
set diff($top,mergeFile) $apa
}
set ch [open $diff($top,mergeFile) "w"]
puts -nonewline $ch [$w get 1.0 end-1char]
close $ch
tk_messageBox -parent $top.merge -icon info -type ok -title "Diff" \
-message "Saved merge to file $diff($top,mergeFile)."
|
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
>
|
|
>
|
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
|
# Save the merge result.
proc saveMerge {top} {
global diff
set w $top.merge.t
if {$diff($top,mergeFile) eq ""} {
set apa no
if {[string match "conflict*" $diff($top,mode)]} {
set apa [tk_messageBox -parent $top.merge -icon question \
-title "Save merge file" -type yesno -message \
"Do you want to overwrite the original conflict file?"]
}
if {$apa == "yes"} {
set diff($top,mergeFile) $diff($top,conflictFile)
} else {
# Browse
if {[info exists diff($top,rightDir)]} {
set initDir $diff($top,rightDir)
} elseif {[info exists diff($top,leftDir)]} {
set initDir $diff($top,leftDir)
} else {
set initDir [pwd]
}
set apa [tk_getSaveFile -title "Save merge file" -initialdir $initDir \
-parent $top.merge]
if {$apa eq ""} return
set diff($top,mergeFile) $apa
}
}
set ch [open $diff($top,mergeFile) "w"]
puts -nonewline $ch [$w get 1.0 end-1char]
close $ch
tk_messageBox -parent $top.merge -icon info -type ok -title "Diff" \
-message "Saved merge to file $diff($top,mergeFile)."
|
︙ | | | ︙ | |
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
|
set diff($top,rightOK) 1
set diff($top,mode) ""
wm deiconify $top
raise $top
update
doDiff $top
}
# Build the main window
proc makeDiffWin {{top {}}} {
global Pref tcl_platform debug
if {$top != "" && [winfo exists $top] && [winfo toplevel $top] eq $top} {
# Reuse the old window
|
>
>
>
>
>
>
>
>
>
>
>
|
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
|
set diff($top,rightOK) 1
set diff($top,mode) ""
wm deiconify $top
raise $top
update
doDiff $top
}
# A thing to easily get to debug mode
proc backDoor {a} {
append ::eskil(backdoor) $a
set ::eskil(backdoor) [string range $::eskil(backdoor) end-9 end]
if {$::eskil(backdoor) eq "PeterDebug"} {
set ::debug 1
catch {console show}
set ::eskil(backdoor) ""
}
}
# Build the main window
proc makeDiffWin {{top {}}} {
global Pref tcl_platform debug
if {$top != "" && [winfo exists $top] && [winfo toplevel $top] eq $top} {
# Reuse the old window
|
︙ | | | ︙ | |
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
|
$top.mo.m add command -label "Colours..." -underline 0 -command makePrefWin
$top.mo.m add checkbutton -label "Diffs only" -variable Pref(onlydiffs)
if {$tcl_platform(platform) eq "windows"} {
$top.mo.m add checkbutton -label "Force crlf translation" \
-variable Pref(crlf)
}
$top.mo.m add separator
$top.mo.m add command -label "Save default" -command saveOptions
menu $top.mo.mf
$top.mo.mf add command -label "Select..." -command makeFontWin
$top.mo.mf add radiobutton -label 6 -variable Pref(fontsize) -value 6 \
-command chFont
$top.mo.mf add radiobutton -label 7 -variable Pref(fontsize) -value 7 \
-command chFont
|
|
>
|
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
|
$top.mo.m add command -label "Colours..." -underline 0 -command makePrefWin
$top.mo.m add checkbutton -label "Diffs only" -variable Pref(onlydiffs)
if {$tcl_platform(platform) eq "windows"} {
$top.mo.m add checkbutton -label "Force crlf translation" \
-variable Pref(crlf)
}
$top.mo.m add separator
$top.mo.m add command -label "Save default" \
-command [list saveOptions $top]
menu $top.mo.mf
$top.mo.mf add command -label "Select..." -command makeFontWin
$top.mo.mf add radiobutton -label 6 -variable Pref(fontsize) -value 6 \
-command chFont
$top.mo.mf add radiobutton -label 7 -variable Pref(fontsize) -value 7 \
-command chFont
|
︙ | | | ︙ | |
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
|
catch {font delete myfont}
font create myfont -family $Pref(fontfamily) -size $Pref(fontsize)
fileLabel $top.l1 -textvariable diff($top,leftLabel)
fileLabel $top.l2 -textvariable diff($top,rightLabel)
frame $top.ft1 -borderwidth 2 -relief sunken
text $top.ft1.tl -height 40 -width 5 -wrap none \
-font myfont -borderwidth 0 -padx 0 -highlightthickness 0 \
-takefocus 0
text $top.ft1.tt -height 40 -width 80 -wrap none \
-xscrollcommand [list $top.sbx1 set] \
-font myfont -borderwidth 0 -padx 1 \
-highlightthickness 0
frame $top.ft1.f -width 2 -height 2 -bg lightgray
pack $top.ft1.tl -side left -fill y
pack $top.ft1.f -side left -fill y
pack $top.ft1.tt -side right -fill both -expand 1
scrollbar $top.sby -orient vertical
scrollbar $top.sbx1 -orient horizontal -command [list $top.ft1.tt xview]
set ::diff($top,wLine1) $top.ft1.tl
set ::diff($top,wDiff1) $top.ft1.tt
frame $top.ft2 -borderwidth 2 -relief sunken
text $top.ft2.tl -height 60 -width 5 -wrap none \
-font myfont -borderwidth 0 -padx 0 -highlightthickness 0 \
-takefocus 0
text $top.ft2.tt -height 60 -width 80 -wrap none \
-xscrollcommand [list $top.sbx2 set] \
-font myfont -borderwidth 0 -padx 1 \
-highlightthickness 0
frame $top.ft2.f -width 2 -height 2 -bg lightgray
pack $top.ft2.tl -side left -fill y
pack $top.ft2.f -side left -fill y
pack $top.ft2.tt -side right -fill both -expand 1
|
|
|
|
|
|
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
|
catch {font delete myfont}
font create myfont -family $Pref(fontfamily) -size $Pref(fontsize)
fileLabel $top.l1 -textvariable diff($top,leftLabel)
fileLabel $top.l2 -textvariable diff($top,rightLabel)
frame $top.ft1 -borderwidth 2 -relief sunken
text $top.ft1.tl -height $Pref(lines) -width 5 -wrap none \
-font myfont -borderwidth 0 -padx 0 -highlightthickness 0 \
-takefocus 0
text $top.ft1.tt -height $Pref(lines) -width $Pref(linewidth) -wrap none \
-xscrollcommand [list $top.sbx1 set] \
-font myfont -borderwidth 0 -padx 1 \
-highlightthickness 0
frame $top.ft1.f -width 2 -height 2 -bg lightgray
pack $top.ft1.tl -side left -fill y
pack $top.ft1.f -side left -fill y
pack $top.ft1.tt -side right -fill both -expand 1
scrollbar $top.sby -orient vertical
scrollbar $top.sbx1 -orient horizontal -command [list $top.ft1.tt xview]
set ::diff($top,wLine1) $top.ft1.tl
set ::diff($top,wDiff1) $top.ft1.tt
frame $top.ft2 -borderwidth 2 -relief sunken
text $top.ft2.tl -height $Pref(lines) -width 5 -wrap none \
-font myfont -borderwidth 0 -padx 0 -highlightthickness 0 \
-takefocus 0
text $top.ft2.tt -height $Pref(lines) -width $Pref(linewidth) -wrap none \
-xscrollcommand [list $top.sbx2 set] \
-font myfont -borderwidth 0 -padx 1 \
-highlightthickness 0
frame $top.ft2.f -width 2 -height 2 -bg lightgray
pack $top.ft2.tl -side left -fill y
pack $top.ft2.f -side left -fill y
pack $top.ft2.tt -side right -fill both -expand 1
|
︙ | | | ︙ | |
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
|
bind $top.c <Configure> [list drawMap $top %h]
bind $top <Key-Up> [list scrollText $top -1 u]
bind $top <Key-Down> [list scrollText $top 1 u]
bind $top <Key-Prior> [list scrollText $top -1 p]
bind $top <Key-Next> [list scrollText $top 1 p]
bind $top <Key-Escape> [list focus $top]
pack $top.mf $top.mo $top.ms $top.mt -in $top.f -side left -anchor n
pack $top.mh -in $top.f -side left -anchor n
pack $top.bfn -in $top.f -side right -padx {3 6}
pack $top.bfp $top.er2 $top.lr2 $top.er1 $top.lr1 $top.eo $top.lo \
-in $top.f -side right -padx 3
if {$debug == 1} {
|
>
>
>
|
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
|
bind $top.c <Configure> [list drawMap $top %h]
bind $top <Key-Up> [list scrollText $top -1 u]
bind $top <Key-Down> [list scrollText $top 1 u]
bind $top <Key-Prior> [list scrollText $top -1 p]
bind $top <Key-Next> [list scrollText $top 1 p]
bind $top <Key-Escape> [list focus $top]
if {$debug == 0} {
bind $top <Key> "backDoor %A"
}
pack $top.mf $top.mo $top.ms $top.mt -in $top.f -side left -anchor n
pack $top.mh -in $top.f -side left -anchor n
pack $top.bfn -in $top.f -side right -padx {3 6}
pack $top.bfp $top.er2 $top.lr2 $top.er1 $top.lr1 $top.eo $top.lo \
-in $top.f -side right -padx 3
if {$debug == 1} {
|
︙ | | | ︙ | |
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
|
label $l.old2 -text $old
label $l.new1 -text "New value:"
label $l.new2 -text $newvalue
button $l.change -text "Change" -width 10 -command \
"[list registry set $key {} $newvalue] ; \
[list $l.change configure -state disabled]"
if {[string equal $newvalue $old]} {
$l.change configure -state disabled
}
grid $l.key1 $l.key2 -sticky "w" -padx 4 -pady 4
grid $l.old1 $l.old2 -sticky "w" -padx 4 -pady 4
grid $l.new1 $l.new2 -sticky "w" -padx 4 -pady 4
grid $l.change - -sticky "e" -padx 4 -pady 4
grid columnconfigure $l 1 -weight 1
}
proc makeRegistryWin {} {
global thisScript
# Locate executable for this program
set exe [info nameofexecutable]
|
>
>
>
>
>
>
|
|
|
>
|
|
|
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
|
label $l.old2 -text $old
label $l.new1 -text "New value:"
label $l.new2 -text $newvalue
button $l.change -text "Change" -width 10 -command \
"[list registry set $key {} $newvalue] ; \
[list $l.change configure -state disabled]"
button $l.delete -text "Delete" -width 10 -command \
"[list registry delete $key] ; \
[list $l.delete configure -state disabled]"
if {[string equal $newvalue $old]} {
$l.change configure -state disabled
}
if {[string equal "" $old]} {
$l.delete configure -state disabled
}
grid $l.key1 $l.key2 - -sticky "w" -padx 4 -pady 4
grid $l.old1 $l.old2 - -sticky "w" -padx 4 -pady 4
grid $l.new1 $l.new2 - -sticky "w" -padx 4 -pady 4
grid $l.delete - $l.change -sticky "w" -padx 4 -pady 4
grid $l.change -sticky "e"
grid columnconfigure $l 2 -weight 1
}
proc makeRegistryWin {} {
global thisScript
# Locate executable for this program
set exe [info nameofexecutable]
|
︙ | | | ︙ | |
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
|
-label "Use Diff"
$top.mo.mc add radiobutton -variable Pref(comparelevel) -value 3 \
-label "Diff, ignore blanks"
$top.mo.mc add radiobutton -variable Pref(comparelevel) -value 4 \
-label "Diff, ignore case"
$top.mo.mc add radiobutton -variable Pref(comparelevel) -value 5 \
-label "Diff, ignore RCS"
pack $top.mf $top.mo -in $top.fm -side left -anchor n
if {$::debug} {
menubutton $top.md -text "Debug" -menu $top.md.m -underline 0
menu $top.md.m
if {$::tcl_platform(platform) eq "windows"} {
$top.md.m add checkbutton -label "Console" -variable consolestate \
-onvalue show -offvalue hide -command {console $consolestate}
$top.md.m add separator
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
|
-label "Use Diff"
$top.mo.mc add radiobutton -variable Pref(comparelevel) -value 3 \
-label "Diff, ignore blanks"
$top.mo.mc add radiobutton -variable Pref(comparelevel) -value 4 \
-label "Diff, ignore case"
$top.mo.mc add radiobutton -variable Pref(comparelevel) -value 5 \
-label "Diff, ignore RCS"
menubutton $top.mt -text "Tools" -underline 0 -menu $top.mt.m
menu $top.mt.m
$top.mt.m add command -label "New Diff Window" -underline 0 \
-command makeDiffWin
$top.mt.m add command -label "Clip Diff" -underline 0 \
-command makeClipDiffWin
if {$::tcl_platform(platform) eq "windows"} {
if {![catch {package require registry}]} {
$top.mt.m add separator
$top.mt.m add command -label "Setup Registry" -underline 6 \
-command makeRegistryWin
}
}
pack $top.mf $top.mo $top.mt -in $top.fm -side left -anchor n
if {$::debug} {
menubutton $top.md -text "Debug" -menu $top.md.m -underline 0
menu $top.md.m
if {$::tcl_platform(platform) eq "windows"} {
$top.md.m add checkbutton -label "Console" -variable consolestate \
-onvalue show -offvalue hide -command {console $consolestate}
$top.md.m add separator
|
︙ | | | ︙ | |
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
|
-bg [$w cget -bg]
pack $w.t -side top -expand y -fill both
$w.t insert end "A Tcl/Tk frontend to diff\n\n"
$w.t insert end "$diffver\n\n"
$w.t insert end "Made by Peter Spjuth\n"
$w.t insert end "E-Mail: peter.spjuth@space.se\n"
$w.t insert end "\nTcl version: [info patchlevel]\n"
$w.t insert end "\nCredits:\n"
$w.t insert end "Ideas for scrollbar map and merge function\n"
$w.t insert end "taken from TkDiff"
set last [lindex [split [$w.t index end] "."] 0]
$w.t configure -height $last
|
>
|
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
|
-bg [$w cget -bg]
pack $w.t -side top -expand y -fill both
$w.t insert end "A Tcl/Tk frontend to diff\n\n"
$w.t insert end "$diffver\n\n"
$w.t insert end "Made by Peter Spjuth\n"
$w.t insert end "E-Mail: peter.spjuth@space.se\n"
$w.t insert end "\nURL: http://spjuth.pointclark.net/Eskil.html\n"
$w.t insert end "\nTcl version: [info patchlevel]\n"
$w.t insert end "\nCredits:\n"
$w.t insert end "Ideas for scrollbar map and merge function\n"
$w.t insert end "taken from TkDiff"
set last [lindex [split [$w.t index end] "."] 0]
$w.t configure -height $last
|
︙ | | | ︙ | |
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
|
-print <file> : Generate postscript and exit.
-limit <lines> : Do not process more than <lines> lines.}
}
proc parseCommandLine {} {
global diff dirdiff Pref
global argv argc tcl_platform
if {$argc == 0} {
makeDiffWin
return
}
set noautodiff 0
set autobrowse 0
set dodir 0
set doclip 0
set files ""
set nextArg ""
set revNo 1
foreach arg $argv {
if {$nextArg != ""} {
if {$nextArg eq "mergeFile"} {
set opts(mergeFile) [file join [pwd] $arg]
} elseif {$nextArg eq "printFile"} {
set opts(printFile) [file join [pwd] $arg]
} elseif {$nextArg eq "revision"} {
set opts(doptrev$revNo) $arg
incr revNo
} elseif {$nextArg eq "limitlines"} {
set opts(limitlines) $arg
}
set nextArg ""
continue
}
if {$arg eq "-w"} {
set Pref(ignore) "-w"
} elseif {$arg eq "--help"} {
printUsage
exit
} elseif {$arg eq "-b"} {
set Pref(ignore) "-b"
} elseif {$arg eq "-noignore"} {
set Pref(ignore) " "
} elseif {$arg eq "-noparse"} {
|
<
|
|
|
|
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
|
-print <file> : Generate postscript and exit.
-limit <lines> : Do not process more than <lines> lines.}
}
proc parseCommandLine {} {
global diff dirdiff Pref
if {$::eskil(argc) == 0} {
makeDiffWin
return
}
set noautodiff 0
set autobrowse 0
set dodir 0
set doclip 0
set files ""
set nextArg ""
set revNo 1
foreach arg $::eskil(argv) {
if {$nextArg != ""} {
if {$nextArg eq "mergeFile"} {
set opts(mergeFile) [file join [pwd] $arg]
} elseif {$nextArg eq "printFile"} {
set opts(printFile) [file join [pwd] $arg]
} elseif {$nextArg eq "revision"} {
set opts(doptrev$revNo) $arg
incr revNo
} elseif {$nextArg eq "limitlines"} {
set opts(limitlines) $arg
}
set nextArg ""
continue
}
if {$arg eq "-w"} {
set Pref(ignore) "-w"
} elseif {$arg eq "--help" || $arg eq "-help"} {
printUsage
exit
} elseif {$arg eq "-b"} {
set Pref(ignore) "-b"
} elseif {$arg eq "-noignore"} {
set Pref(ignore) " "
} elseif {$arg eq "-noparse"} {
|
︙ | | | ︙ | |
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
|
set autobrowse 1
} elseif {$arg eq "-conflict"} {
set opts(mode) "conflict"
set Pref(ignore) " "
} elseif {$arg eq "-print"} {
set nextArg printFile
} elseif {$arg eq "-server"} {
if {$tcl_platform(platform) eq "windows"} {
catch {
package require dde
dde servername Eskil
}
} else {
tk appname Eskil
}
|
|
|
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
|
set autobrowse 1
} elseif {$arg eq "-conflict"} {
set opts(mode) "conflict"
set Pref(ignore) " "
} elseif {$arg eq "-print"} {
set nextArg printFile
} elseif {$arg eq "-server"} {
if {$::tcl_platform(platform) eq "windows"} {
catch {
package require dde
dde servername Eskil
}
} else {
tk appname Eskil
}
|
︙ | | | ︙ | |
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
|
set diff($top,leftLabel) "CVS"
after idle [list doDiff $top]
}
}
}
}
proc saveOptions {} {
global Pref
set rcfile "~/.eskilrc"
if {[catch {set ch [open $rcfile w]} err]} {
tk_messageBox -icon error -title "File error" -message \
"Error when trying to save preferences:\n$err"
return
}
foreach i [array names Pref] {
puts $ch [list set Pref($i) $Pref($i)]
}
close $ch
tk_messageBox -icon info -title "Saved" -message \
"Prefrences saved to:\n[file nativename $rcfile]"
}
proc getOptions {} {
global Pref
set Pref(fontsize) 8
set Pref(fontfamily) Courier
set Pref(ignore) "-b"
set Pref(parse) 2
set Pref(lineparsewords) "0"
set Pref(extralineparse) 1
set Pref(colorchange) red
set Pref(colornew1) darkgreen
set Pref(colornew2) blue
set Pref(bgchange) #ffe0e0
set Pref(bgnew1) #a0ffa0
set Pref(bgnew2) #e0e0ff
set Pref(onlydiffs) 0
set Pref(context) 2
set Pref(crlf) 0
set Pref(marklast) 1
# Directory diff options
set Pref(comparelevel) 1
set Pref(recursive) 0
set Pref(dir,onlydiffs) 0
set Pref(nodir) 0
set Pref(autocompare) 1
set ::diff(filter) ""
if {[file exists "~/.eskilrc"]} {
safeLoad "~/.eskilrc" Pref
}
}
proc defaultGuiOptions {} {
catch {package require griffin}
option add *Menu.tearOff 0
if {[tk windowingsystem] eq "x11"} {
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
>
>
>
>
>
>
>
|
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
|
set diff($top,leftLabel) "CVS"
after idle [list doDiff $top]
}
}
}
}
proc saveOptions {top} {
global Pref
# Check if the window size has changed
set w $::diff($top,wDiff1)
if {[winfo reqwidth $w] != [winfo width $w] || \
[winfo reqheight $w] != [winfo height $w]} {
set dx [expr {[winfo width $w] - [winfo reqwidth $w]}]
set dy [expr {[winfo height $w] - [winfo reqheight $w]}]
set cx [font measure myfont 0]
set cy [font metrics myfont -linespace]
set neww [expr {[$w cget -width] + $dx / $cx}]
set newh [expr {[$w cget -height] + $dy / $cy}]
if {$neww != $Pref(linewidth) || $newh != $Pref(lines)} {
set apa [tk_messageBox -title "Save Preferences" -icon question \
-type yesno -message "Should I save the current window\
size with the preferences?\nCurrent: $neww x $newh Old:\
$Pref(linewidth) x $Pref(lines)"]
if {$apa == "yes"} {
set Pref(linewidth) $neww
set Pref(lines) $newh
}
}
}
set rcfile "~/.eskilrc"
if {[catch {set ch [open $rcfile "w"]} err]} {
tk_messageBox -icon error -title "File error" -message \
"Error when trying to save preferences:\n$err"
return
}
foreach i [array names Pref] {
puts $ch [list set Pref($i) $Pref($i)]
}
close $ch
tk_messageBox -icon info -title "Saved" -message \
"Preferences saved to:\n[file nativename $rcfile]"
}
proc getOptions {} {
global Pref
set Pref(fontsize) 8
set Pref(fontfamily) Courier
set Pref(ignore) "-b"
set Pref(parse) 2
set Pref(lineparsewords) 0
set Pref(extralineparse) 1
set Pref(colorchange) red
set Pref(colornew1) darkgreen
set Pref(colornew2) blue
set Pref(bgchange) #ffe0e0
set Pref(bgnew1) #a0ffa0
set Pref(bgnew2) #e0e0ff
set Pref(onlydiffs) 0
set Pref(context) 2
set Pref(crlf) 0
set Pref(marklast) 1
set Pref(linewidth) 80
set Pref(lines) 60
set Pref(editor) ""
# Directory diff options
set Pref(comparelevel) 1
set Pref(recursive) 0
set Pref(dir,onlydiffs) 0
set Pref(nodir) 0
set Pref(autocompare) 1
set ::diff(filter) ""
if {[file exists "~/.eskilrc"]} {
safeLoad "~/.eskilrc" Pref
}
if {$Pref(editor) ne ""} {
set ::util(editor) $Pref(editor)
}
}
proc defaultGuiOptions {} {
catch {package require griffin}
option add *Menu.tearOff 0
if {[tk windowingsystem] eq "x11"} {
|
︙ | | | ︙ | |