On Fri, Nov 22, 2019 at 10:45 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> And if it's just t it could always return a pair.
> Sounds good.

Please take a look.

The patches do not include info changes, because help-split-fundoc is not
documented. Should this change, once accepted, be mentioned in NEWS?

BTW, other than the discussed new feature, I've added the following tiny,
sort of incompatible change:

 Before:
- DEF = non-symbol => usage = "(anonymous ARGS...)"
- DEF = symbol s => usage = "(s ARGS...)"

Now:
- DEF = non-symbol OR nil => "(anonymous ARGS...)"
- DEF = other symbol s => "(s ARGS...)"

When callers are not interested in the usage they can already pass a
non-symbol, like "" or 0, but perusing the sources, 3 out of 14 uses of
help-split-fundoc pass nil, and none of them passes a non-symbol.

Treating nil like "don't care" saves two function calls over the current
code (which passes nil through help--docstring-quote), and DEF is
documented as "the function whose usage we're looking for", so
nil = "don't care" makes more sense than "" or 0.

I can revert this part of the patch (is a one-liner), if you're worried
about the incompatibility.