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

Contents of /slime/swank-backend.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Sun Nov 23 05:00:13 2003 UTC (10 years, 4 months ago) by lgorrie
Branch: MAIN
* swank-sbcl.lisp (describe-symbol-for-emacs): Don't ask for
(documentation SYM 'class), CLHS says there isn't any 'class
documentation (and SBCL warns).

* swank.lisp, swank-cmucl.lisp, swank-sbcl.lisp: Refactored
interface through swank-backend.lisp for: swank-compile-file,
swank-compile-string, describe-symbol-for-emacs (apropos),
macroexpand-all, arglist-string.

* swank-backend.lisp: New file defining the interface between
swank.lisp and the swank-*.lisp implementation files.
1 lgorrie 1.1 ;;;; -*- Mode: lisp; indent-tabs-mode: nil; outline-regexp: ";;;;;*" -*-
2     ;;;
3     ;;; slime-impl.lisp --- Slime interface reference implementation.
4     ;;;
5     ;;; Copyright (C) 2003, James Bielman <jamesjb@jamesjb.com>
6     ;;; Released into the public domain.
7     ;;;
8     ;;; $Id: swank-backend.lisp,v 1.1 2003/11/23 05:00:13 lgorrie Exp $
9     ;;;
10    
11     ;; This is a skeletal implementation of the Slime internals interface.
12     ;;
13     ;; The idea is to create a de-facto standard interface that can be
14     ;; used by editor <-> CL integration software, such as Slime. Vendors
15     ;; are encouraged to comment on this interface.
16    
17     (defpackage :swank
18     (:use :common-lisp)
19     (:export #:start-server #:create-swank-server
20     #:*sldb-pprint-frames*))
21    
22    
23     (in-package :swank)
24    
25    
26     ;;;; Conditions and Error Handling
27    
28     ;; XXX need to specify restart behavior for errors/warnings?
29    
30     (define-condition not-implemented-error (error)
31     ())
32    
33     (deftype severity () '(member :error :warning :style-warning :note))
34    
35     ;; Base condition type for compiler errors, warnings and notes.
36     (define-condition compiler-condition (condition)
37     ((original-condition
38     ;; The original condition thrown by the compiler if appropriate.
39     ;; May be NIL if a compiler does not report using conditions.
40     :initarg :original-condition
41     :accessor original-condition)
42    
43     (severity
44     :type severity
45     :initarg :severity
46     :accessor severity)
47    
48     (message
49     ;; The error or warning message, must be a non-NIL string.
50     ;; [RFC: Would it be better to obtain the message using a method?]
51     :initarg :message
52     :accessor message)
53    
54     (location
55     :initarg :location
56     :accessor location)))
57    
58    
59     ;;;; Compilation
60    
61     (defgeneric compile-string-for-emacs (string &key buffer position)
62     (:documentation
63     "Compile source from STRING. During compilation, compiler
64     conditions must be trapped and resignalled as COMPILER-CONDITIONs.
65    
66     If supplied, BUFFER and POSITION specify the source location in Emacs.
67    
68     Additionally, if POSITION is supplied, it must be added to source
69     positions reported in compiler conditions."))
70    
71     (defgeneric compile-file-for-emacs (filename load-p)
72     (:documentation
73     "Compile FILENAME signalling COMPILE-CONDITIONs.
74     If LOAD-P is true, load the file after compilation."))
75    
76    
77     ;;;; Documentation
78    
79     (defgeneric arglist-string (function-name)
80     (:documentation
81     "Return the argument for FUNCTION-NAME as a string.
82     The result should begin and end with parenthesis."))
83    
84     (defgeneric macroexpand-all (form)
85     (:documentation
86     "Recursively expand all macros in FORM.
87     Return the resulting form."))
88    
89     (defgeneric describe-symbol-for-emacs (symbol)
90     (:documentation
91     "Return a property list describing SYMBOL.
92    
93     The property list has an entry for each interesting aspect of the
94     symbol. The recognised keys are:
95    
96     :VARIABLE :FUNCTION :SETF :TYPE :CLASS :MACRO :COMPILER-MACRO
97     :ALIEN-TYPE :ALIEN-STRUCT :ALIEN-UNION :ALIEN-ENUM
98    
99     The value of each property is the corresponding documentation string,
100     or :NOT-DOCUMENTED. It is legal to include keys not listed here.
101    
102     Properties should be included if and only if they are applicable to
103     the symbol. For example, only (and all) fbound symbols should include
104     the :FUNCTION property.
105    
106     Example:
107     \(describe-symbol-for-emacs 'vector)
108     => (:CLASS :NOT-DOCUMENTED
109     :TYPE :NOT-DOCUMENTED
110     :FUNCTION \"Constructs a simple-vector from the given objects.\")"))
111    
112    

  ViewVC Help
Powered by ViewVC 1.1.5