[slime-cvs] CVS slime

CVS User heller heller at common-lisp.net
Wed Mar 9 20:09:58 UTC 2011


Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv7249

Modified Files:
	ChangeLog slime.el 
Log Message:
Remove slime-sexp-at-point-for-macroexpansion.

* slime.el (slime-sexp-at-point-for-macroexpansion): Deleted.
(slime-eval-macroexpand): Use slime-sexp-at-point instead.
(slime-eval-macroexpand-inplace): Use
slime-bounds-of-sexp-at-point directly.

--- /project/slime/cvsroot/slime/ChangeLog	2011/03/09 20:09:48	1.2183
+++ /project/slime/cvsroot/slime/ChangeLog	2011/03/09 20:09:57	1.2184
@@ -1,5 +1,14 @@
 2011-03-09  Helmut Eller  <heller at common-lisp.net>
 
+	Remove slime-sexp-at-point-for-macroexpansion.
+
+	* slime.el (slime-sexp-at-point-for-macroexpansion): Deleted.
+	(slime-eval-macroexpand): Use slime-sexp-at-point instead.
+	(slime-eval-macroexpand-inplace): Use
+	slime-bounds-of-sexp-at-point directly.
+
+2011-03-09  Helmut Eller  <heller at common-lisp.net>
+
 	Move some of the logic from slime-sexp-at-point-for-macroexpansion
 	into slime-sexp-at-point.
 
--- /project/slime/cvsroot/slime/slime.el	2011/03/09 20:09:49	1.1361
+++ /project/slime/cvsroot/slime/slime.el	2011/03/09 20:09:57	1.1362
@@ -4962,32 +4962,12 @@
         (slime-remove-edits (point-min) (point-max)))
       (undo-only arg))))
 
-(defun slime-sexp-at-point-for-macroexpansion ()
-  "`slime-sexp-at-point' with special cases for LOOP."
-  (let ((string (slime-sexp-at-point-or-error))
-        (bounds (bounds-of-thing-at-point 'sexp))
-        (char-at-point (substring-no-properties (thing-at-point 'char))))
-    ;; SLIME-SEXP-AT-POINT(-OR-ERROR) uses (THING-AT-POINT 'SEXP)
-    ;; which is quite a bit botched: it returns "'(FOO BAR BAZ)" even
-    ;; when point is placed _at the opening parenthesis_, and hence
-    ;; "(FOO BAR BAZ)" wouldn't get expanded. Likewise for ",(...)",
-    ;; ",@(...)" (would return "@(...)"!!), and "\"(...)".
-    ;; So we better fix this up here:
-    (when (string= char-at-point "(")
-      (let ((char0 (elt string 0)))
-        (when (member char0 '(?\' ?\, ?\" ?\@))
-          (setf string (substring string 1))
-          (incf (car bounds)))))
-    (list string (cons (set-marker (make-marker) (car bounds))
-                       (set-marker (make-marker) (cdr bounds))))))
-
 (defvar slime-eval-macroexpand-expression nil
   "Specifies the last macroexpansion preformed. 
 This variable specifies both what was expanded and how.")
 
 (defun slime-eval-macroexpand (expander &optional string)
-  (let ((string (or string
-                    (car (slime-sexp-at-point-for-macroexpansion)))))
+  (let ((string (or string (slime-sexp-at-point))))
     (setq slime-eval-macroexpand-expression `(,expander ,string))
     (slime-eval-async slime-eval-macroexpand-expression
                       #'slime-initialize-macroexpansion-buffer)))
@@ -5024,15 +5004,15 @@
 
 NB: Does not affect slime-eval-macroexpand-expression"
   (interactive)
-  (destructuring-bind (string bounds)
-      (slime-sexp-at-point-for-macroexpansion)
-    (lexical-let* ((start (car bounds))
-                   (end (cdr bounds))
+  (let* ((bounds (or (slime-bounds-of-sexp-at-point) 
+                     (error "No sexp at point"))))
+    (lexical-let* ((start (copy-marker (car bounds)))
+                   (end (copy-marker (cdr bounds)))
                    (point (point))
                    (package (slime-current-package))
                    (buffer (current-buffer)))
       (slime-eval-async 
-       `(,expander ,string)
+       `(,expander ,(buffer-substring-no-properties start end))
        (lambda (expansion)
          (with-current-buffer buffer
            (let ((buffer-read-only nil))
@@ -7695,7 +7675,8 @@
   '(("foo")
     ("#:foo")
     ("#'foo")
-    ("#'(lambda (x) x)"))
+    ("#'(lambda (x) x)")
+    ("()"))
   (with-temp-buffer
     (lisp-mode)
     (insert string)





More information about the slime-cvs mailing list