* readline.scm (apropos-completion-function): Don't define and
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Mon, 12 Jun 2000 14:54:30 +0000 (14:54 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Mon, 12 Jun 2000 14:54:30 +0000 (14:54 +0000)
install if the 'regex feature is missing.

guile-readline/readline.scm

index faf8901..104647e 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; readline.scm --- support functions for command-line editing
 ;;;;
-;;;;   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+;;;;   Copyright (C) 1997, 1999, 2000 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
 (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))))))
-
-(set! *readline-completion-function* apropos-completion-function)
+(if (feature? '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)
+      ))
 
 (define-public (activate-readline)
   (if (and (isatty? (current-input-port))