[slime-cvs] CVS slime

CVS User sboukarev sboukarev at common-lisp.net
Sat Oct 20 05:50:38 UTC 2012


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

Modified Files:
	ChangeLog slime.el 
Log Message:
* slime.el (slime-location-offset): When going to a position
causes an error, for example, trying to move beyond the end of the
buffer, move the point to 0 and then try to use the hints.


--- /project/slime/cvsroot/slime/ChangeLog	2012/10/14 12:57:42	1.2355
+++ /project/slime/cvsroot/slime/ChangeLog	2012/10/20 05:50:37	1.2356
@@ -1,3 +1,9 @@
+2012-10-20  Stas Boukarev  <stassats at gmail.com>
+
+	* slime.el (slime-location-offset): When going to a position
+	causes an error, for example, trying to move beyond the end of the
+	buffer, move the point to 0 and then try to use the hints.
+
 2012-10-14  Helmut Eller  <heller at common-lisp.net>
 
 	* slime.el (slime-insert-threads): Some cleanups.
--- /project/slime/cvsroot/slime/slime.el	2012/10/14 12:57:42	1.1415
+++ /project/slime/cvsroot/slime/slime.el	2012/10/20 05:50:38	1.1416
@@ -3434,7 +3434,7 @@
 are supported:
 
 <location> ::= (:location <buffer> <position> <hints>)
-             | (:error <message>) 
+             | (:error <message>)
 
 <buffer>   ::= (:file <filename>)
              | (:buffer <buffername>)
@@ -3446,7 +3446,7 @@
              | (:offset <start> <offset>) ; start+offset (for C-c C-c)
              | (:line <line> [<column>])
              | (:function-name <string>)
-             | (:source-path <list> <start-position>) 
+             | (:source-path <list> <start-position>)
              | (:method <name string> <specializers> . <qualifiers>)"
   (destructure-case location
     ((:location buffer _position _hints)
@@ -3465,19 +3465,22 @@
 (defun slime-location-offset (location)
   "Return the position, as character number, of LOCATION."
   (save-restriction
-    (widen)
-    (slime-goto-location-position (slime-location.position location))
-    (let ((hints (slime-location.hints location)))
-      (when-let (snippet (getf hints :snippet))
-        (slime-isearch snippet))
-      (when-let (snippet (getf hints :edit-path))
-        (slime-search-edit-path snippet))
-      (when-let (fname (getf hints :call-site))
-        (slime-search-call-site fname))
-      (when (getf hints :align)
-        (slime-forward-sexp)
-        (beginning-of-sexp)))
-    (point)))
+   (widen)
+   (condition-case nil
+                   (slime-goto-location-position
+                    (slime-location.position location))
+                   (error (goto-char 0)))
+   (let ((hints (slime-location.hints location)))
+     (when-let (snippet (getf hints :snippet))
+       (slime-isearch snippet))
+     (when-let (snippet (getf hints :edit-path))
+       (slime-search-edit-path snippet))
+     (when-let (fname (getf hints :call-site))
+       (slime-search-call-site fname))
+     (when (getf hints :align)
+       (slime-forward-sexp)
+       (beginning-of-sexp)))
+   (point)))
 
 
 ;;;;; Incremental search





More information about the slime-cvs mailing list