[slime-cvs] CVS slime/contrib
trittweiler
trittweiler at common-lisp.net
Thu Jan 10 12:59:19 UTC 2008
Update of /project/slime/cvsroot/slime/contrib
In directory clnet:/tmp/cvs-serv9790
Modified Files:
slime-parse.el
Log Message:
* swank-parse.lisp (slime-incomplete-form-at-point): Take the
arglist index there user's point is located at correctly into
account. Previously `C-c C-s' on `(defun |foo' would have inserted
`args body...)', now it inserts `name args body...)'
--- /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/09/15 11:09:36 1.7
+++ /project/slime/cvsroot/slime/contrib/slime-parse.el 2008/01/10 12:59:18 1.8
@@ -16,14 +16,28 @@
(slime-enclosing-form-specs)
(if (null operators)
""
- (let ((op (first operators)))
+ (let ((op (first operators))
+ (op-start (first points))
+ (arg-index (first arg-indices)))
(destructure-case (slime-ensure-list op)
((:declaration declspec) op)
((:type-specifier typespec) op)
- (t (slime-ensure-list
- (save-excursion (goto-char (first points))
- (slime-parse-sexp-at-point
- (1+ (first arg-indices)))))))))))
+ (t
+ (let ((user-point (point)))
+ (save-excursion
+ (goto-char op-start)
+ ;; `arg-index' represents to the number of full sexps that
+ ;; come to the left of the sexp user's point is at.
+ (let ((full-sexps (slime-ensure-list
+ (slime-parse-sexp-at-point arg-index))))
+ (forward-sexp arg-index)
+ (slime-forward-blanks)
+ (assert (<= (point) user-point))
+ (let ((incomplete-sexp
+ (buffer-substring-no-properties (point) user-point)))
+ (if (string= incomplete-sexp "")
+ full-sexps
+ (append full-sexps (list incomplete-sexp)))))))))))))
;; XXX: unused function
(defun slime-cl-symbol-external-ref-p (symbol)
More information about the slime-cvs
mailing list