[slime-cvs] CVS /slime
mbaringer
mbaringer at common-lisp.net
Fri May 26 20:14:20 UTC 2006
Update of /project/slime/cvsroot//slime
In directory clnet:/tmp/cvs-serv25474
Modified Files:
slime.el
Log Message:
--- /project/slime/cvsroot//slime/slime.el 2006/05/16 18:10:32 1.622
+++ /project/slime/cvsroot//slime/slime.el 2006/05/26 20:14:19 1.623
@@ -7364,10 +7364,17 @@
NB: Does not affect *slime-eval-macroexpand-expression*"
(interactive)
(lexical-let* ((string (slime-sexp-at-point-or-error))
+ (bounds (bounds-of-thing-at-point 'sexp))
+ (start (car bounds))
+ (end (cdr bounds))
+ (point (point))
(package (slime-current-package))
- (start (point))
- (end (+ start (length string)))
(buffer (current-buffer)))
+ ;; SLIME-SEXP-AT-POINT returns "'(FOO BAR BAZ)" even when point is
+ ;; placed at the opening parenthesis, which wouldn't get expanded
+ ;; even though FOO was a macro. Hence this workaround:
+ (when (and (eq ?\' (elt string 0)) (eq ?\( (elt string 1)))
+ (setf string (substring string 1)) (incf start))
(slime-eval-async
`(,expander ,string)
(lambda (expansion)
@@ -7377,7 +7384,8 @@
(delete-region start end)
(insert expansion)
(goto-char start)
- (indent-sexp)))))))
+ (indent-sexp)
+ (goto-char point)))))))
(defun slime-macroexpand-1 (&optional repeatedly)
"Display the macro expansion of the form at point. The form is
More information about the slime-cvs
mailing list