diff --git a/src/clos/inspect.lsp b/src/clos/inspect.lsp index 8cb949499..ff912a853 100644 --- a/src/clos/inspect.lsp +++ b/src/clos/inspect.lsp @@ -409,13 +409,11 @@ q (or Q): quits the inspection.~%~ (setf (documentation (class-name object) 'structure) new-value))) (defmethod documentation ((object list) doc-type) - (when (and (si::valid-function-name-p object) - (member doc-type '(function compiler-macro))) + (when (member doc-type '(function compiler-macro)) (si::get-documentation object doc-type))) (defmethod (setf documentation) (new-value (object list) doc-type) - (when (and (si::valid-function-name-p object) - (member doc-type '(function compiler-macro))) + (when (member doc-type '(function compiler-macro)) (si::set-documentation object doc-type new-value))) (defmethod documentation ((object standard-generic-function) doc-type) diff --git a/src/lsp/helpfile.lsp b/src/lsp/helpfile.lsp index 761e41500..7eb920512 100644 --- a/src/lsp/helpfile.lsp +++ b/src/lsp/helpfile.lsp @@ -182,14 +182,21 @@ the help file." (when (functionp object) (when (null (setq object (compiled-function-name object))) (return-from get-documentation nil))) - (get-annotation object 'documentation doc-type)) + (if (and object (listp object) (si::valid-function-name-p object)) + (get-annotation (second object) 'setf-documentation doc-type) + (get-annotation object 'documentation doc-type))) (defun set-documentation (object doc-type string) (when (not (or (stringp string) (null string))) (error "~S is not a valid documentation string" string)) - (if string - (annotate object 'documentation doc-type string) - (remove-annotation object 'documentation doc-type)) + (when (consp object) + (print (list object doc-type string))) + (let ((key 'documentation)) + (when (and object (listp object) (si::valid-function-name-p object)) + (setq object (second object) key 'setf-documentation)) + (if string + (annotate object key doc-type string) + (remove-annotation object key doc-type))) string) (defun expand-set-documentation (symbol doc-type string) @@ -226,7 +233,8 @@ strings." (let* ((kind (first definition)) (name (second definition))) ;(print (list name kind source-location)) - (annotate name 'location kind source-location) + (when (not (member kind '(defmethod))) + (annotate name 'location kind source-location)) (when (member kind '(defun defmacro defgeneric)) (annotate name 'arglist nil (third definition)))) output-form))