Tcl Library Source Code

Check-in [4245d06151]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improve rendering of copyright statements in special cases like 'public domain' and where the statement already includes the prefix 'copyright' (bug-3601370 issues 1 & 2)
Timelines: family | ancestors | descendants | both | bug-3601370-td
Files: files | file ages | folders
SHA1: 4245d06151dada863b49d773ce93709e06b6b8f3
User & Date: TrevorD 2013-01-18 12:35:54
References
2013-01-18
15:50
Fix incorrect copyright filter regexp in [4245d06151] check-in: 1e0a86a422 user: TrevorD tags: bug-3601370-td
Context
2013-01-18
12:39
Make the Swiss Army Knife (sak.tcl) prefer the Tcllib source modules in its directory tree to any others that may be known to the Tcl shell check-in: f537c38df0 user: TrevorD tags: bug-3601370-td
12:35
Improve rendering of copyright statements in special cases like 'public domain' and where the statement already includes the prefix 'copyright' (bug-3601370 issues 1 & 2) check-in: 4245d06151 user: TrevorD tags: bug-3601370-td
12:33
Fix nroff output to quote leading period on non-directive lines (bug-3601370 issues 3 & 4) check-in: fd708b57e1 user: TrevorD tags: bug-3601370-td
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to modules/doctools/mpformats/_common.tcl.

71
72
73
74
75
76
77








78




79
80
81
82
83
84
85
proc c_get_copyright {}     {
    global state

    set cc $state(copyright)
    if {$cc == {}} {set cc [dt_copyright]}
    if {$cc == {}} {return {}}









    return "Copyright [c_copyrightsymbol] [join $cc "\nCopyright [c_copyrightsymbol] "]"




}

proc c_provenance {} {
    return "Generated from file '[dt_file]' by tcllib/doctools with format '[dt_format]'"
}

################################################################






>
>
>
>
>
>
>
>
|
>
>
>
>







71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
proc c_get_copyright {}     {
    global state

    set cc $state(copyright)
    if {$cc == {}} {set cc [dt_copyright]}
    if {$cc == {}} {return {}}

    set stmts {}
    set re {^Copyright +(?:\(c\)|\\\(co|©) *(.+)$}
    foreach stmt $cc {
	if { [string equal -nocase "public domain" [string trim $stmt]] } {
            lappend stmts "Public domain"
	} elseif { [regexp -nocase -- $re $stmt -> stmt] } {
            lappend stmts $stmt
	} else {
            lappend stmts "Copyright [c_copyrightsymbol] $stmt"
	}
    }

    return [join $stmts \n]
}

proc c_provenance {} {
    return "Generated from file '[dt_file]' by tcllib/doctools with format '[dt_format]'"
}

################################################################