branch: elpa/slime
commit dc9b85c68623875dc89283576e704b020682a92c
Author: Stas Boukarev <[email protected]>
Commit: Stas Boukarev <[email protected]>
Differentiate accessors when describing symbols.
---
contrib/swank-util.lisp | 7 ++++---
swank/backend.lisp | 5 +++++
swank/sbcl.lisp | 4 ++++
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/contrib/swank-util.lisp b/contrib/swank-util.lisp
index 72743ba1dd..ff49abfe49 100644
--- a/contrib/swank-util.lisp
+++ b/contrib/swank-util.lisp
@@ -41,9 +41,9 @@ keywords: :BOUNDP, :FBOUNDP, :CONSTANT, :GENERIC-FUNCTION,
(defun symbol-classification-string (symbol)
"Return a string in the form -f-c---- where each letter stands for
-boundp fboundp generic-function class macro special-operator package"
- (let ((letters "bfgctmsp")
- (result (copy-seq "--------")))
+boundp fboundp generic-function class macro special-operator package accessor"
+ (let ((letters "bfgctmspa")
+ (result (copy-seq "---------")))
(flet ((flip (letter)
(setf (char result (position letter letters))
letter)))
@@ -58,6 +58,7 @@ boundp fboundp generic-function class macro special-operator
package"
(when (macro-function symbol) (flip #\m))
(when (special-operator-p symbol) (flip #\s))
(when (find-package symbol) (flip #\p))
+ (when (structure-accessor-p symbol) (flip #\a))
result)))
(provide :swank-util)
diff --git a/swank/backend.lisp b/swank/backend.lisp
index 2e7668b304..6d541bd5ec 100644
--- a/swank/backend.lisp
+++ b/swank/backend.lisp
@@ -1589,3 +1589,8 @@ Implementations intercept calls to SPEC and call, in this
order:
(definterface augment-features ()
"*features* or something else "
*features*)
+
+(definterface structure-accessor-p (symbol)
+ "Does SYMBOL name a structure accessor?"
+ (declare (ignore symbol))
+ nil)
diff --git a/swank/sbcl.lisp b/swank/sbcl.lisp
index 8870ecb6f8..0e4d0f0525 100644
--- a/swank/sbcl.lisp
+++ b/swank/sbcl.lisp
@@ -2032,3 +2032,7 @@ stack."
(defimplementation augment-features ()
(append *features* #+sb-devel sb-impl:+internal-features+))
+
+(defimplementation structure-accessor-p (symbol)
+ #+#.(swank/backend:with-symbol 'structure-instance-accessor-p 'sb-kernel)
+ (sb-kernel:structure-instance-accessor-p symbol))