/[slime]/slime/swank-clisp.lisp
ViewVC logotype

Diff of /slime/swank-clisp.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.70 by heller, Sun Aug 3 18:23:10 2008 UTC revision 1.71 by heller, Mon Aug 4 20:25:50 2008 UTC
# Line 212  Return NIL if the symbol is unbound." Line 212  Return NIL if the symbol is unbound."
212      (:function (describe (symbol-function symbol)))      (:function (describe (symbol-function symbol)))
213      (:class (describe (find-class symbol)))))      (:class (describe (find-class symbol)))))
214    
215  (defun fspec-pathname (symbol)  (defun fspec-pathname (spec)
216    (let ((path (documentation symbol 'sys::file))    (let ((path spec)
217            type
218          lines)          lines)
219      (when (consp path)      (when (consp path)
220        (psetq path (car path)        (psetq type (car path)
221               lines (cdr path)))               path (cadr path)
222                 lines (cddr path)))
223      (when (and path      (when (and path
224                 (member (pathname-type path)                 (member (pathname-type path)
225                         custom:*compiled-file-types* :test #'equal))                         custom:*compiled-file-types* :test #'equal))
# Line 225  Return NIL if the symbol is unbound." Line 227  Return NIL if the symbol is unbound."
227              (loop for suffix in custom:*source-file-types*              (loop for suffix in custom:*source-file-types*
228                 thereis (probe-file (make-pathname :defaults path                 thereis (probe-file (make-pathname :defaults path
229                                                    :type suffix)))))                                                    :type suffix)))))
230      (values path lines)))      (values path type lines)))
231    
232  (defun fspec-location (fspec)  (defun fspec-location (name fspec)
233    (multiple-value-bind (file lines)    (multiple-value-bind (file type lines)
234        (fspec-pathname fspec)        (fspec-pathname fspec)
235      (cond (file      (list (if type (list name type) name)
236             (multiple-value-bind (truename c) (ignore-errors (truename file))            (cond (file
237               (cond (truename                   (multiple-value-bind (truename c) (ignore-errors (truename file))
238                      (make-location (list :file (namestring truename))                     (cond (truename
239                                     (if (consp lines)                            (make-location (list :file (namestring truename))
240                                         (list* :line lines)                                           (if (consp lines)
241                                         (list :function-name (string fspec)))))                                               (list* :line lines)
242                     (t (list :error (princ-to-string c))))))                                               (list :function-name (string fspec)))
243            (t (list :error (format nil "No source information available for: ~S"                                           (list :snippet (format nil "~A" type))))
244                                    fspec))))))                           (t (list :error (princ-to-string c))))))
245                    (t (list :error (format nil "No source information available for: ~S"
246                                            fspec)))))))
247    
248  (defimplementation find-definitions (name)  (defimplementation find-definitions (name)
249    (list (list name (fspec-location name))))    (mapcar #'(lambda (e) (fspec-location name e)) (documentation name 'sys::file)))
250    
251  (defun trim-whitespace (string)  (defun trim-whitespace (string)
252    (string-trim #(#\newline #\space #\tab) string))    (string-trim #(#\newline #\space #\tab) string))
# Line 573  Execute BODY with NAME's function slot s Line 577  Execute BODY with NAME's function slot s
577            (load fasl-file))            (load fasl-file))
578          nil))))          nil))))
579    
580  (defimplementation swank-compile-string (string &key buffer position directory  (defimplementation swank-compile-string (string &key buffer position directory)
581                                                  debug)    (declare (ignore directory))
   (declare (ignore directory debug))  
582    (with-compilation-hooks ()    (with-compilation-hooks ()
583      (let ((*buffer-name* buffer)      (let ((*buffer-name* buffer)
584            (*buffer-offset* position))            (*buffer-offset* position))
# Line 600  Execute BODY with NAME's function slot s Line 603  Execute BODY with NAME's function slot s
603  (defun xref-results (symbols)  (defun xref-results (symbols)
604    (let ((xrefs '()))    (let ((xrefs '()))
605      (dolist (symbol symbols)      (dolist (symbol symbols)
606        (push (list symbol (fspec-location symbol)) xrefs))        (push (fspec-location symbol symbol) xrefs))
607      xrefs))      xrefs))
608    
609  (when (find-package :swank-loader)  (when (find-package :swank-loader)

Legend:
Removed from v.1.70  
changed lines
  Added in v.1.71

  ViewVC Help
Powered by ViewVC 1.1.5