diff --git a/src/CHANGELOG b/src/CHANGELOG index 52e0bb9e0..07449cdd3 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -45,6 +45,8 @@ ECL 0.9f - Setting the property lists of the symbol NIL no longer breaks ECL. + - Fixed (documentation) and (setf documentation) behaviour. (M. Pasternacki) + * Compiler errors: - In compiled code, discarded (VALUES ...) forms did not trigger all the diff --git a/src/clos/inspect.lsp b/src/clos/inspect.lsp index 4b7c59b52..64c6b91f7 100644 --- a/src/clos/inspect.lsp +++ b/src/clos/inspect.lsp @@ -458,8 +458,8 @@ q (or Q): quits the inspection.~%~ (function (if (fboundp object) (let ((c (fdefinition object))) - (si::set-documentation object 'function nil) - (setf (documentation object 'function) new-value)) + (si::set-documentation c 'function nil) + (setf (documentation c 'function) new-value)) (si::set-documentation object doc-type new-value))) (otherwise (si::set-documentation object doc-type new-value)))) @@ -515,3 +515,10 @@ q (or Q): quits the inspection.~%~ (when (member doc-type '(t function)) (setf (slot-value object 'documentation) new-value))) +(defmethod documentation ((object function) doc-type) + (when (member doc-type '(t function)) + (si::get-documentation object doc-type))) + +(defmethod (setf documentation) (new-value (object function) doc-type) + (when (member doc-type '(t function)) + (si::set-documentation object doc-type new-value))) diff --git a/src/lsp/helpfile.lsp b/src/lsp/helpfile.lsp index b38353689..65bb9636b 100644 --- a/src/lsp/helpfile.lsp +++ b/src/lsp/helpfile.lsp @@ -122,8 +122,14 @@ the help file." (when (and (setq output (gethash object dict)) (setq output (getf output doc-type))) (return-from get-documentation output))) - ((and (symbolp object) (stringp dict)) - (when (and (setq output (search-help-file object dict)) + ((and (stringp dict) + (or (symbolp object) + (functionp object))) + (when (and (setq output (search-help-file + (if (functionp object) + (compiled-function-name object) + object) + dict)) (setq output (getf output doc-type))) (return-from get-documentation output))))))