r4819: Auto commit for Debian build
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 5 May 2003 22:17:00 +0000 (22:17 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 5 May 2003 22:17:00 +0000 (22:17 +0000)
README
TODO
debian/changelog
debian/control
libreadline.lisp
readline.lisp

diff --git a/README b/README
index 1dbf41db9e0e66b0d02d231026236ab000d61b05..d71dd79b04dd9f82a5899d89e6336890c7f2223a 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-CL-READLINE 0.1
+CL-READLINE 0.1.1
 
  CL-READLINE is a simple UFFI-based wrapper for the GNU Readline
  library. 
 
  CL-READLINE is a simple UFFI-based wrapper for the GNU Readline
  library. 
@@ -7,8 +7,46 @@ CL-READLINE 0.1
  and CMUCL. Other platforms and UFFI compatible implementations should
  work, but may require tweaking.
 
  and CMUCL. Other platforms and UFFI compatible implementations should
  work, but may require tweaking.
 
- To use:
+  To load: 
 
 
-  (asdf:oos 'asdf:load-op 'readline)
-  (rl:readline :prompt "> ")
+       (asdf:oos 'asdf:load-op 'readline)
 
 
+  The interface exported by the package READLINE (nicknamed RL).
+
+Functions:
+
+  READLINE &key prompt history
+
+     prompt  -- a string (default "")
+     history -- a boolean (default t)
+
+     Prompt is the prompt displayed to user.
+
+     History controls whether the string read is added to history, or
+     not. Note that history is available in any case. Currently there
+     is no way to erase history.
+
+  ADD-HISTORY string
+
+     Adds the given string to history.
+
+  USE-FILENAME-COMPLETE
+
+     Use the Readline's default filename-completion system.
+
+  USE-CL-COMPLETE
+
+     Insert symbols in CL-USER to the custom completion pool,
+     and start using the custom completion system.
+
+  USE-CUSTOM-COMPLETE
+
+     Use the custom completion system.
+
+  ADD-COMPLETION
+
+     Add a completion to the custom completion pool.
+
+  CLEAR-COMPLETIONS
+
+     Empty the custom completion pool.
diff --git a/TODO b/TODO
index 256debc042f04129fad86d6cfd80c54b8274cf7f..60b50a5ae30b006a0506b260fd3d36e02d4bd11d 100644 (file)
--- a/TODO
+++ b/TODO
@@ -20,4 +20,4 @@
 - Lightweight version based on alternate library with
   more permissive license.
 
 - Lightweight version based on alternate library with
   more permissive license.
 
-- Samrter installation
+- Smarter installation
index a26b15c1be35bae8e97868f5a8b43ccc5046fac0..5d438319ee96d21031ea5af6571fb25779979ac7 100644 (file)
@@ -1,3 +1,9 @@
+cl-readline (0.1.1kmr-1) unstable; urgency=low
+
+  * New upstream  (closes: 191916)
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Mon,  5 May 2003 16:15:45 -0600
+
 cl-readline (0.1-1) unstable; urgency=low
 
   * Initial upload (closes:191916)
 cl-readline (0.1-1) unstable; urgency=low
 
   * Initial upload (closes:191916)
index d6832cb150c2e8f49ae6b48404326a6cd204a643..85adaed5eeefad7a90b5c31ddf34ba44e8d044cc 100644 (file)
@@ -7,7 +7,7 @@ Standards-Version: 3.5.9.0
 
 Package: cl-readline
 Architecture: any
 
 Package: cl-readline
 Architecture: any
-Depends: ${shlibs:Depends}, common-lisp-controller, cl-uffi, libreadline4
+Depends: ${shlibs:Depends}, common-lisp-controller, cl-uffi
 Description: Common Lisp interface to the GNU readline library
  This package uses UFFI to provide an interface to the GNU readline
  library for Common Lisp programs.
 Description: Common Lisp interface to the GNU readline library
  This package uses UFFI to provide an interface to the GNU readline
  library for Common Lisp programs.
index a127189a5b8aeaaa1d89a44860189a12c5a8f52d..53fd10502f1a7809b803250c2514e92d148c103c 100644 (file)
@@ -23,7 +23,7 @@
 
 (def-function "readline" ((prompt :cstring))
   :module "readline"
 
 (def-function "readline" ((prompt :cstring))
   :module "readline"
-  :returning :cstring)
+  :returning (* :char))
 
 (def-function "add_history" ((str :cstring))
   :module "readline"
 
 (def-function "add_history" ((str :cstring))
   :module "readline"
index 2685c4b374367145cb37c3ad5b923446d84e6604..4e8af262c09fe969a4d58d71974a6809c3b6ae1f 100644 (file)
     (setq cl-complete nil)
     (libreadline::clear-completions))
   
     (setq cl-complete nil)
     (libreadline::clear-completions))
   
-  (defun use-custom-complete ()
-    "Use custom-competions."
-    (libreadline::use-custom-complete)
-    nil)
-  
-  (defun use-filename-complete ()
-    "Use default completion system. (filename)"
-    (libreadline::use-filename-complete)
-    nil)
-
   (defun use-cl-complete ()
     "Load symbols in package CL-USER as custom-completions."
     (unless cl-complete
   (defun use-cl-complete ()
     "Load symbols in package CL-USER as custom-completions."
     (unless cl-complete
       (do-symbols (sym (find-package :cl-user))
        (add-completion (string-downcase (string sym)))))
     (use-custom-complete)
       (do-symbols (sym (find-package :cl-user))
        (add-completion (string-downcase (string sym)))))
     (use-custom-complete)
-    nil)
+    nil))
+
+;;; Everything that affects the custom-completion collection goes
+;;; above.
+
+(defun use-custom-complete ()
+  "Use custom-competions."
+  (libreadline::use-custom-complete)
+  nil)
+  
+(defun use-filename-complete ()
+  "Use default completion system. (filename)"
+  (libreadline::use-filename-complete)
+  nil)
 
 
-  (defun add-history (string)
-    "Add STRING to history."
-    (with-cstring (c-string string)
-      (libreadline::add-history c-string))
-    string)
+(defun add-history (string)
+  "Add STRING to history."
+  (with-cstring (c-string string)
+    (libreadline::add-history c-string))
+  string)
   
   
-  (defun readline (&key (prompt "") (history t))
-    "Read a line from current TTY with line-editing."
-    (with-cstring (c-prompt prompt)
-      (let ((str (string-trim
-                 *whitespace*
-                 (convert-from-cstring (libreadline::readline c-prompt)))))
-       (when (and history (not (string= "" str)))
-         (add-history str))))))
+(defun readline (&key (prompt "") (history t))
+  "Read a line from current TTY with line-editing."
+  (with-cstring (c-prompt prompt)
+    (let* ((char* (libreadline::readline c-prompt))
+          (str (string-trim *whitespace*
+                            (convert-from-foreign-string char*))))
+      (free-foreign-object char*)
+      (when (and history (not (string= "" str)))
+       (add-history str))
+      str)))