From 1b09b607dd1096ab572afe0667e8602560622624 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Sun, 16 Apr 2006 23:18:55 +0000 Subject: [PATCH] merge from 1.8 branch --- doc/Makefile.am | 2 +- doc/NEWS | 4 +-- doc/groupings.alist | 2 +- doc/oldfmt.c | 2 +- doc/ref/ChangeLog | 33 +++++++++++++++++ doc/ref/Makefile.am | 2 +- doc/ref/api-compound.texi | 11 +++--- doc/ref/api-data.texi | 7 ++++ doc/ref/api-modules.texi | 59 ++++++++++++++++--------------- doc/ref/api-scheduling.texi | 4 +-- doc/ref/data-rep.texi | 6 ++-- doc/ref/fdl.texi | 2 +- doc/ref/intro.texi | 2 +- doc/ref/posix.texi | 58 ++++++++++++++++++------------ doc/tutorial/Makefile.am | 2 +- doc/tutorial/guile-tut.texi | 4 +-- guile-readline/ChangeLog | 8 +++++ guile-readline/Makefile.am | 2 +- guile-readline/ice-9/Makefile.am | 4 +-- guile-readline/ice-9/readline.scm | 28 +++++++++++++-- guile-readline/readline.c | 2 +- guile-readline/readline.h | 2 +- srfi/Makefile.am | 2 +- srfi/srfi-1.h | 2 +- srfi/srfi-1.scm | 2 +- srfi/srfi-10.scm | 2 +- srfi/srfi-11.scm | 2 +- srfi/srfi-13.c | 2 +- srfi/srfi-13.h | 2 +- srfi/srfi-13.scm | 2 +- srfi/srfi-14.c | 2 +- srfi/srfi-14.h | 2 +- srfi/srfi-14.scm | 2 +- srfi/srfi-16.scm | 2 +- srfi/srfi-17.scm | 2 +- srfi/srfi-19.scm | 2 +- srfi/srfi-2.scm | 2 +- srfi/srfi-26.scm | 2 +- srfi/srfi-31.scm | 2 +- srfi/srfi-34.scm | 2 +- srfi/srfi-39.scm | 2 +- srfi/srfi-4.c | 2 +- srfi/srfi-4.h | 2 +- srfi/srfi-4.scm | 2 +- srfi/srfi-6.scm | 2 +- srfi/srfi-60.h | 2 +- srfi/srfi-60.scm | 2 +- srfi/srfi-8.scm | 2 +- srfi/srfi-9.scm | 2 +- 49 files changed, 195 insertions(+), 105 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 951916833..a9a072225 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with Automake to create Makefile.in ## -## Copyright (C) 1998, 2002 Free Software Foundation, Inc. +## Copyright (C) 1998, 2002, 2006 Free Software Foundation, Inc. ## ## This file is part of GUILE. ## diff --git a/doc/NEWS b/doc/NEWS index 2624f28d3..67c558e7c 100644 --- a/doc/NEWS +++ b/doc/NEWS @@ -1,5 +1,5 @@ Guile-doc NEWS --- history of user-visible changes. -*- text -*- -Copyright (C) 1997, 2001 Free Software Foundation, Inc. +Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc. See the end for copying conditions. @@ -30,7 +30,7 @@ documentation. Copyright information: -Copyright (C) 1996,1997 Free Software Foundation, Inc. +Copyright (C) 1996,1997, 2006 Free Software Foundation, Inc. Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the diff --git a/doc/groupings.alist b/doc/groupings.alist index 31b9a748a..ed5bb1fca 100644 --- a/doc/groupings.alist +++ b/doc/groupings.alist @@ -1,6 +1,6 @@ ;;; groupings.alist -*-scheme-*- -;; Copyright (C) 2002 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2006 Free Software Foundation, Inc. ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as diff --git a/doc/oldfmt.c b/doc/oldfmt.c index cf9e908eb..0d2c86ead 100644 --- a/doc/oldfmt.c +++ b/doc/oldfmt.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 2000,2001, 2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index 58d669c15..ba5968a02 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,8 +1,41 @@ +2006-04-15 Kevin Ryde + + * api-scheduling.texi (System asyncs): "{void *}" in @deffnx to keep + the "*" out of the name in the index. + +2006-04-06 Kevin Ryde + + * posix.texi (Ports and File Descriptors): Clarify fcntl a bit, + and correction FD_CLOEXEC goes with FD_SETFD not FD_SETFL. + (Network Sockets and Communication): In accept, cross-reference to + fcntl on O_NONBLOCK. + +2006-03-28 Kevin Ryde + + * api-compound.texi (Vector Accessing from C): Show + SCM_SIMPLE_VECTOR_SET not SCM_SIMPLE_VECTOR_SET_X, the former is + what's in vector.h. + +2006-03-21 Ludovic Courtès + + * api-data.texi (Conversion): Add scm_c_locale_stringn_to_number. + +2006-03-05 Kevin Ryde + + * api-compound.texi (Array Procedures): @pxref for `equal?'. + (Shared Arrays): Correction to make-shared-array stride example, need + `list' on the mapper return value. + 2006-02-13 Marius Vollmer * api-utility.texi (Object Properties): Removed confusing paragraph about 'name' property. +2006-02-07 Kevin Ryde + + * api-modules.texi (Compiled Code Installation): Revise, in particular + @libdir@ needs to go via the makefile. + 2006-02-04 Neil Jerram * api-control.texi (Throw Handlers): New node. diff --git a/doc/ref/Makefile.am b/doc/ref/Makefile.am index 04c74e239..1e4f3cfee 100644 --- a/doc/ref/Makefile.am +++ b/doc/ref/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with Automake to create Makefile.in ## -## Copyright (C) 1998, 2004 Free Software Foundation, Inc. +## Copyright (C) 1998, 2004, 2006 Free Software Foundation, Inc. ## ## This file is part of GUILE. ## diff --git a/doc/ref/api-compound.texi b/doc/ref/api-compound.texi index a47b2d28e..dda2518de 100644 --- a/doc/ref/api-compound.texi +++ b/doc/ref/api-compound.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005 +@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -885,7 +885,7 @@ Evaluates to the element at position @var{idx} in the simple vector @var{vec}. No type or range checking is done. @end deftypefn -@deftypefn {C Macro} void SCM_SIMPLE_VECTOR_SET_X (SCM vec, size_t idx, SCM val) +@deftypefn {C Macro} void SCM_SIMPLE_VECTOR_SET (SCM vec, size_t idx, SCM val) Sets the element at position @var{idx} in the simple vector @var{vec} to @var{val}. No type or range checking is done. @end deftypefn @@ -2038,8 +2038,9 @@ is unspecified. Return @code{#t} if all arguments are arrays with the same shape, the same type, and have corresponding elements which are either @code{equal?} or @code{array-equal?}. This function differs from -@code{equal?} in that a one dimensional shared array may be -@var{array-equal?} but not @var{equal?} to a vector or uniform vector. +@code{equal?} (@pxref{Equality}) in that a one dimensional shared +array may be @code{array-equal?} but not @code{equal?} to a vector or +uniform vector. @end deffn @c FIXME: array-map! accepts no source arrays at all, and in that @@ -2237,7 +2238,7 @@ taken. The following is every third element, @example (make-shared-array #1(a b c d e f g h i j k l) - (lambda (i) (* i 3)) + (lambda (i) (list (* i 3))) 4) @result{} #1(a d g j) @end example diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi index 61847e3a4..885f42294 100755 --- a/doc/ref/api-data.texi +++ b/doc/ref/api-data.texi @@ -1031,6 +1031,13 @@ syntactically valid notation for a number, then @code{string->number} returns @code{#f}. @end deffn +@deftypefn {C Function} SCM scm_c_locale_stringn_to_number (const char *string, size_t len, unsigned radix) +As per @code{string->number} above, but taking a C string, as pointer +and length. The string characters should be in the current locale +encoding (@code{locale} in the name refers only to that, there's no +locale-dependent parsing). +@end deftypefn + @node Complex @subsubsection Complex Number Operations diff --git a/doc/ref/api-modules.texi b/doc/ref/api-modules.texi index 89bb87e80..54e5f4b8f 100644 --- a/doc/ref/api-modules.texi +++ b/doc/ref/api-modules.texi @@ -1247,48 +1247,51 @@ The simplest way to write a module using compiled C code is @end example When loaded with @code{(use-modules (foo bar))}, the -@code{load-extension} call looks for the @file{foobar-c-code.so} +@code{load-extension} call looks for the @file{foobar-c-code.so} (etc) object file in the standard system locations, such as @file{/usr/lib} or @file{/usr/local/lib}. If someone installs your module to a non-standard location then the object file won't be found. You can address this by inserting the install location in the @file{foo/bar.scm} file. This is convenient -for the user and also guarantees the intended object file is read, -even if stray older or newer versions are in the loader's path. +for the user and also guarantees the intended object is read, even if +stray older or newer versions are in the loader's path. The usual way to specify an install location is with a @code{prefix} at the configure stage, for instance @samp{./configure prefix=/opt} -results in library object code like @file{foobar-c-code.so} going -under @file{/opt/lib/foobar-c-code.so}. When using Autoconf -(@pxref{Top, , Introduction, autoconf, The GNU Autoconf Manual}), the -library location is in a @code{libdir} variable and it can be inserted -automatically by writing the scheme code as a @file{bar.scm.in}, +results in library files as say @file{/opt/lib/foobar-c-code.so}. +When using Autoconf (@pxref{Top, , Introduction, autoconf, The GNU +Autoconf Manual}), the library location is in a @code{libdir} +variable. Its value is intended to be expanded by @command{make}, and +can by substituted into a source file like @file{foo.scm.in} @example (define-module (foo bar)) -(load-extension "@@libdir@@/foobar-c-code" "foo_bar_init") +(load-extension "XXlibdirXX/foobar-c-code" "foo_bar_init") @end example -The Autoconf manual describes how this is processed to make the actual -@file{bar.scm} which is installed (@pxref{Configuration Files, , -Creating Configuration Files, autoconf, The GNU Autoconf Manual}). A -substitution can also be done explicitly in a @file{Makefile} with a -simple @code{sed} (@pxref{Top, , Introduction, sed, SED, A Stream -Editor}). +@noindent +with the following in a @file{Makefile}, using @command{sed} +(@pxref{Top, , Introduction, sed, SED, A Stream Editor}), + +@example +foo.scm: foo.scm.in + sed 's|XXlibdirXX|$(libdir)|' foo.scm +@end example -If several modules need this, it can be easier to create one -@file{foo/config.scm} with a define of the @code{libdir} location, and -use that as required. +The actual pattern @code{XXlibdirXX} is arbitrary, it's only something +which doesn't otherwise occur. If several modules need the value, it +can be easier to create one @file{foo/config.scm} with a define of the +@code{libdir} location, and use that as required. @example (define-module (foo config)) -(define-public foo-config-libdir "@@libdir@@"") +(define-public foo-config-libdir "XXlibdirXX"") @end example -Such a file might have other locations too, for instance a configured -data directory for auxiliary files, or @code{localedir} if the module -has its own @code{gettext} message catalogue +Such a file might have other locations too, for instance a data +directory for auxiliary files, or @code{localedir} if the module has +its own @code{gettext} message catalogue (@pxref{Internationalization}). When installing multiple C code objects, it can be convenient to put @@ -1296,12 +1299,12 @@ them in a subdirectory of @code{libdir}, thus giving for example @code{/usr/lib/foo/some-obj.so}. If the objects are only meant to be used through the module, then a subdirectory keeps them out of sight. -It will be noted all of the above requires that the Scheme code -modules can be found in @code{%load-path} (@pxref{Build Config}). -Presently it's left up to the system administrator or each user to -augment that path when installing Guile modules in non-default -locations. But having reached the Scheme code, that code should take -care of hitting any of its own private files etc. +It will be noted all of the above requires that the Scheme code to be +found in @code{%load-path} (@pxref{Build Config}). Presently it's +left up to the system administrator or each user to augment that path +when installing Guile modules in non-default locations. But having +reached the Scheme code, that code should take care of hitting any of +its own private files etc. Presently there's no convention for having a Guile version number in module C code filenames or directories. This is primarily because diff --git a/doc/ref/api-scheduling.texi b/doc/ref/api-scheduling.texi index 74845735e..e1f137175 100644 --- a/doc/ref/api-scheduling.texi +++ b/doc/ref/api-scheduling.texi @@ -140,7 +140,7 @@ signal handlers. @deffn {Scheme Procedure} call-with-blocked-asyncs proc @deffnx {C Function} scm_call_with_blocked_asyncs (proc) -@deffnx {C Function} void *scm_c_call_with_blocked_asyncs (void * (*proc) (void *data), void *data) +@deffnx {C Function} {void *} scm_c_call_with_blocked_asyncs (void * (*proc) (void *data), void *data) @findex scm_c_call_with_blocked_asyncs Call @var{proc} and block the execution of system asyncs by one level for the current thread while it is running. Return the value returned @@ -150,7 +150,7 @@ arguments; for the third, call it with @var{data}. @deffn {Scheme Procedure} call-with-unblocked-asyncs proc @deffnx {C Function} scm_call_with_unblocked_asyncs (proc) -@deffnx {C Function} void *scm_c_call_with_unblocked_asyncs (void *(*p) (void *d), void *d) +@deffnx {C Function} {void *} scm_c_call_with_unblocked_asyncs (void *(*p) (void *d), void *d) @findex scm_c_call_with_unblocked_asyncs Call @var{proc} and unblock the execution of system asyncs by one level for the current thread while it is running. Return the value diff --git a/doc/ref/data-rep.texi b/doc/ref/data-rep.texi index 80bcb175c..5b76263b3 100644 --- a/doc/ref/data-rep.texi +++ b/doc/ref/data-rep.texi @@ -24,7 +24,7 @@ @c essay @ifinfo @c essay Data Representation in Guile -@c essay Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation +@c essay Copyright (C) 1998, 1999, 2000, 2003, 2006 Free Software Foundation @c essay Permission is granted to make and distribute verbatim copies of @c essay this manual provided the copyright notice and this permission notice @@ -52,7 +52,7 @@ @c essay @sp 10 @c essay @comment The title is printed in a large font. @c essay @title Data Representation in Guile -@c essay @subtitle $Id: data-rep.texi,v 1.19 2005-04-22 23:16:43 kryde Exp $ +@c essay @subtitle $Id: data-rep.texi,v 1.20 2006-04-16 23:11:15 kryde Exp $ @c essay @subtitle For use with Guile @value{VERSION} @c essay @author Jim Blandy @c essay @author Free Software Foundation @@ -61,7 +61,7 @@ @c essay @page @c essay @vskip 0pt plus 1filll @c essay @vskip 0pt plus 1filll -@c essay Copyright @copyright{} 1998 Free Software Foundation +@c essay Copyright @copyright{} 1998, 2006 Free Software Foundation @c essay Permission is granted to make and distribute verbatim copies of @c essay this manual provided the copyright notice and this permission notice diff --git a/doc/ref/fdl.texi b/doc/ref/fdl.texi index 941a609f4..17fe1480c 100644 --- a/doc/ref/fdl.texi +++ b/doc/ref/fdl.texi @@ -6,7 +6,7 @@ @center Version 1.2, November 2002 @display -Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. +Copyright @copyright{} 2000,2001,2002, 2006 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies diff --git a/doc/ref/intro.texi b/doc/ref/intro.texi index bfe3b396d..ce306d60a 100644 --- a/doc/ref/intro.texi +++ b/doc/ref/intro.texi @@ -467,7 +467,7 @@ You can get the version number by invoking the command @example $ guile --version Guile 1.4.1 -Copyright (c) 1995, 1996, 1997, 2000 Free Software Foundation +Copyright (c) 1995, 1996, 1997, 2000, 2006 Free Software Foundation Guile may be distributed under the terms of the GNU General Public License; certain other uses are permitted as well. For details, see the file `COPYING', which is included in the Guile distribution. diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi index 3d0c8f496..31cb948ef 100644 --- a/doc/ref/posix.texi +++ b/doc/ref/posix.texi @@ -474,36 +474,49 @@ If @var{size} is omitted, a default size will be used. @deffn {Scheme Procedure} fcntl object cmd [value] @deffnx {C Function} scm_fcntl (object, cmd, value) -Apply @var{command} to the specified file descriptor or the underlying -file descriptor of the specified port. @var{value} is an optional -integer argument. +Apply @var{cmd} on @var{object}, either a port or file descriptor. +The @var{value} is an integer argument, for the @code{SET} commands. -Values for @var{command} are: +Values for @var{cmd} are: @defvar F_DUPFD -Duplicate a file descriptor +Duplicate the file descriptor, the same as @code{dup->fdes} above +does. @end defvar + @defvar F_GETFD -Get flags associated with the file descriptor. +@defvarx F_SETFD +Get or set flags associated with the file descriptor. The only flag +is the following, + +@defvar FD_CLOEXEC +``Close on exec'', meaning the file descriptor will be closed on an +@code{exec} call (a successful such call). For example to set that +flag, + +@example +(fcntl port F_SETFD FD_CLOEXEC) +@end example @end defvar -@defvar F_SETFD -Set flags associated with the file descriptor to @var{value}. @end defvar + @defvar F_GETFL -Get flags associated with the open file. -@end defvar -@defvar F_SETFL -Set flags associated with the open file to @var{value} +@defvarx F_SETFL +Get or set flags associated with the open file. These flags are +@code{O_RDONLY} etc described under @code{open} above. + +A common use is to set @code{O_NONBLOCK} on a network socket. The +following sets that flag, and leaves other flags unchanged. + +@example +(fcntl sock F_SETFL + (logior (fcntl sock F_GETFL) O_NONBLOCK)) +@end example @end defvar + @defvar F_GETOWN -Get the process ID of a socket's owner, for @code{SIGIO} signals. -@end defvar -@defvar F_SETOWN -Set the process that owns a socket to @var{value}, for @code{SIGIO} signals. -@end defvar -@defvar FD_CLOEXEC -The value used to indicate the ``close on exec'' flag with @code{F_GETFL} or -@code{F_SETFL}. +@defvarx F_SETOWN +Get or set the process ID of a socket's owner, for @code{SIGIO} signals. @end defvar @end deffn @@ -2789,8 +2802,9 @@ The return value is unspecified. @deffnx {C Function} scm_accept (sock) Accept a connection from socket port @var{sock} which has been enabled for listening with @code{listen} above. If there are no incoming -connections in the queue, wait until one is available (unless the -non-blocking option has been set on the socket). +connections in the queue, wait until one is available (unless +@code{O_NONBLOCK} has been set on the socket, @pxref{Ports and File +Descriptors,@code{fcntl}}). The return value is a pair. The @code{car} is a new socket port, connected and ready to communicate. The @code{cdr} is a socket diff --git a/doc/tutorial/Makefile.am b/doc/tutorial/Makefile.am index bf7f5245c..ed01b0a3c 100644 --- a/doc/tutorial/Makefile.am +++ b/doc/tutorial/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with Automake to create Makefile.in ## -## Copyright (C) 1998 Free Software Foundation, Inc. +## Copyright (C) 1998, 2006 Free Software Foundation, Inc. ## ## This file is part of GUILE. ## diff --git a/doc/tutorial/guile-tut.texi b/doc/tutorial/guile-tut.texi index f904c7d61..ed0b20210 100644 --- a/doc/tutorial/guile-tut.texi +++ b/doc/tutorial/guile-tut.texi @@ -34,7 +34,7 @@ @page @vskip 0pt plus 1filll -Copyright @copyright{} 1997, 1998, 2004 Free Software Foundation +Copyright @copyright{} 1997, 1998, 2004, 2006 Free Software Foundation Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -60,7 +60,7 @@ by the author. @ifinfo This file gives a tutorial introduction to Guile. -Copyright (C) 1997, 2004 Free Software Foundation +Copyright (C) 1997, 2004, 2006 Free Software Foundation Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice diff --git a/guile-readline/ChangeLog b/guile-readline/ChangeLog index a9d627d35..7d822d509 100644 --- a/guile-readline/ChangeLog +++ b/guile-readline/ChangeLog @@ -1,7 +1,15 @@ +2006-03-12 Neil Jerram + + * ice-9/readline.scm (make-completion-function): New. + 2006-02-06 Marius Vollmer * LIBGUILEREADLINE-VERSION: Bumped versions for 1.9 series. +2006-02-06 Marius Vollmer + + * LIBGUILEREADLINE-VERSION: Bumped versions for 1.8. + 2005-03-02 Marius Vollmer * readline.c: Use scm_current_input_port instead of scm_cur_inp. diff --git a/guile-readline/Makefile.am b/guile-readline/Makefile.am index b22061c7a..6d6e16882 100644 --- a/guile-readline/Makefile.am +++ b/guile-readline/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with Automake to create Makefile.in ## -## Copyright (C) 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc. +## Copyright (C) 1998, 1999, 2000, 2001, 2004, 2006 Free Software Foundation, Inc. ## ## This file is part of GUILE. ## diff --git a/guile-readline/ice-9/Makefile.am b/guile-readline/ice-9/Makefile.am index 59e4b35d7..1917c76fc 100644 --- a/guile-readline/ice-9/Makefile.am +++ b/guile-readline/ice-9/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with Automake to create Makefile.in ## -## Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. -## Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +## Copyright (C) 1998, 1999, 2000, 2001, 2006 Free Software Foundation, Inc. +## Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. ## ## This file is part of GUILE. ## diff --git a/guile-readline/ice-9/readline.scm b/guile-readline/ice-9/readline.scm index 85d41726e..a2d6359cd 100644 --- a/guile-readline/ice-9/readline.scm +++ b/guile-readline/ice-9/readline.scm @@ -1,6 +1,6 @@ ;;;; readline.scm --- support functions for command-line editing ;;;; -;;;; Copyright (C) 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +;;;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2006 Free Software Foundation, Inc. ;;;; ;;;; This program is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ ;;; but only when it isn't already present. (if (not (provided? 'readline)) - (load-extension "libguilereadline-v-16" "scm_init_readline")) + (load-extension "libguilereadline-v-17" "scm_init_readline")) (if (not (provided? 'readline)) (scm-error 'misc-error @@ -216,3 +216,27 @@ (set-readline-prompt! "" "") (set-readline-read-hook! #f))))) (set! (using-readline?) #t)))) + +(define-public (make-completion-function strings) + "Construct and return a completion function for a list of strings. +The returned function is suitable for passing to +@code{with-readline-completion-function. The argument @var{strings} +should be a list of strings, where each string is one of the possible +completions." + (letrec ((strs '()) + (regexp #f) + (completer (lambda (text continue?) + (if continue? + (if (null? strs) + #f + (let ((str (car strs))) + (set! strs (cdr strs)) + (if (string-match regexp str) + str + (completer text #t)))) + (begin + (set! strs strings) + (set! regexp + (string-append "^" (regexp-quote text))) + (completer text #t)))))) + completer)) diff --git a/guile-readline/readline.c b/guile-readline/readline.c index 8cf4ae0e1..37eab2433 100644 --- a/guile-readline/readline.c +++ b/guile-readline/readline.c @@ -1,6 +1,6 @@ /* readline.c --- line editing support for Guile */ -/* Copyright (C) 1997,1999,2000,2001, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1997,1999,2000,2001, 2002, 2003, 2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/guile-readline/readline.h b/guile-readline/readline.h index 6ea10d278..6242c5642 100644 --- a/guile-readline/readline.h +++ b/guile-readline/readline.h @@ -1,7 +1,7 @@ #ifndef READLINEH #define READLINEH -/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999, 2000, 2006 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/srfi/Makefile.am b/srfi/Makefile.am index 92c363983..569c79dff 100644 --- a/srfi/Makefile.am +++ b/srfi/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with Automake to create Makefile.in ## -## Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc. +## Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. ## ## This file is part of GUILE. ## diff --git a/srfi/srfi-1.h b/srfi/srfi-1.h index b57d2202b..810f1046d 100644 --- a/srfi/srfi-1.h +++ b/srfi/srfi-1.h @@ -2,7 +2,7 @@ #define SCM_SRFI_1_H /* srfi-1.h --- SRFI-1 procedures for Guile * - * Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. + * Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-1.scm b/srfi/srfi-1.scm index 6c5a12e8c..252e9b312 100644 --- a/srfi/srfi-1.scm +++ b/srfi/srfi-1.scm @@ -1,6 +1,6 @@ ;;; srfi-1.scm --- List Library -;; Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-10.scm b/srfi/srfi-10.scm index d04a6c60d..8e7181a3b 100644 --- a/srfi/srfi-10.scm +++ b/srfi/srfi-10.scm @@ -1,6 +1,6 @@ ;;; srfi-10.scm --- Hash-Comma Reader Extension -;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-11.scm b/srfi/srfi-11.scm index cb805a99b..9e17d6632 100644 --- a/srfi/srfi-11.scm +++ b/srfi/srfi-11.scm @@ -1,6 +1,6 @@ ;;; srfi-11.scm --- let-values and let*-values -;; Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2000, 2001, 2002, 2004, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-13.c b/srfi/srfi-13.c index a37164538..64331f37e 100644 --- a/srfi/srfi-13.c +++ b/srfi/srfi-13.c @@ -1,6 +1,6 @@ /* srfi-13.c --- old place of SRFI-13 procedures for Guile * - * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-13.h b/srfi/srfi-13.h index 85dfca131..8007d565b 100644 --- a/srfi/srfi-13.h +++ b/srfi/srfi-13.h @@ -3,7 +3,7 @@ /* SRFI-13 procedures for Guile * - * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-13.scm b/srfi/srfi-13.scm index 4fee4d984..1036a0f47 100644 --- a/srfi/srfi-13.scm +++ b/srfi/srfi-13.scm @@ -1,6 +1,6 @@ ;;; srfi-13.scm --- String Library -;; Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-14.c b/srfi/srfi-14.c index 121253438..fe5e049d1 100644 --- a/srfi/srfi-14.c +++ b/srfi/srfi-14.c @@ -1,6 +1,6 @@ /* srfi-14.c --- Old place of SRFI-14 procedures for Guile * - * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-14.h b/srfi/srfi-14.h index 049b3a55d..b1f4ae726 100644 --- a/srfi/srfi-14.h +++ b/srfi/srfi-14.h @@ -2,7 +2,7 @@ #define SCM_SRFI_14_H /* srfi-14.c --- SRFI-14 procedures for Guile * - * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-14.scm b/srfi/srfi-14.scm index 6d65daa6c..100b43b8e 100644 --- a/srfi/srfi-14.scm +++ b/srfi/srfi-14.scm @@ -1,6 +1,6 @@ ;;; srfi-14.scm --- Character-set Library -;; Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-16.scm b/srfi/srfi-16.scm index 9f8480145..0b213fde7 100644 --- a/srfi/srfi-16.scm +++ b/srfi/srfi-16.scm @@ -1,6 +1,6 @@ ;;; srfi-16.scm --- case-lambda -;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-17.scm b/srfi/srfi-17.scm index 6a3e67626..c9cb2abfe 100644 --- a/srfi/srfi-17.scm +++ b/srfi/srfi-17.scm @@ -1,6 +1,6 @@ ;;; srfi-17.scm --- Generalized set! -;; Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-19.scm b/srfi/srfi-19.scm index 57040f1ae..896dd035f 100644 --- a/srfi/srfi-19.scm +++ b/srfi/srfi-19.scm @@ -1,6 +1,6 @@ ;;; srfi-19.scm --- Time/Date Library -;; Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-2.scm b/srfi/srfi-2.scm index 9e8fb5dbd..0dfe38305 100644 --- a/srfi/srfi-2.scm +++ b/srfi/srfi-2.scm @@ -1,6 +1,6 @@ ;;; srfi-2.scm --- and-let* -;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-26.scm b/srfi/srfi-26.scm index d0f1c57ad..410d2e2f8 100644 --- a/srfi/srfi-26.scm +++ b/srfi/srfi-26.scm @@ -1,6 +1,6 @@ ;;; srfi-26.scm --- specializing parameters without currying. -;; Copyright (C) 2002 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-31.scm b/srfi/srfi-31.scm index 0c11049b9..54c2f9fd4 100644 --- a/srfi/srfi-31.scm +++ b/srfi/srfi-31.scm @@ -1,6 +1,6 @@ ;;; srfi-31.scm --- special form for recursive evaluation -;; Copyright (C) 2004 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-34.scm b/srfi/srfi-34.scm index e16ff834f..5101b543d 100644 --- a/srfi/srfi-34.scm +++ b/srfi/srfi-34.scm @@ -1,6 +1,6 @@ ;;; srfi-34.scm --- Exception handling for programs -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-39.scm b/srfi/srfi-39.scm index 68479ddbd..ecb6944ff 100644 --- a/srfi/srfi-39.scm +++ b/srfi/srfi-39.scm @@ -1,6 +1,6 @@ ;;; srfi-39.scm --- Parameter objects -;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as diff --git a/srfi/srfi-4.c b/srfi/srfi-4.c index b7cd79661..b4486a568 100644 --- a/srfi/srfi-4.c +++ b/srfi/srfi-4.c @@ -1,6 +1,6 @@ /* srfi-4.c --- Homogeneous numeric vector datatypes. * - * Copyright (C) 2001, 2004 Free Software Foundation, Inc. + * Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-4.h b/srfi/srfi-4.h index d638ee386..079219ace 100644 --- a/srfi/srfi-4.h +++ b/srfi/srfi-4.h @@ -2,7 +2,7 @@ #define SCM_SRFI_SRFI_4_H /* srfi-4.c --- Homogeneous numeric vector datatypes. * - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001, 2006 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-4.scm b/srfi/srfi-4.scm index b1eede7f5..f30e83952 100644 --- a/srfi/srfi-4.scm +++ b/srfi/srfi-4.scm @@ -1,6 +1,6 @@ ;;; srfi-4.scm --- Homogeneous Numeric Vector Datatypes -;; Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-6.scm b/srfi/srfi-6.scm index 0fe2555c2..1e455bb5c 100644 --- a/srfi/srfi-6.scm +++ b/srfi/srfi-6.scm @@ -1,6 +1,6 @@ ;;; srfi-6.scm --- Basic String Ports -;; Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-60.h b/srfi/srfi-60.h index a7f4dd5cb..030b32525 100644 --- a/srfi/srfi-60.h +++ b/srfi/srfi-60.h @@ -1,6 +1,6 @@ /* srfi-60.h --- SRFI-60 procedures for Guile * - * Copyright (C) 2005 Free Software Foundation, Inc. + * Copyright (C) 2005, 2006 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-60.scm b/srfi/srfi-60.scm index 184e1e3f3..177f97681 100644 --- a/srfi/srfi-60.scm +++ b/srfi/srfi-60.scm @@ -1,6 +1,6 @@ ;;; srfi-60.scm --- Integers as Bits -;; Copyright (C) 2005 Free Software Foundation, Inc. +;; Copyright (C) 2005, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-8.scm b/srfi/srfi-8.scm index ea186156e..c15cbe9c0 100644 --- a/srfi/srfi-8.scm +++ b/srfi/srfi-8.scm @@ -1,6 +1,6 @@ ;;; srfi-8.scm --- receive -;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +;; Copyright (C) 2000, 2001, 2002, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public diff --git a/srfi/srfi-9.scm b/srfi/srfi-9.scm index aa877747c..59d23bf53 100644 --- a/srfi/srfi-9.scm +++ b/srfi/srfi-9.scm @@ -1,6 +1,6 @@ ;;; srfi-9.scm --- define-record-type -;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public -- 2.20.1