Merge branch 'ossau-gds-dev'
[bpt/guile.git] / guile-readline / ice-9 / readline.scm
index c35602f..96af69e 100644 (file)
@@ -4,7 +4,7 @@
 ;;;; 
 ;;;; 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
-;;;; the Free Software Foundation; either version 2, or (at your option)
+;;;; the Free Software Foundation; either version 3, or (at your option)
 ;;;; any later version.
 ;;;; 
 ;;;; This program is distributed in the hope that it will be useful,
 (define-public (set-readline-read-hook! h)
   (set! read-hook h))
 
+(define-public apropos-completion-function
+  (let ((completions '()))
+    (lambda (text cont?)
+      (if (not cont?)
+          (set! completions
+                (map symbol->string
+                     (apropos-internal
+                      (string-append "^" (regexp-quote text))))))
+      (if (null? completions)
+          #f
+          (let ((retval (car completions)))
+            (begin (set! completions (cdr completions))
+                   retval))))))
+
 (if (provided? 'regex)
-    (begin
-      (define-public apropos-completion-function
-       (let ((completions '()))
-         (lambda (text cont?)
-           (if (not cont?)
-               (set! completions
-                     (map symbol->string
-                          (apropos-internal
-                           (string-append "^" (regexp-quote text))))))
-           (if (null? completions)
-               #f
-               (let ((retval (car completions)))
-                 (begin (set! completions (cdr completions))
-                        retval))))))
-
-      (set! *readline-completion-function* apropos-completion-function)
-      ))
+    (set! *readline-completion-function* apropos-completion-function))
 
 (define-public (with-readline-completion-function completer thunk)
   "With @var{completer} as readline completion function, call @var{thunk}."