summaryrefslogtreecommitdiffstats
path: root/glob.txi
diff options
context:
space:
mode:
authorSteve Langasek <vorlon@debian.org>2005-01-10 08:53:33 +0000
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:30 -0800
commite33f9eb9cf5cc29c36ce2aa7e10cd0f37ae0cc8e (patch)
treeabbf06041619e445f9d0b772b0d58132009d8234 /glob.txi
parentf559c149c83da84d0b1c285f0298c84aec564af9 (diff)
parent8466d8cfa486fb30d1755c4261b781135083787b (diff)
downloadslib-e33f9eb9cf5cc29c36ce2aa7e10cd0f37ae0cc8e.tar.gz
slib-e33f9eb9cf5cc29c36ce2aa7e10cd0f37ae0cc8e.zip
Import Debian changes 3a1-4.2debian/3a1-4.2
slib (3a1-4.2) unstable; urgency=low * Non-maintainer upload. * Add guile.init.local for use within the build dir, since otherwise we have an (earlier unnoticed) circular build-dep due to a difference between scm and guile. slib (3a1-4.1) unstable; urgency=low * Non-maintainer upload. * Build-depend on guile-1.6 instead of scm, since the new version of scm is wedged in unstable (closes: #281809). slib (3a1-4) unstable; urgency=low * Also check for expected creation on slibcat. (Closes: #240096) slib (3a1-3) unstable; urgency=low * Also check for /usr/share/guile/1.6/slib before installing for guile 1.6. (Closes: #239267) slib (3a1-2) unstable; urgency=low * Add format.scm back into slib until gnucash stops using it. * Call guile-1.6 new-catalog (Closes: #238231) slib (3a1-1) unstable; urgency=low * New upstream release * Remove Info section from doc-base file (Closes: #186950) * Remove period from end of description (linda, lintian) * html gen fixed upstream (Closes: #111778) slib (2d4-2) unstable; urgency=low * Fix url for upstream source (Closes: #144981) * Fix typo in slib.texi (enquque->enqueue) (Closes: #147475) * Add build depends. slib (2d4-1) unstable; urgency=low * New upstream. slib (2d3-1) unstable; urgency=low * New upstream. * Remove texi2html call in debian/rules. Now done upstream. Add make html instead. * Changes to rules and doc-base to conform to upstream html gen * Clean up upstream makefile to make sure it cleans up after itself.
Diffstat (limited to 'glob.txi')
-rw-r--r--glob.txi100
1 files changed, 100 insertions, 0 deletions
diff --git a/glob.txi b/glob.txi
new file mode 100644
index 0000000..d83b66b
--- /dev/null
+++ b/glob.txi
@@ -0,0 +1,100 @@
+@code{(require 'filename)} or @code{(require 'glob)}
+@ftindex filename
+@ftindex glob
+
+
+@defun filename:match?? pattern
+@defunx filename:match-ci?? pattern
+
+Returns a predicate which returns a non-false value if its string argument
+matches (the string) @var{pattern}, false otherwise. Filename matching
+is like
+@cindex glob
+@dfn{glob} expansion described the bash manpage, except that names
+@cindex glob
+beginning with @samp{.} are matched and @samp{/} characters are not
+treated specially.
+
+These functions interpret the following characters specially in
+@var{pattern} strings:
+@table @samp
+@item *
+Matches any string, including the null string.
+@item ?
+Matches any single character.
+@item [@dots{}]
+Matches any one of the enclosed characters. A pair of characters
+separated by a minus sign (-) denotes a range; any character lexically
+between those two characters, inclusive, is matched. If the first
+character following the @samp{[} is a @samp{!} or a @samp{^} then any
+character not enclosed is matched. A @samp{-} or @samp{]} may be
+matched by including it as the first or last character in the set.
+@end table
+@end defun
+
+@defun filename:substitute?? pattern template
+@defunx filename:substitute-ci?? pattern template
+
+Returns a function transforming a single string argument according to
+glob patterns @var{pattern} and @var{template}. @var{pattern} and
+@var{template} must have the same number of wildcard specifications,
+which need not be identical. @var{pattern} and @var{template} may have
+a different number of literal sections. If an argument to the function
+matches @var{pattern} in the sense of @code{filename:match??} then it
+returns a copy of @var{template} in which each wildcard specification is
+replaced by the part of the argument matched by the corresponding
+wildcard specification in @var{pattern}. A @code{*} wildcard matches
+the longest leftmost string possible. If the argument does not match
+@var{pattern} then false is returned.
+
+@var{template} may be a function accepting the same number of string
+arguments as there are wildcard specifications in @var{pattern}. In
+the case of a match the result of applying @var{template} to a list
+of the substrings matched by wildcard specifications will be returned,
+otherwise @var{template} will not be called and @code{#f} will be returned.
+@end defun
+@example
+((filename:substitute?? "scm_[0-9]*.html" "scm5c4_??.htm")
+ "scm_10.html")
+@result{} "scm5c4_10.htm"
+((filename:substitute?? "??" "beg?mid?end") "AZ")
+@result{} "begAmidZend"
+((filename:substitute?? "*na*" "?NA?") "banana")
+@result{} "banaNA"
+((filename:substitute?? "?*?" (lambda (s1 s2 s3) (string-append s3 s1)))
+ "ABZ")
+@result{} "ZA"
+@end example
+
+
+@defun replace-suffix str old new
+
+@var{str} can be a string or a list of strings. Returns a new string
+(or strings) similar to @code{str} but with the suffix string @var{old}
+removed and the suffix string @var{new} appended. If the end of
+@var{str} does not match @var{old}, an error is signaled.
+@end defun
+@example
+(replace-suffix "/usr/local/lib/slib/batch.scm" ".scm" ".c")
+@result{} "/usr/local/lib/slib/batch.c"
+@end example
+
+
+@defun call-with-tmpnam proc k
+
+
+@defunx call-with-tmpnam proc
+Calls @var{proc} with @var{k} arguments, strings returned by successive calls to
+@code{tmpnam}.
+If @var{proc} returns, then any files named by the arguments to @var{proc} are
+deleted automatically and the value(s) yielded by the @var{proc} is(are)
+returned. @var{k} may be ommited, in which case it defaults to @code{1}.
+
+
+@defunx call-with-tmpnam proc suffix1 @dots{}
+Calls @var{proc} with strings returned by successive calls to @code{tmpnam},
+each with the corresponding @var{suffix} string appended.
+If @var{proc} returns, then any files named by the arguments to @var{proc} are
+deleted automatically and the value(s) yielded by the @var{proc} is(are)
+returned.
+@end defun