[linedit-devel] Re: Exception when using linedit:linedit on lispworks 5.0 (linux 2.6)

Lui Fungsin fungsin.lui at gmail.com
Fri Oct 20 05:50:07 UTC 2006


So I spent some time reading the lispworks manual, the uffi manual and
the linedit source to debug a little.

It turns out that the :module keyword arg is required for lw and that
it needs to be unique for different "so" object files.

BTW, the CLOS hack on the asd file to compile the c file and loading
the foreign library is very neat and clever!

Here's a patch, in case anyone wants to use linedit with lispworks.

Next up, I need to find out why linedit defaults to dumb mode with lw
while I can use smart mode with sbcl. If you guys have any hints I'd
greatly appreciated.

(I'm running lw pro 5.0 32bit on ubuntu)

Thanks!

CL-USER 2 > (linedit:linedit :prompt ">>>")
Linedit version 0.15.12 [dumb mode]
>>>23

"23"




Index: terminal.lisp
===================================================================
--- terminal.lisp       (revision 904)
+++ terminal.lisp       (working copy)
@@ -27,21 +27,24 @@

 (uffi:def-function ("linedit_terminal_columns" c-terminal-columns)
     ((default :int))
-  :returning :int)
+  :returning :int
+  :module "terminal_glue")

 (defmethod backend-columns ((backend terminal))
   (c-terminal-columns *default-columns*))

 (uffi:def-function ("linedit_terminal_lines" c-terminal-lines)
     ((default :int))
-  :returning :int)
+  :returning :int
+  :module "terminal_glue")

 (defmethod backend-lines ((backend terminal))
   (c-terminal-lines *default-lines*))

 (uffi:def-function ("linedit_terminal_init" c-terminal-init)
     ()
-  :returning :int)
+  :returning :int
+  :module "terminal_glue")

 (defmethod backend-init ((backend terminal))
   (invariant (not (backend-ready-p backend)))
@@ -50,7 +53,8 @@

 (uffi:def-function ("linedit_terminal_close" c-terminal-close)
     ()
-  :returning :int)
+  :returning :int
+  :module "terminal_glue")

 (defmethod backend-close ((backend terminal))
   (invariant (backend-ready-p backend))
Index: editor.lisp
===================================================================
--- editor.lisp (revision 904)
+++ editor.lisp (working copy)
@@ -127,14 +127,16 @@

 (uffi:def-function ("linedit_interrupt" c-interrupt)
     ()
-  :returning :void)
+  :returning :void
+  :module "signals")

 (defun editor-interrupt (editor)
   (without-backend editor (c-interrupt)))

 (uffi:def-function ("linedit_stop" c-stop)
     ()
-  :returning :void)
+  :returning :void
+  :module "signals")

 (defun editor-stop (editor)
   (without-backend editor (c-stop)))
Index: linedit.asd
===================================================================
--- linedit.asd (revision 904)
+++ linedit.asd (working copy)
@@ -43,7 +43,7 @@
 (defmethod perform ((o load-op) (c uffi-c-source-file))
   (let ((loader (intern "LOAD-FOREIGN-LIBRARY" :uffi)))
     (dolist (f (asdf::input-files o c))
-      (funcall loader f))))
+      (funcall loader f :module (pathname-name f)))))

 (defmethod perform ((o compile-op) (c uffi-c-source-file))
   (unless (zerop (run-shell-command "~A ~A ~{~A ~}-o ~A"



More information about the linedit-devel mailing list