Andy Wingo <wi...@pobox.com> writes: > Hi, > > I pushed the following patch to master. Is it OK to push to 1.8 as well? > That way I could drop some modules from guile-lib, and make guile-lib > depend on guile >= 1.8.x.
I have no objection to that. > (Perhaps we can set up a list for patches that get pushed to Guile ?) Not sure I understand... Anything like guile-sources, which we already have? > :use-module (ice-9 rdelim) > - :export (help apropos apropos-internal apropos-fold > - apropos-fold-accessible apropos-fold-exported apropos-fold-all > - source arity system-module)) > + :export (help > + add-value-help-handler! remove-value-help-handler! > + add-name-help-handler! remove-name-help-handler! > + apropos apropos-internal apropos-fold apropos-fold-accessible > + apropos-fold-exported apropos-fold-all source arity > + system-module module-commentary)) Also say something in the commit about exporting module-commentary ? > +`proc' will be called as (PROC NAME VALUE). `proc' should return #t to > +indicate that it has performed help, a string to override the default > +object documentation, or #f to try the other handlers, potentially > +falling back on the normal behavior for `help'." > +The return value of `proc' is as specified in > +`add-value-help-handler!'." I'd prefer to repeat what it said in add-value-help-handler!, so that this doc stands alone. (It would be quite ironic if a procedure for extending the `help' system doesn't have completely useful `help' itself.) > + (set! *name-help-handlers* (cons proc *name-help-handlers*))) > + > +(define (remove-name-help-handler! proc) > + "Removes a handler for performing `help' on a name. > + > +See the documentation for `add-name-help-handler' for more > +information." What is the point of that last sentence? I suspect nothing, so recommend removing it. (And same for remove-value-help-handler!) > - (cond ((object-documentation > - (local-eval (cadr name) env)) > - => write-line) > - (else (not-found 'documentation (cadr name))))) > + (let ((value (local-eval (cadr name) env))) > + (cond ((try-value-help (cadr name) value) > + => noop) > + ((object-documentation value) > + => write-line) > + (else (not-found 'documentation (cadr name)))))) Why noop here? Won't that discard the documentation? Regards, Neil