Index: modules/doctools/ChangeLog ================================================================== --- modules/doctools/ChangeLog +++ modules/doctools/ChangeLog @@ -1,5 +1,13 @@ +2013-01-21 Andreas Kupries + + * checker.tcl: Added check to manpage_begin, reject spaces in title. + * mpformats/c.msg: Message catalogs extended with new warning + * mpformats/de.msg: 'mptitle' for spaces in the manpage title. + * mpformats/en.msg: The french catalog contains the english + * mpformats/fr.msg: text, and needs a translation. + 2012-02-27 Andreas Kupries * tests/text/04: Update the expected the result to match the new actual result. See the 2011-12-13 last-second bugfix in textutil::adjust::undent for the cause. Index: modules/doctools/checker.tcl ================================================================== --- modules/doctools/checker.tcl +++ modules/doctools/checker.tcl @@ -269,10 +269,11 @@ # ------------------------------------------------------------- # Formatting commands proc manpage_begin {title section version} { Enter manpage_begin if {[IsNot manpage_begin]} {Error mpbegin} + if {[string match {* *} $title]} {Error mptitle} Go header fmt_manpage_begin $title $section $version } proc moddesc {desc} { Enter moddesc Index: modules/doctools/mpformats/_common.tcl ================================================================== --- modules/doctools/mpformats/_common.tcl +++ modules/doctools/mpformats/_common.tcl @@ -73,11 +73,23 @@ set cc $state(copyright) if {$cc == {}} {set cc [dt_copyright]} if {$cc == {}} {return {}} - return "Copyright [c_copyrightsymbol] [join $cc "\nCopyright [c_copyrightsymbol] "]" + 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]'" } Index: modules/doctools/mpformats/_nroff.tcl ================================================================== --- modules/doctools/mpformats/_nroff.tcl +++ modules/doctools/mpformats/_nroff.tcl @@ -6,51 +6,52 @@ ################################################################ # nroff specific commands # -# All dot-commands (f.e. .PP) are returned with a leading \n, -# enforcing that they are on a new line. Any empty line created -# because of this is filtered out in the post-processing step. +# All dot-commands (f.e. .PP) are returned with a leading \n\1, +# enforcing that they are on a new line and will be protected as markup. +# Any empty line created because of this is filtered out in the +# post-processing step. -proc nr_lp {} {return \n.LP} +proc nr_lp {} {return \n\1.LP} proc nr_ta {{text {}}} {return ".ta$text"} proc nr_bld {} {return \1\\fB} -proc nr_bldt {t} {return "\n.B $t\n"} +proc nr_bldt {t} {return "\n\1.B $t\n"} proc nr_ul {} {return \1\\fI} proc nr_rst {} {return \1\\fR} -proc nr_p {} {return \n.PP\n} +proc nr_p {} {return \n\1.PP\n} proc nr_comment {text} {return "\1'\1\\\" [join [split $text \n] "\n\1'\1\\\" "]"} ; # " proc nr_enum {num} {nr_item " \[$num\]"} -proc nr_item {{text {}}} {return "\n.IP$text"} -proc nr_vspace {} {return \n.sp\n} -proc nr_blt {text} {return "\n.TP\n$text"} -proc nr_bltn {n text} {return "\n.TP $n\n$text"} -proc nr_in {} {return \n.RS} -proc nr_out {} {return \n.RE} -proc nr_nofill {} {return \n.nf} -proc nr_fill {} {return \n.fi} -proc nr_title {text} {return "\n.TH $text"} -proc nr_include {file} {return "\n.so $file"} -proc nr_bolds {} {return \n.BS} -proc nr_bolde {} {return \n.BE} +proc nr_item {{text {}}} {return "\n\1.IP$text"} +proc nr_vspace {} {return \n\1.sp\n} +proc nr_blt {text} {return "\n\1.TP\n$text"} +proc nr_bltn {n text} {return "\n\1.TP $n\n$text"} +proc nr_in {} {return \n\1.RS} +proc nr_out {} {return \n\1.RE} +proc nr_nofill {} {return \n\1.nf} +proc nr_fill {} {return \n\1.fi} +proc nr_title {text} {return "\n\1.TH $text"} +proc nr_include {file} {return "\n\1.so $file"} +proc nr_bolds {} {return \n\1.BS} +proc nr_bolde {} {return \n\1.BE} proc nr_read {fn} {return [nroffMarkup [dt_read $fn]]} -proc nr_cs {} {return \n.CS\n} -proc nr_ce {} {return \n.CE\n} +proc nr_cs {} {return \n\1.CS\n} +proc nr_ce {} {return \n\1.CE\n} proc nr_section {name} { if {![regexp {[ ]} $name]} { - return "\n.SH [string toupper $name]" + return "\n\1.SH [string toupper $name]" } - return "\n.SH \"[string toupper $name]\"" + return "\n\1.SH \"[string toupper $name]\"" } proc nr_subsection {name} { if {![regexp {[ ]} $name]} { - return "\n.SS [string toupper $name]" + return "\n\1.SS [string toupper $name]" } - return "\n.SS \"[string toupper $name]\"" + return "\n\1.SS \"[string toupper $name]\"" } ################################################################ @@ -65,15 +66,17 @@ global markupMap set markupMap [list \ "\\" "\1\\" \ "'" "\1'" \ + "." "\1." \ "\\\\" "\\"] global finalMap set finalMap [list \ "\1\\" "\\" \ "\1'" "'" \ + "\1." "." \ "\\" "\\\\"] global textMap set textMap [list "\\" "\\\\"] @@ -126,18 +129,22 @@ # the current line. We lift this line up and attach it # at the end of the last line to remove this # irregularity. Note that the regexp has to look for # the special 0x01 character as well to be sure that # the sequence in question truly is formatting. + # [bug-3601370] Only lift & attach if last line is not + # a directive set last [lindex $lines end] - set lines [lreplace $lines end end] - set line "$last $line" - } elseif {[string match '* $line]} { - # Apostrophes at the beginning of a line have to - # quoted to prevent misinterpretation as comments. - # The apostrophes for true comments are quoted with \1 + if { ! [string match "\1.*" $last] } { + set lines [lreplace $lines end end] + set line "$last $line" + } + } elseif {[string match {['.]*} $line]} { + # Apostrophes or periods at the beginning of a line have to + # quoted to prevent misinterpretation as comments or directives. + # The true comments and directive are quoted with \1 # already and will therefore not detected by the code # here. set line \1\\$line } @@ -158,13 +165,13 @@ # Remove superfluous .IP commands (empty paragraph). The first # identity mapping is there to avoid smashing a man macro # definition. set lines [string map [list \ - \n.IP\n..\n \n.IP\n..\n \ - \n.IP\n. \n.] \ + \n\1.IP\n\1..\n \n\1.IP\n\1..\n \ + \n\1.IP\n\1. \n\1.] \ $lines] # Return the modified result buffer return [string map $finalMap $lines] } Index: modules/doctools/mpformats/c.msg ================================================================== --- modules/doctools/mpformats/c.msg +++ modules/doctools/mpformats/c.msg @@ -4,10 +4,11 @@ mcset c end/open/list "End of manpage reached, \[list_end\] missing" mcset c end/open/example "End of manpage reached, \[example_end\] missing" mcset c end/open/mp "End of manpage reached, \[manpage_end\] missing" mcset c mpbegin "Command must be first of manpage" +mcset c mptitle "Spaces not allowed in manpage title" mcset c hdrcmd "Command not allowed outside of the header section" mcset c bodycmd "Command not allowed outside of the body of the manpage" mcset c body "Plain text not allowed outside of the body of the manpage" mcset c reqcmd "Command not allowed outside of header or requirement section" mcset c invalidlist "Invalid list type \"@\"" Index: modules/doctools/mpformats/de.msg ================================================================== --- modules/doctools/mpformats/de.msg +++ modules/doctools/mpformats/de.msg @@ -4,10 +4,11 @@ mcset de end/open/list "Dokument zu Ende, nicht alle Listen wurden geschlossen" mcset de end/open/example "Dokument zu Ende, das letzte Beispiel wurde nicht abgeschlossen" mcset de end/open/mp "Dokument zu Ende, es fehlt der Abschlussbefehl \[manpage_end\]" mcset de mpbegin "Erwartete diesen Befehl als ersten in der Manpage" +mcset de mptitle "Der Manpage Titel darf keine Leerzeichen enthalten" mcset de hdrcmd "Dieser Befehl ist ausserhalb des Headers nicht erlaubt" mcset de bodycmd "Dieser Befehl darf nicht ausserhalb des Hauptteils der Manpage auftreten" mcset de body "Text darf nicht ausserhalb des Hauptteils der Manpage auftreten" mcset de reqcmd "Dieser Befehl ist ausserhalb von Header/Requirements nicht erlaubt" mcset de invalidlist "Die Listenart \"@\" ist dem System nicht bekannt" Index: modules/doctools/mpformats/en.msg ================================================================== --- modules/doctools/mpformats/en.msg +++ modules/doctools/mpformats/en.msg @@ -4,10 +4,11 @@ mcset en end/open/list "End of manpage reached, \[list_end\] missing" mcset en end/open/example "End of manpage reached, \[example_end\] missing" mcset en end/open/mp "End of manpage reached, \[manpage_end\] missing" mcset en mpbegin "Command must be first of manpage" +mcset en mptitle "Spaces not allowed in manpage title" mcset en hdrcmd "Command not allowed outside of the header section" mcset en bodycmd "Command not allowed outside of the body of the manpage" mcset en body "Plain text not allowed outside of the body of the manpage" mcset en reqcmd "Command not allowed outside of header or requirement section" mcset en invalidlist "Invalid list type \"@\"" Index: modules/doctools/mpformats/fmt.nroff ================================================================== --- modules/doctools/mpformats/fmt.nroff +++ modules/doctools/mpformats/fmt.nroff @@ -82,11 +82,15 @@ append nroff [fmt_section {SEE ALSO}] \n append nroff [join [lsort $sa] ", "] \n } if {[llength $kw] > 0} { append nroff [fmt_section KEYWORDS] \n - append nroff [join [lsort $kw] ", "] \n + set kwline [join [lsort $kw] ", "] + if { [string match ".*" $kwline] } { + set kwline "\\$kwline" + } + append nroff $kwline \n } if {$ca ne ""} { append nroff [fmt_section CATEGORY] \n append nroff $ca \n } Index: modules/doctools/mpformats/fr.msg ================================================================== --- modules/doctools/mpformats/fr.msg +++ modules/doctools/mpformats/fr.msg @@ -4,10 +4,11 @@ mcset fr end/open/list "Fin de la page de manuel atteinte, \[list_end\] manquant" mcset fr end/open/example "Fin de la page de manuel atteinte, \[example_end\] manquant" mcset fr end/open/mp "Fin de la page de manuel atteinte, \[manpage_end\] manquant" mcset fr mpbegin "Cette commande doit \xEAtre la premi\xE8re de la page de manuel" +mcset fr mptitle "TODO: TRANSLATE: Spaces not allowed in manpage title" mcset fr hdrcmd "Commande interdite \xE0 l'ext\xE9rieur de l'en-t\xEAte" mcset fr bodycmd "Commande interdite \xE0 l'ext\xE9rieur du corps de la page de manuel" mcset fr body "Le texte est interdit \xE0 l'ext\xE9rieur du corps de la page de manuel" mcset fr reqcmd "Commande interdite \xE0 l'ext\xE9rieur de l'en-t\xEAte ou de la section de condition" mcset fr invalidlist "Type de liste non valide \"@\"" Index: modules/ldap/ldap.man ================================================================== --- modules/ldap/ldap.man +++ modules/ldap/ldap.man @@ -219,11 +219,11 @@ [para] [call [cmd ::ldap::searchEnd] [arg handle]] This command terminates a LDAP search initiated -by [call ::ldap::searchInit]. It also cleans up +by [cmd ::ldap::searchInit]. It also cleans up the internal state so a new search can be initiated. If the client has not yet received all results, the client sends an ABANDON message to inform the server that no further results for the previous search should to be sent. Index: modules/pop3/pop3.man ================================================================== --- modules/pop3/pop3.man +++ modules/pop3/pop3.man @@ -46,11 +46,11 @@ Setting this option tells the package that the server we are talking to is an MS Exchange server (which has some oddities we have to work around). The default is [const False]. -[opt_def -retr-mode retr|list|slow]. +[opt_def -retr-mode retr|list|slow] The retrieval mode determines how exactly messages are read from the server. The allowed values are [const retr], [const list] and [const slow]. Index: modules/struct/graph1.man ================================================================== --- modules/struct/graph1.man +++ modules/struct/graph1.man @@ -1,7 +1,7 @@ [comment {-*- tcl -*-}] -[manpage_begin {struct::graph v1} n 1.2.1] +[manpage_begin {struct::graph_v1} n 1.2.1] [copyright {2002 Andreas Kupries }] [moddesc {Tcl Data Structures}] [titledesc {Create and manipulate directed graph objects}] [category {Data structures}] [require Tcl 8.2] Index: modules/struct/matrix1.man ================================================================== --- modules/struct/matrix1.man +++ modules/struct/matrix1.man @@ -1,7 +1,7 @@ [comment {-*- tcl -*-}] -[manpage_begin {struct::matrix v1} n 1.2.1] +[manpage_begin {struct::matrix_v1} n 1.2.1] [copyright {2002 Andreas Kupries }] [moddesc {Tcl Data Structures}] [titledesc {Create and manipulate matrix objects}] [category {Data structures}] [require Tcl 8.2] Index: modules/struct/struct_tree1.man ================================================================== --- modules/struct/struct_tree1.man +++ modules/struct/struct_tree1.man @@ -1,7 +1,7 @@ [comment {-*- tcl -*-}] -[manpage_begin {struct::tree v1} n 1.2.2] +[manpage_begin {struct::tree_v1} n 1.2.2] [copyright {2002 Andreas Kupries }] [moddesc {Tcl Data Structures}] [titledesc {Create and manipulate tree objects}] [category {Data structures}] [require Tcl 8.2] Index: sak.tcl ================================================================== --- sak.tcl +++ sak.tcl @@ -5,11 +5,11 @@ # -------------------------------------------------------------- # Perform various checks and operations on the distribution. # SAK = Swiss Army Knife. set distribution [file dirname [info script]] -lappend auto_path [file join $distribution modules] +set auto_path [linsert $auto_path 0 [file join $distribution modules]] set critcldefault {} set critclnotes {} set dist_excluded {}