GNU bug report logs -
#76528
30; Advising functions can cause docstring to be lost
Previous Next
Full log
View this message in rfc822 format
> That sounds about right, tho you'd have to replace the `(documentation
> this-command)` with `(get this-command 'function-documentation)`.
I've decided to instead of destroying and resurrecting the doc-string,
I'm just not gonna destroy it. ;P
I.e., to switch from advice-add to add-function. I had somehow
convinced myself before that this does not work, but I must have
been holding it wrong.
(I still have to test it a bit more before pushing to main.)
This also (and really more importantly) helps with:
> Somewhat related question: can it happen that the command (stored in
> `this-command`, apparently) is not a symbol, and if so how do you
> wrap it?
It cannot happen for suffixes, those are always accessed via symbols.
But some menus do not disallow invocation of non-suffixes (commands
bound in other active keymaps). If such a command is not accessed via
a symbol, then it wasn't properly wrapped before. This could in rare
cases lead to a menu getting "stuck", which, while unfortunate, was easy
to fix (just invoke any menu). Of course its better if this can never
happen, and I believe that by switching to add-function I have achieves
that.
Cheers,
Jonas
This bug report was last modified 109 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.