[slime-cvs] CVS update: slime/swank.lisp

Luke Gorrie lgorrie at common-lisp.net
Mon Aug 2 05:25:33 UTC 2004


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv25856

Modified Files:
	swank.lisp 
Log Message:
(with-buffer-syntax): Don't bind *readtable* to *buffer-readtable* if
they are already EQ. When we shadow this binding the user can't assign
*readtable* from the REPL so it's best avoided when possible.

Date: Sun Aug  1 22:25:33 2004
Author: lgorrie

Index: slime/swank.lisp
diff -u slime/swank.lisp:1.220 slime/swank.lisp:1.221
--- slime/swank.lisp:1.220	Thu Jul 22 09:54:22 2004
+++ slime/swank.lisp	Sun Aug  1 22:25:33 2004
@@ -920,9 +920,13 @@
 This should be used for code that is conceptionally executed in an
 Emacs buffer."
   (destructuring-bind () _
-    `(let ((*package* *buffer-package*)
-           (*readtable* *buffer-readtable*))
-      (call-with-syntax-hooks (lambda () , at body)))))
+    `(let ((*package* *buffer-package*))
+      ;; Don't shadow *readtable* unnecessarily because that prevents
+      ;; the user from assigning to it.
+      (if (eq *readtable* *buffer-readtable*)
+          #1=(call-with-syntax-hooks (lambda () , at body))
+          (let ((*readtable* *buffer-readtable*))
+            #1#)))))
 
 (defun from-string (string)
   "Read string in the *BUFFER-PACKAGE*"





More information about the slime-cvs mailing list