On 10/28/12 01:55, Shawn Betts wrote:
> On Sat, Oct 27, 2012 at 1:19 AM, Dirk Sondermann wrote:
>> On 10/26/12 20:54, Shawn Betts wrote:
>>> Thanks Kamil. Can someone confirm that it still works on clisp and sbcl?
>>
>> It builds and works on SBCL.
> 
> Good enough for me. Thanks! Kamil, it's been merged.

Unfortunately, I missed an issue while testing the mpd module
on SBCL yesterday.

In the function MPD-RECEIVE, the symbol READ-LINE is used as the
name of a function defined by FLET. By default, SBCL locks the
package COMMON-LISP, to which READ-LINE belongs, so binding this
symbol by FLET leads to an error:

  caught ERROR:
    Lock on package COMMON-LISP violated when binding READ-LINE
    as a local function while in package STUMPWM.
    See also:
      The SBCL Manual, Node "Package Locks"
      The ANSI Standard, Section 11.1.2.1.2

In principle, one could avoid this error by unlocking the package
(I did that accidentally yesterday by using SB-EXT:UNLOCK-PACKAGE
somewhere in my ~/.stumpwmrc), but it seems to be better to replace
READ-LINE with a less controversial name (cf. the attached patch).

-- 
Dirk
diff --git a/contrib/mpd.lisp b/contrib/mpd.lisp
index 7ab8e81..33050ce 100644
--- a/contrib/mpd.lisp
+++ b/contrib/mpd.lisp
@@ -180,7 +180,7 @@
 (defun mpd-receive (&optional ignore-data-p)
   "Unless IGNORE-DATA-P is T returns a list containing all data sent by mpd."
   (with-mpd-connection
-    (flet ((read-line (stream)
+    (flet ((receive-line (stream)
              #+(or sbcl clisp)
              (read-line stream)
              #+lispworks
@@ -190,8 +190,8 @@
                            collect b)))
                (ef:decode-external-string (coerce bytes 'vector) :utf-8))))
       (if ignore-data-p
-          (read-line *mpd-socket*)
-          (loop for i = (read-line *mpd-socket*)
+          (receive-line *mpd-socket*)
+          (loop for i = (receive-line *mpd-socket*)
                 when (mpd-error-p i)
                   do (message "Error sent back by mpd: ~a" i)
                 until (mpd-termination-p i)
_______________________________________________
Stumpwm-devel mailing list
Stumpwm-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel

Reply via email to