summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2005-11-09 00:00:00 +0100
committerHans Hagen <pragma@wxs.nl>2005-11-09 00:00:00 +0100
commit0746528ff3a98ee6e70c2121526c07507f614df9 (patch)
treeddbf33ef5d5d3b6c7cc55670b60a1d6d942c2777 /metapost
parent28ba5960fc4486f4e667ee0cbd802335483e1c99 (diff)
downloadcontext-0746528ff3a98ee6e70c2121526c07507f614df9.tar.gz
stable 2005.11.09
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mp-spec.mp21
1 files changed, 20 insertions, 1 deletions
diff --git a/metapost/context/base/mp-spec.mp b/metapost/context/base/mp-spec.mp
index 9fe3c724f..9965199f2 100644
--- a/metapost/context/base/mp-spec.mp
+++ b/metapost/context/base/mp-spec.mp
@@ -48,12 +48,31 @@ boolean _inline_specials_ ; _inline_specials_ := false ;
string _global_specials_ ; _global_specials_ := "" ;
string _local_specials_ ; _local_specials_ := "" ;
+% vardef add_special_signal = % write the version number
+% if (length _global_specials_>0) or (length _local_specials_ >0) :
+% special ("%%MetaPostSpecials: 1.0 " & decimal _special_signal_ ) ;
+% fi ;
+% enddef ;
+%
+% After some reported problems at the \CONTEXT\ mailing list,
+% Taco's came up with:
+
+% TH: \quotation {Ok, got it. There is a bug in mp-spec.mp (inside metafun).
+% Because of a wrapping number, it fails to recognize the fact that there
+% are embedded specials at all.} The corrected definition is:
+
vardef add_special_signal = % write the version number
- if (length _global_specials_>0) or (length _local_specials_ >0) :
+ if (length _global_specials_ <> 0) or (length _local_specials_ <> 0) :
special ("%%MetaPostSpecials: 1.0 " & decimal _special_signal_ ) ;
fi ;
enddef ;
+% \quotation {It now tests for \quote {not equal to zero} instead of
+% \quote {larger than zero}: because of all the included files, the
+% string \type {_local_specials_} becomes longer than the maximum number
+% \quote {length} can return, so it returns -32768 instead, and that is
+% of course less than zero.}
+
vardef add_extra_specials =
scantokens _global_specials_ ;
scantokens _local_specials_ ;