[slime-cvs] CVS update: slime/swank-backend.lisp slime/swank-cmucl.lisp slime/swank-sbcl.lisp slime/swank-openmcl.lisp slime/swank-lispworks.lisp slime/swank-allegro.lisp
Helmut Eller
heller at common-lisp.net
Sun Dec 7 19:16:24 UTC 2003
Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv30642
Modified Files:
swank-backend.lisp swank-cmucl.lisp swank-sbcl.lisp
swank-openmcl.lisp swank-lispworks.lisp swank-allegro.lisp
Log Message:
(function-source-locations): Is replaces
function-source-location-for-emacs. Make it at generic function.
(function-source-location-for-emacs): Remove.
Date: Sun Dec 7 14:16:24 2003
Author: heller
Index: slime/swank-backend.lisp
diff -u slime/swank-backend.lisp:1.6 slime/swank-backend.lisp:1.7
--- slime/swank-backend.lisp:1.6 Sat Nov 29 17:12:42 2003
+++ slime/swank-backend.lisp Sun Dec 7 14:16:24 2003
@@ -5,7 +5,7 @@
;;; Copyright (C) 2003, James Bielman <jamesjb at jamesjb.com>
;;; Released into the public domain.
;;;
-;;; $Id: swank-backend.lisp,v 1.6 2003/11/29 22:12:42 dbarlow Exp $
+;;; $Id: swank-backend.lisp,v 1.7 2003/12/07 19:16:24 heller Exp $
;;;
;; This is a skeletal implementation of the Slime internals interface.
@@ -58,7 +58,7 @@
#:swank-macroexpand-1
#:untrace-all
#:toggle-trace-fdefinition
- #:function-source-location-for-emacs
+ #:find-function-locations
#:who-binds
#:who-references
#:who-calls
@@ -281,9 +281,43 @@
;;;; Queries
-(defgeneric function-source-location-for-emacs (function-name)
+#+(or)
+;;; This is probably a better interface than find-function-locations.
+(defgeneric find-definitions (name)
(:documentation
- "Return the canonical source location FUNCTION-NAME.
+ "Return a list of (LABEL . LOCATION) pairs for NAME's definitions.
-FIXME: Document the plethora of valid return types."))
+NAME is string denoting a symbol or \"definition specifier\".
+
+LABEL is a string describing the definition, e.g., \"foo\" or
+\"(method foo (string number))\" or \"(variable bar)\".
+
+LOCATION is a source location of the form:
+
+<location> ::= (:location <buffer> <position>)
+ | (:error <message>)
+
+<buffer> ::= (:file <filename>)
+ | (:buffer <buffername>)
+ | (:source-form <string>)
+
+<position> ::= (:position <fixnum> [<align>]) ; 1 based
+ | (:function-name <string>)
+"))
+
+(defgeneric find-function-locations (name)
+ (:documentation
+ "Return a list (LOCATION LOCATION ...) for NAME's definitions.
+
+LOCATION is a source location of the form:
+
+<location> ::= (:location <buffer> <position>)
+ | (:error <message>)
+
+<buffer> ::= (:file <filename>)
+ | (:buffer <buffername>)
+ | (:source-form <string>)
+
+<position> ::= (:position <fixnum> [<align>]) ; 1 based
+ | (:function-name <string>)"))
Index: slime/swank-cmucl.lisp
diff -u slime/swank-cmucl.lisp:1.33 slime/swank-cmucl.lisp:1.34
--- slime/swank-cmucl.lisp:1.33 Thu Dec 4 16:33:27 2003
+++ slime/swank-cmucl.lisp Sun Dec 7 14:16:24 2003
@@ -670,7 +670,7 @@
(destructuring-bind (first) (function-source-locations function)
first))
-(defslimefun find-function-locations (symbol-name)
+(defmethod find-function-locations (symbol-name)
"Return a list of source-locations for SYMBOL-NAME's functions."
(multiple-value-bind (symbol foundp) (find-symbol-designator symbol-name)
(cond ((not foundp)
Index: slime/swank-sbcl.lisp
diff -u slime/swank-sbcl.lisp:1.37 slime/swank-sbcl.lisp:1.38
--- slime/swank-sbcl.lisp:1.37 Sat Dec 6 03:42:54 2003
+++ slime/swank-sbcl.lisp Sun Dec 7 14:16:24 2003
@@ -313,8 +313,7 @@
(or (and name (string name))
(sb-kernel:%fun-name function)))))))))
-(defslimefun find-function-locations (fname-string)
- "Return a list of source-locations of FNAME's definitions."
+(defmethod find-function-locations (fname-string)
(let* ((symbol (from-string fname-string)))
(labels ((finder (fun)
(cond ((and (symbolp fun) (macro-function fun))
Index: slime/swank-openmcl.lisp
diff -u slime/swank-openmcl.lisp:1.27 slime/swank-openmcl.lisp:1.28
--- slime/swank-openmcl.lisp:1.27 Mon Dec 1 17:30:26 2003
+++ slime/swank-openmcl.lisp Sun Dec 7 14:16:24 2003
@@ -13,7 +13,7 @@
;;; The LLGPL is also available online at
;;; http://opensource.franz.com/preamble.html
;;;
-;;; $Id: swank-openmcl.lisp,v 1.27 2003/12/01 22:30:26 heller Exp $
+;;; $Id: swank-openmcl.lisp,v 1.28 2003/12/07 19:16:24 heller Exp $
;;;
;;;
@@ -412,13 +412,7 @@
(defslimefun-unimplemented find-fdefinition (symbol-name package-name))
-(defslimefun function-source-location-for-emacs (fname)
- "Return a source position of the definition of FNAME. The
-precise location of the definition is not available, but we are
-able to return the file name in which the definition occurs."
- (function-source-location (from-string fname)))
-
-(defslimefun find-function-locations (fname)
+(defmethod find-function-locations (fname)
(let* ((symbol (from-string fname))
(symbol-name (string symbol))
(info (ccl::source-file-or-files symbol nil nil nil))
Index: slime/swank-lispworks.lisp
diff -u slime/swank-lispworks.lisp:1.6 slime/swank-lispworks.lisp:1.7
--- slime/swank-lispworks.lisp:1.6 Thu Dec 4 02:42:22 2003
+++ slime/swank-lispworks.lisp Sun Dec 7 14:16:24 2003
@@ -7,7 +7,7 @@
;;; This code has been placed in the Public Domain. All warranties
;;; are disclaimed.
;;;
-;;; $Id: swank-lispworks.lisp,v 1.6 2003/12/04 07:42:22 heller Exp $
+;;; $Id: swank-lispworks.lisp,v 1.7 2003/12/07 19:16:24 heller Exp $
;;;
(in-package :swank)
@@ -253,13 +253,7 @@
(loop for (dspec location) in locations
collect (make-dspec-location dspec location))))))
-(defmethod function-source-location-for-emacs (fname)
- "Return a source position of the definition of FNAME. The
-precise location of the definition is not available, but we are
-able to return the file name in which the definition occurs."
- (dspec-source-location (from-string fname)))
-
-(defslimefun find-function-locations (fname)
+(defmethod find-function-locations (fname)
(dspec-source-locations (from-string fname)))
;;; Tracing
@@ -269,7 +263,6 @@
(defslimefun toggle-trace-fdefinition (fname-string)
(let ((fname (from-string fname-string)))
- ;;(print `(got ,fname-string and ,fname))
(cond ((tracedp fname)
(compiler::ensure-untrace-1 (list fname))
(format nil "~S is now untraced." fname))
Index: slime/swank-allegro.lisp
diff -u slime/swank-allegro.lisp:1.1 slime/swank-allegro.lisp:1.2
--- slime/swank-allegro.lisp:1.1 Sat Dec 6 08:13:57 2003
+++ slime/swank-allegro.lisp Sun Dec 7 14:16:24 2003
@@ -7,7 +7,7 @@
;;; This code has been placed in the Public Domain. All warranties
;;; are disclaimed.
;;;
-;;; $Id: swank-allegro.lisp,v 1.1 2003/12/06 13:13:57 heller Exp $
+;;; $Id: swank-allegro.lisp,v 1.2 2003/12/07 19:16:24 heller Exp $
;;;
;;; This code was written for
;;; Allegro CL Trial Edition "5.0 [Linux/X86] (8/29/98 10:57)"
@@ -173,8 +173,7 @@
(nth index *sldb-restarts*))
(defslimefun invoke-nth-restart (index)
- (let ((restart (nth-restart index)))
- (invoke-restart restart)))
+ (invoke-restart-interactively (nth-restart index)))
(defmethod frame-locals (index)
(let ((frame (nth-frame index)))
@@ -254,7 +253,7 @@
)))
locations)))
-(defslimefun find-function-locations (symbol-name)
+(defmethod find-function-locations (symbol-name)
(multiple-value-bind (symbol foundp) (find-symbol-designator symbol-name)
(cond ((not foundp)
(list (list :error (format nil "Unkown symbol: ~A" symbol-name))))
More information about the slime-cvs
mailing list