GOOF----LE-8-2.0wA]S4hÃ] gguile¤ ¤ gdefine-module*¤ ¤ ¤ gtexinfo¤ g string-utils¤ ¤ gfilenameS¤ ftexinfo/string-utils.scm¤ gimportsS¤ gsrfi¤ gsrfi-13¤   ¤ ¤ gsrfi-14¤  ¤ ¤ ¤ gexportsS¤ gescape-special-chars¤ gtransform-string¤ g expand-tabs¤ g center-string¤ gleft-justify-string¤ gright-justify-string¤ gcollapse-repeated-chars¤ gmake-text-wrapper¤ g fill-string¤ gstring->wrapped-lines¤  ¤ gset-current-module¤ ! ¤ " ¤ #gopen-output-string¤ $gchar?¤ %gchar=?¤ &g procedure?¤ 'gstring?¤ (g string-index¤ )gboolean?¤ *gthrow¤ +gbad-type¤ ,f'expected #t, char, string, or procedure¤ -gdisplay¤ .g string-length¤ /g substring¤ 0gstring-for-each¤ 1g write-char¤ 2gget-output-string¤ 3g make-string¤ 4gstring¤ 5gmax¤ 6g string-append¤ 7godd?¤ 8f¤ 9gchar-set-complement¤ :gchar-set:whitespace¤ ;greverse¤ gend-of-sentence?¤ ?g line-widthS¤ @? Œ¤ Ag expand-tabs?S¤ BA Œ¤ Cg tab-widthS¤ DC Œ¤ Egcollapse-whitespace?S¤ FE Œ¤ Ggsubsequent-indentS¤ HG Œ¤ Iginitial-indentS¤ JI Œ¤ Kgbreak-long-words?S¤ LK Œ¤ M@BDFHJL¤ Ng string-trim¤ Of ¤ Pg string-join¤ Qf ¤ Rginfix¤C5hx:Å]4   54">"G#$%hc]L6[gc  gfilenameftexinfo/string-utils.scmŒ O ŒŒ O %ŒŒ  C&'(hc]L6[gc  gfilenameftexinfo/string-utils.scmŒ S ŒŒ S %ŒŒ  C)h[]LCSgc  gfilenameftexinfo/string-utils.scmŒ U ŒŒ   C*+,-hk]4L5L6cgc  gfilenameftexinfo/string-utils.scmŒ X ŒŒ  X ,ŒŒ  X #ŒŒ   C-hc]LL6[gc  gfilenameftexinfo/string-utils.scmŒ Y ŒŒ Y #ŒŒ  C.-/01h {]4L5$L6L6sgc  gfilenameftexinfo/string-utils.scmŒ a ŒŒ  b ŒŒ b ŒŒ  d ŒŒ  g ŒŒ   C2hX- -.,3##4545$ O"F45$"545$ O"45$ O" 4   545$  O"  O$245“$ 44 5>"G""4O$" $"45>"G$145’$445>"G""6% gstr Xgmatch? Xgreplace  Xgstart  Xgend  Xgos  # Xgmatcher  Xgreplacer  ¤ Xgfilenameftexinfo/string-utils.scmŒ ' ŒŒ  M ŒŒ # M ŒŒ & N ŒŒ 0 N ŒŒ < P ŒŒ F N ŒŒ M R ŒŒ W N ŒŒ c T ŒŒ m N ŒŒ y V ŒŒ } V %ŒŒ  V /ŒŒ V ŒŒ M ŒŒ „ W ŒŒ Ž W ŒŒ ¤ M ŒŒ ¬ \ ŒŒ ¯ \ ŒŒ ¶ \ ŒŒ º \ ŒŒ » ] ŒŒ ¾ ] ŒŒ Î ] ŒŒ ß ` ŒŒ ô i ŒŒ  j ŒŒ  j ŒŒ  ` ŒŒ ! m ŒŒ $ m ŒŒ + m ŒŒ / m ŒŒ 0 n ŒŒ 3 n ŒŒ B n ŒŒ X p ŒŒ( X  gnamegtransform-stringŒg documentationfÀUses @var{match?} against each character in @var{str}, and performs a replacement on each character for which matches are found. @var{match?} may either be a function, a character, a string, or @code{#t}. If @var{match?} is a function, then it takes a single character as input, and should return @samp{#t} for matches. @var{match?} is a character, it is compared to each string character using @code{char=?}. If @var{match?} is a string, then any character in that string will be considered a match. @code{#t} will cause every character to be a match. If @var{replace} is a function, it is called with the matched character as an argument, and the returned value is sent to the output string via @samp{display}. If @var{replace} is anything else, it is sent through the output string via @samp{display}. Note that te replacement for the matched characters does not need to be a single character. That is what differentiates this function from @samp{string-map}, and what makes it useful for applications such as converting @samp{#\&} to @samp{"&"} in web page text. Some other functions in this module are just wrappers around common uses of @samp{transform-string}. Transformations not possible with this function should probably be done with regular expressions. If @var{start} and @var{end} are given, they control which portion of the string undergoes transformation. The entire input string is still output, though. So, if @var{start} is @samp{5}, then the first five characters of @var{str} will still appear in the returned string. @lisp ; these two are equivalent... (transform-string str #\space #\-) ; change all spaces to -'s (transform-string str (lambda (c) (char=? #\space c)) #\-) @end lispŒCR3h(u-.,3#  4 56mgstr 'gtab-size 'gfilenameftexinfo/string-utils.scmŒ r ŒŒ  z ŒŒ ' x ŒŒ ' gnameg expand-tabsŒg documentationfÅReturns a copy of @var{str} with all tabs expanded to spaces. @var{tab-size} defaults to 8. Assuming tab size of 8, this is equivalent to: @lisp (transform-string str #\tab " ") @end lispŒCR$%he]L6]gc  gfilenameftexinfo/string-utils.scmŒ “ ŒŒ “ $ŒŒ  C(he]L6]gc  gfilenameftexinfo/string-utils.scmŒ – ŒŒ – $ŒŒ  C4he]L6]gc  gfilenameftexinfo/string-utils.scmŒ ™ ŒŒ ™ ŒŒ  Ch0)]45$ O"OO6!gstr  ,g special-chars  ,g escape-char   ,gfilenameftexinfo/string-utils.scmŒ | ŒŒ  ‘ ŒŒ  ‘ ŒŒ , ŒŒ  , gnamegescape-special-charsŒg documentationfGReturns a copy of @var{str} with all given special characters preceded by the given @var{escape-char}. @var{special-chars} can either be a single character, or a string consisting of all the special characters. @lisp ;; make a string regexp-safe... (escape-special-chars "***(Example String)***" "[]()/*." #\\) => "\\*\\*\\*\\(Example String\\)\\*\\*\\*" ;; also can escape a singe char... (escape-special-chars "richardt@@vzavenue.net" #\@@ #\@@) => "richardt@@@@vzavenue.net" @end lispŒCR.35%6748 hÈ·-.,3# P# #4544˜ œ 554$"5$"!44˜ œ 5$"5•$C4˜5$4$"5"6¯gstr Ègwidth Ègchr  Ègrchr  Èglen  0 Èglpad  G Ègrpad  ‰ Ègfilenameftexinfo/string-utils.scmŒ › ŒŒ * ­ ŒŒ 0 ­ ŒŒ 3 ® ŒŒ 6 ® ŒŒ = ® +ŒŒ @ ® !ŒŒ C ® ŒŒ G ® ŒŒ G ­ ŒŒ J ± ŒŒ R ° ŒŒ ^ ± ŒŒ b ± ŒŒ i ³ ŒŒ l ³ ŒŒ s ³ /ŒŒ v ³ %ŒŒ y ³ ŒŒ  ° ŒŒ ‰ ³ ŒŒ ‰ ­ ŒŒ ´ ŒŒ ” ´ ŒŒ   ¶ )ŒŒ § ¶ /ŒŒ © ¶ )ŒŒ ­ ¶ %ŒŒ ® ¶ >ŒŒ ¶ ° ŒŒ À ¶ >ŒŒ Æ ¶ QŒŒ È ¶ ŒŒ" È gnameg center-stringŒg documentationfˆReturns a copy of @var{str} centered in a field of @var{width} characters. Any needed padding is done by character @var{chr}, which defaults to @samp{#\space}. If @var{rchr} is provided, then the padding to the right will use it instead. See the examples below. left and @var{rchr} on the right. The default @var{width} is 80. The default @var{chr} and @var{rchr} is @samp{#\space}. The string is never truncated. @lisp (center-string "Richard Todd" 24) => " Richard Todd " (center-string " Richard Todd " 24 #\=) => "===== Richard Todd =====" (center-string " Richard Todd " 24 #\< #\>) => "<<<<< Richard Todd >>>>>" @end lispŒCR.356hXH-.,3# P# 4544˜ 55•$C6@gstr Qgwidth Qgchr  Qglen  ' Qgpad  ; Qgfilenameftexinfo/string-utils.scmŒ ¸ ŒŒ ! ¾ ŒŒ ' ¾ ŒŒ * ¿ ŒŒ - ¿ ŒŒ 4 ¿ ŒŒ 7 ¿ ŒŒ ; ¿ ŒŒ ; ¾ ŒŒ B À ŒŒ F À ŒŒ Q  ŒŒ Q gnamegleft-justify-stringŒg documentationf @code{left-justify-string str [width chr]}. Returns a copy of @var{str} padded with @var{chr} such that it is left justified in a field of @var{width} characters. The default @var{width} is 80. Unlike @samp{string-pad} from srfi-13, the string is never truncated.ŒCR.356hXF-.,3# P# 4544˜ 55•$C6>gstr Qgwidth Qgchr  Qglen  ' Qgpad  ; Qgfilenameftexinfo/string-utils.scmŒ Ä ŒŒ ! É ŒŒ ' É ŒŒ * Ê ŒŒ - Ê ŒŒ 4 Ê ŒŒ 7 Ê ŒŒ ; Ê ŒŒ ; É ŒŒ B Ë ŒŒ F Ë ŒŒ Q Í ŒŒ Q gnamegright-justify-stringŒg documentationfReturns a copy of @var{str} padded with @var{chr} such that it is right justified in a field of @var{width} characters. The default @var{width} is 80. The default @var{chr} is @samp{#\space}. Unlike @samp{string-pad} from srfi-13, the string is never truncated.ŒCR%%h@¶]" NNC4M5$4ML5$ M—NML•C"ÿÿÎ"ÿÿÊ®gc  <gfilenameftexinfo/string-utils.scmŒ ã ŒŒ ì ŒŒ í ŒŒ  ä ŒŒ  ä ŒŒ  ä ŒŒ  å ŒŒ ) ä ŒŒ , è &ŒŒ . è ŒŒ 3 é ŒŒ  < C8hXÛ-.,3# # 4 5$A" HHO6Ógstr Xgchr Xgnum  Xgprev-chr  5 Lg match-count  5 Lgrepeat-locator  L Xgfilenameftexinfo/string-utils.scmŒ Ï ŒŒ á ŒŒ , á ŒŒ 5 á ŒŒ L ß ŒŒ V ò *ŒŒ X ò ŒŒ X gnamegcollapse-repeated-charsŒg documentationf Returns a copy of @var{str} with all repeated instances of @var{chr} collapsed down to at most @var{num} instances. The default value for @var{chr} is @samp{#\space}, and the default value for @var{num} is 1. @lisp (collapse-repeated-chars "H e l l o") => "H e l l o" (collapse-repeated-chars "H--e--l--l--o" #\-) => "H-e-l-l-o" (collapse-repeated-chars "H-e--l---l----o" #\- 2) => "H-e--l--l--o" @end lispŒCR9:(/;hp”])45"T45$;45$45Œ"ÿÿÂ45Œ66 "ÿÿ¢Œgstr  mg non-wschars mgans   cgindex   cg next-non-ws   cgnext-ws  - ]gfilenameftexinfo/string-utils.scmŒ ö ŒŒ  ÷ ŒŒ ÷ ŒŒ  ø ŒŒ  ú ŒŒ  ú ŒŒ " û ŒŒ # ý ŒŒ - ý ŒŒ 5 þ ŒŒ 6  ŒŒ C  ŒŒ M  ŒŒ P  ŒŒ [  ŒŒ ]  ŒŒ c  ŒŒ c ø ŒŒ d ø ŒŒ m ø ŒŒ  m gnamegsplit-by-single-wordsŒCRM8%he] 6]gc  gfilenameftexinfo/string-utils.scmŒ D $ŒŒ D 0ŒŒ  CN;.6>O/< hx]1H4J 5KL$4JL5K"L$ 4J5K"4J5K"( ”$ Œ"6L45˜ ‘$ 45"45“$QŽ" 45",L$"4 5$4 5""ÿÿÏ""ÿÿÇ—"ÿÿ_ ”$ŒL "ÿÿAL$044  55Œ4 5ŽŒL "ÿÿ 45ŒŽL "ÿþí4 J5L "ÿþÖgstr  rgans H [gwords  H [gline  H [gcount  H [g length-left  † [g next-word  † [gfilenameftexinfo/string-utils.scmŒ B ŒŒ  D ŒŒ  D ŒŒ  G ŒŒ  H ŒŒ $ H ŒŒ . K ŒŒ / L ŒŒ 7 L ŒŒ < O ŒŒ D O ŒŒ H R ŒŒ N V ŒŒ T X ŒŒ X X ŒŒ ] Y ŒŒ e X ŒŒ h ^ ŒŒ o ] ŒŒ s _ ŒŒ w _ ŒŒ x ` ŒŒ } ` ,ŒŒ  ` ŒŒ † a ŒŒ † ] ŒŒ ‹ d ŒŒ ” d ŒŒ ˜ b ŒŒ g ŒŒ ¢ l ŒŒ ® h ŒŒ µ i ŒŒ ¿ h ŒŒ À k ŒŒ Æ k ,ŒŒ Ê k ŒŒ Ý m ŒŒ é f ŒŒ í p ŒŒ ñ b ŒŒ ö r ŒŒ  r ŒŒ  b ŒŒ  { ŒŒ  { .ŒŒ  { ŒŒ ! { ŒŒ " } ŒŒ - ~ ŒŒ . } ŒŒ = { ŒŒ > „ ŒŒ I „ ŒŒ L † ŒŒ [ „ ŒŒ [ R ŒŒ \ R ŒŒ ] S ŒŒ r R ŒŒ=  r Chp|-/03# P## ####OCtg line-width  jg expand-tabs?  jg tab-width   jgcollapse-whitespace?   jgsubsequent-indent   jginitial-indent   jgbreak-long-words?   jgfilenameftexinfo/string-utils.scmŒ  ŒŒ A  /ŒŒ K  ,ŒŒ  j g line-widthS Œg expand-tabs?S Œg tab-widthS Œgcollapse-whitespace?S Œgsubsequent-indentS Œginitial-indentS Œgbreak-long-words?S Œgnamegmake-text-wrapperŒg documentationf‡Returns a procedure that will split a string into lines according to the given parameters. @table @code @item #:line-width This is the target length used when deciding where to wrap lines. Default is 80. @item #:expand-tabs? Boolean describing whether tabs in the input should be expanded. Default is #t. @item #:tab-width If tabs are expanded, this will be the number of spaces to which they expand. Default is 8. @item #:collapse-whitespace? Boolean describing whether the whitespace inside the existing text should be removed or not. Default is #t. If text is already well-formatted, and is just being wrapped to fit in a different width, then set this to @samp{#f}. This way, many common text conventions (such as two spaces between sentences) can be preserved if in the original text. If the input text spacing cannot be trusted, then leave this setting at the default, and all repeated whitespace will be collapsed down to a single space. @item #:initial-indent Defines a string that will be put in front of the first line of wrapped text. Default is the empty string, ``''. @item #:subsequent-indent Defines a string that will be put in front of all lines of wrapped text, except the first one. Default is the empty string, ``''. @item #:break-long-words? If a single word is too big to fit on a line, this setting tells the wrapper what to do. Defaults to #t, which will break up long words. When set to #f, the line will be allowed, even though it is longer than the defined @code{#:line-width}. @end table The return value is a procedure of one argument, the input string, which returns a list of strings, where each element of the list is one line.ŒCRhô-134?6ìgstr gkwargs gfilenameftexinfo/string-utils.scmŒ Š ŒŒ  ŒŒ   ŒŒ  gnamegstring->wrapped-linesŒg documentationf8@code{string->wrapped-lines str keywds ...}. Wraps the text given in string @var{str} according to the parameters provided in @var{keywds}, or the default setting if they are not given. Returns a list of strings representing the formatted lines. Valid keyword arguments are discussed in @code{make-text-wrapper}.ŒCRPQRh Ä-134?6¼gstr gkwargs gfilenameftexinfo/string-utils.scmŒ ’ ŒŒ — ŒŒ  ˜ ŒŒ  ™ ŒŒ  — ŒŒ  gnameg fill-stringŒg documentationfWraps the text given in string @var{str} according to the parameters provided in @var{kwargs}, or the default setting if they are not given. Returns a single string with the wrapped text. Valid keyword arguments are discussed in @code{make-text-wrapper}.ŒCRC½gm  ,gfilenameftexinfo/string-utils.scmŒ   ŒŒ  ' ŒŒ Ð r ŒŒ Ü | ŒŒ ‚ › ŒŒ ; ¸ ŒŒ ñ Ä ŒŒ $F Ï ŒŒ &g ö ŒŒ (  ŒŒ 6O  ŒŒ 8o Š ŒŒ :o ’ ŒŒ  :q C6