From 78097dfcd572aa98629093eec31f6ab42971a248 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 3 Feb 2006 21:03:00 +0100 Subject: stable 2006.02.03 21:03 --- scripts/context/ruby/base/tex.rb | 2 +- scripts/context/ruby/ctxtools.rb | 39 +++++++++++++++++++++++++- tex/context/base/cont-new.tex | 2 +- tex/context/base/context.tex | 2 +- tex/context/base/core-mis.tex | 59 ++++++++++++++++++++++++++------------- tex/context/base/enco-fde.tex | 7 +++-- tex/context/base/page-set.tex | 22 ++++++++++++--- tex/context/base/spec-fdf.tex | 26 ++++++++++++----- tex/context/base/syst-ext.tex | 12 ++++++++ tex/context/interface/keys-cz.xml | 2 +- tex/context/interface/keys-de.xml | 2 +- tex/context/interface/keys-en.xml | 2 +- tex/context/interface/keys-fr.xml | 2 +- tex/context/interface/keys-it.xml | 2 +- tex/context/interface/keys-nl.xml | 2 +- tex/context/interface/keys-ro.xml | 2 +- 16 files changed, 142 insertions(+), 43 deletions(-) diff --git a/scripts/context/ruby/base/tex.rb b/scripts/context/ruby/base/tex.rb index 15b18f255..ea909aabc 100644 --- a/scripts/context/ruby/base/tex.rb +++ b/scripts/context/ruby/base/tex.rb @@ -1246,7 +1246,7 @@ class TEX envs = envs.uniq.join(',') mods = mods.uniq.join(',') - report("using search method '#{Kpse.searchmethod}'") if verbose + report("using search method '#{Kpse.searchmethod}'") if getvariable('verbose') report("using environments #{envs}") if envs.length > 0 report("using modules #{mods}") if mods.length > 0 diff --git a/scripts/context/ruby/ctxtools.rb b/scripts/context/ruby/ctxtools.rb index a8fb4dde2..4c47d643e 100644 --- a/scripts/context/ruby/ctxtools.rb +++ b/scripts/context/ruby/ctxtools.rb @@ -17,7 +17,7 @@ # # todo: move kpse call to kpse class/module -banner = ['CtxTools', 'version 1.3.0', '2004/2005', 'PRAGMA ADE/POD'] +banner = ['CtxTools', 'version 1.3.1', '2004/2006', 'PRAGMA ADE/POD'] unless defined? ownpath ownpath = $0.sub(/[\\\/][a-z0-9\-]*?\.rb/i,'') @@ -1493,6 +1493,41 @@ class Commands end +class Commands + + include CommandBase + + def platformize + + pattern = if @commandline.arguments.empty? then "*.{rb,pl,py}" else @commandline.arguments end + recurse = @commandline.option("recurse") + force = @commandline.option("force") + pattern = "#{if recurse then '**/' else '' end}#{pattern}" + Dir.glob(pattern).each do |file| + if File.file?(file) then + size = File.size(file) + data = IO.readlines(file) + if force then + if f = File.open(file,'w') + data.each do |line| + f.puts(line.chomp) + end + f.close + end + if File.size(file) == size then # not robust + report("file '#{file}' is unchanged") + else + report("file '#{file}' is platformized") + end + else + report("file '#{file}' is a candidate") + end + end + end + end + +end + logger = Logger.new(banner.shift) commandline = CommandLine.new @@ -1519,6 +1554,8 @@ commandline.registeraction('listentities', 'create doctype entity definition fro commandline.registeraction('brandfiles', 'add context copyright notice [--force]') +commandline.registeraction('platformize', 'replace line-endings [--recurse --force] [pattern]') + commandline.registervalue('type','') commandline.registerflag('recurse') diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index adc65c97b..e482b7b85 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -24,7 +24,7 @@ \normalend}} \fi -\newcontextversion{2006.02.01 22:22} +\newcontextversion{2006.02.03 21:03} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index ac9a86d68..12c6815be 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -31,7 +31,7 @@ %D 2004.8.30 the low level interface is english. Watch out and adapt %D your styles an modules. -\def\contextversion{2006.02.01 22:22} +\def\contextversion{2006.02.03 21:03} %D For those who want to use this: diff --git a/tex/context/base/core-mis.tex b/tex/context/base/core-mis.tex index cf32e7c5f..92723bb34 100644 --- a/tex/context/base/core-mis.tex +++ b/tex/context/base/core-mis.tex @@ -564,27 +564,42 @@ \unexpanded\def\ongeveer {\mathematics\pm} +\chardef\boundarycharactermode\plusone + \def\midboundarycharacter#1#2% - {%\nobreak - \hskip\hspaceamount\currentlanguage{#2}% - \languageparameter#1% - %\nobreak - \hskip\hspaceamount\currentlanguage{#2}} + {\ifcase\boundarycharactermode + \or + %\nobreak + \hskip\hspaceamount\currentlanguage{#2}% + \languageparameter#1% + %\nobreak + \hskip\hspaceamount\currentlanguage{#2}% + \or + \languageparameter#1% + \fi + \chardef\boundarycharactermode\plusone} \def\leftboundarycharacter#1#2% - {\languageparameter#1% - \nobreak - \hskip\hspaceamount\currentlanguage{#2}} - -% \def\rightboundarycharacter#1#2% -% {\nobreak -% \hskip\hspaceamount\currentlanguage{#2}% -% \languageparameter#1} + {\ifcase\boundarycharactermode + \or + \languageparameter#1% + \nobreak + \hskip\hspaceamount\currentlanguage{#2}% + \or + \languageparameter#1% + \fi + \chardef\boundarycharactermode\plusone} \def\rightboundarycharacter#1#2% - {\prewordbreak %\nobreak - \hskip\hspaceamount\currentlanguage{#2}% - \languageparameter#1} + {\ifcase\boundarycharactermode + \or + \prewordbreak %\nobreak + \hskip\hspaceamount\currentlanguage{#2}% + \languageparameter#1 + \or + \languageparameter#1% + \fi + \chardef\boundarycharactermode\plusone} % actually this is pretty old, but temporary moved here % @@ -1046,10 +1061,16 @@ {\dostopattributes \popmacro\currentdelimitedtext}} +% \def\dofontdrivendelimited#1% thanks to Taco for sorting out the kerning interference +% {\languageparameter{\c!left\currentdelimitedtext}% +% #1% sorry, no verbatim support +% \languageparameter{\c!right\currentdelimitedtext}% +% \popmacro\currentdelimitedtext} + \def\dofontdrivendelimited - {\groupedcommand - {\dohandledelimitedtext\c!left\relax} - {\dohandledelimitedtext\c!right\relax + {\simplegroupedcommand + {\languageparameter{\c!left\currentdelimitedtext}} + {\languageparameter{\c!right\currentdelimitedtext}% \popmacro\currentdelimitedtext}} \definedelimitedtext diff --git a/tex/context/base/enco-fde.tex b/tex/context/base/enco-fde.tex index cc69f3b44..bbefb51bf 100644 --- a/tex/context/base/enco-fde.tex +++ b/tex/context/base/enco-fde.tex @@ -59,10 +59,13 @@ \startlanguagespecifics[\s!de] - \installcompoundcharacter "` {\delimitedtext[\v!quotation]} - \installcompoundcharacter "' {} + \installcompoundcharacter "` {\startdelimitedtext[\v!quotation]} + \installcompoundcharacter "' {\stopdelimitedtext} \installcompoundcharacter ". {\kern.1em\ignorespaces} + %installcompoundcharacter "` {\languageparameter\c!leftquotation } + %installcompoundcharacter "' {\languageparameter\c!rightquotation} + \def\setupDElanguage {\setuplanguage [\s!de] diff --git a/tex/context/base/page-set.tex b/tex/context/base/page-set.tex index 67a56bf47..3aa1b0dc5 100644 --- a/tex/context/base/page-set.tex +++ b/tex/context/base/page-set.tex @@ -2016,12 +2016,26 @@ \donothing{\OTRSETsetgridcell\mofcolumns\recurselevel\copy\placeholderboxe}}% \egroup}} +% \OTRSEToutput +% {\dontcomplain % new, get rid of overfull message (to be sorted out) +% \OTRSETnaturalflush +% %\OTRSETstartnextpage +% \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong) +% \OTRSETcheckfreelines +% \OTRSETchecksidefloat} + \OTRSEToutput {\dontcomplain % new, get rid of overfull message (to be sorted out) - \OTRSETnaturalflush - %\OTRSETstartnextpage - \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong) - \OTRSETcheckfreelines + \doloop + {\OTRSETnaturalflush + %\OTRSETstartnextpage % no + \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong) + \OTRSETcheckfreelines + \ifsomefreecolumncells + \exitloop + \else + % flush page and get rid of more floats if present + \fi}% \OTRSETchecksidefloat} \def\OTRSETinitializefeatures diff --git a/tex/context/base/spec-fdf.tex b/tex/context/base/spec-fdf.tex index 0f26e7893..7343b30aa 100644 --- a/tex/context/base/spec-fdf.tex +++ b/tex/context/base/spec-fdf.tex @@ -59,7 +59,14 @@ \newif\ifovercomePDFbugs \overcomePDFbugsfalse % dest sort problem / 3- \newif\ifovercomePDFspace \overcomePDFspacetrue % dest sort problem / 3- -\newif\ifovercomePDFpage \overcomePDFpagetrue % pdf spec change / 5+ + +% the pdf spec changed cq. viewers started behaving differently / 5+ + +\chardef\overcomePDFpage\plusone % page numbers/ beware: optimizers remove this one +\chardef\overcomePDFpage\plustwo % page:number +%chardef\overcomePDFpage\plusthree % pdftex page ref feature + +\ifx\pdfpageref\undefined \else \chardef\overcomePDFpage\plusthree \fi \chardef\safePDFcode=`- @@ -657,7 +664,6 @@ \doifelsenothing{#3}% #1 = url {\scratchcounter0#5\relax \ifnum\scratchcounter>0 - \advance\scratchcounter \minusone % pdf starts numbering at zero \doifelsenothing{#4} {\let\PDFfile\empty} {\expanded{\beforesplitstring#4}\at.\to\PDFfile @@ -667,12 +673,18 @@ {\@EA\setreferencefilename\PDFfile.\locationfilesuffix\to\PDFfile \edef\PDFfile{R /F (\PDFfile)\PDFgotonewwindow}}}% \ifx\PDFfile\empty - \ifovercomePDFpage % a named page ref - \edef\PDFdestination{(page:\the\scratchcounter)}% - \else % beware: optimizers remove this one + \ifcase\overcomePDFpage + \or % pdf starts numbering at zero + \advance\scratchcounter \minusone \edef\PDFdestination{[\the\scratchcounter\space\PDFpageviewwrd]}% + \or % pdf starts numbering at zero + \advance\scratchcounter \minusone + \edef\PDFdestination{(page:\the\scratchcounter)}% + \or % pdftex starts numbering at one + \edef\PDFdestination{[\pdfpageref\scratchcounter\space0 R \PDFpageviewwrd]}% \fi - \else % across files it's a page number + \else % across files it's a page number / pdf starts numbering at zero + \advance\scratchcounter \minusone \edef\PDFdestination{[\the\scratchcounter\space\PDFpageviewwrd]}% \fi \edef\action{/S /GoTo\PDFfile\space /D \PDFdestination}% @@ -698,7 +710,7 @@ \let\lastfakedPDFpage\!!zerocount \def\fakePDFpagedestination % as in pdf, we start numbering at zero - {\iflocation \ifovercomePDFpage \ifarrangingpages \else + {\iflocation \ifarrangingpages \ifnum\overcomePDFpage=\plustwo \else \ifnum\lastfakedPDFpage<\realpageno \bgroup \xdef\lastfakedPDFpage{\realfolio}% diff --git a/tex/context/base/syst-ext.tex b/tex/context/base/syst-ext.tex index 16f55bca4..903460abf 100644 --- a/tex/context/base/syst-ext.tex +++ b/tex/context/base/syst-ext.tex @@ -1633,6 +1633,14 @@ \afterassignment\BeforeGroup \let\next=} +\long\def\HandleSimpleGroup#1#2% no inner group (so no kerning interference) + {\bgroup + \long\def\BeforeGroup{\bgroup#1\aftergroup\AfterGroup}% interferes + \long\def\BeforeGroup{\bgroup\aftergroup\AfterGroup#1}% + \long\def\AfterGroup {#2\egroup}% + \afterassignment\BeforeGroup + \let\next=} + \long\def\HandleNoGroup#1#2% {\long\def\AfterGroup{#2\egroup}% \bgroup\aftergroup\AfterGroup#1} @@ -1684,6 +1692,10 @@ {\doifnextcharelse\bgroup {\HandleGroup{#1}{#2}}{\HandleNoGroup{#1}{#2}}} +\long\unexpanded\def\simplegroupedcommand#1#2% + {\doifnextcharelse\bgroup + {\HandleSimpleGroup{#1}{#2}}{\HandleNoGroup{#1}{#2}}} + %D Users should be aware of the fact that grouping can %D interfere with ones paragraph settings that are executed %D after the paragraph is closed. One should therefore diff --git a/tex/context/interface/keys-cz.xml b/tex/context/interface/keys-cz.xml index c72b3faca..bf799ff95 100644 --- a/tex/context/interface/keys-cz.xml +++ b/tex/context/interface/keys-cz.xml @@ -1,6 +1,6 @@ - + diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml index 485194f3a..68f17ba84 100644 --- a/tex/context/interface/keys-de.xml +++ b/tex/context/interface/keys-de.xml @@ -1,6 +1,6 @@ - + diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml index 1b6d9c1ac..bb4f774ef 100644 --- a/tex/context/interface/keys-en.xml +++ b/tex/context/interface/keys-en.xml @@ -1,6 +1,6 @@ - + diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml index 06b81c2b9..252c2dcfb 100644 --- a/tex/context/interface/keys-fr.xml +++ b/tex/context/interface/keys-fr.xml @@ -1,6 +1,6 @@ - + diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml index ab808cc11..7ad542f75 100644 --- a/tex/context/interface/keys-it.xml +++ b/tex/context/interface/keys-it.xml @@ -1,6 +1,6 @@ - + diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml index d37d22e34..a7ce91052 100644 --- a/tex/context/interface/keys-nl.xml +++ b/tex/context/interface/keys-nl.xml @@ -1,6 +1,6 @@ - + diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml index 07323a485..ee57d0d47 100644 --- a/tex/context/interface/keys-ro.xml +++ b/tex/context/interface/keys-ro.xml @@ -1,6 +1,6 @@ - + -- cgit v1.2.3