[slime-devel] Autodoc and partial forms

Ariel Badichi abadichi at bezeqint.net
Fri Sep 14 22:27:39 EDT 2007


Hello,

The autodoc feature is broken for partial forms that are succeeded by
top-level forms.  For example, if the buffer contains the following
text -

(defun

(defun foo (x) (+ x 1))

- and point is after the first defun and before the beginning of the
second defun, no autodoc string will appear in the minibuffer.

The reason for this, essentially, is that slime-inside-string-p calls
slime-region-for-defun-at-point, which calls end-of-defun, which
signals an error.  slime-inside-string-p only needs the position of
the beginning of the defun from slime-region-for-defun-at-point.  I
chose to fix it, however, by changing what the latter does.  If the
end position cannot be determined, nil will be used in its place.

Patch is attached.

Ariel

-------------- next part --------------
RCS file: /project/slime/cvsroot/slime/slime.el,v
retrieving revision 1.860
diff -u -r1.860 slime.el
--- slime.el	14 Sep 2007 13:36:23 -0000	1.860
+++ slime.el	15 Sep 2007 02:04:52 -0000
@@ -9053,13 +9053,16 @@
          (slime-region-for-defun-at-point)))
 
 (defun slime-region-for-defun-at-point ()
-  "Return the start and end position of the toplevel form at point."
+  "Return the start and end position of the toplevel form at
+point.  If the end position cannot be determined, nil will be
+used in its place."
   (save-excursion
     (save-match-data
-      (end-of-defun)
-      (let ((end (point)))
-        (beginning-of-defun)
-        (list (point) end)))))
+      (beginning-of-defun)
+      (list (point)
+            (ignore-errors
+              (end-of-defun)
+              (point))))))
 
 (defun slime-beginning-of-symbol ()
   "Move point to the beginning of the current symbol."


More information about the slime-devel mailing list