GNU bug report logs -
#76528
30; Advising functions can cause docstring to be lost
Previous Next
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> Stefan, any comments?
>
> Just that it's directly related to this part of the code in
> `nadvice.el`:
>
> ;; FIXME: We could use a defmethod on `function-documentation' instead,
> ;; except when (autoloadp nf)!
> (put symbol 'function-documentation `(advice--make-docstring ',symbol))
Transient (transient--wrap-command) has to advise every command that is
invoked while the menu is active, so this has the potential to cause a
lot of damage. How should I deal with that? Maybe essentially?:
(let ((docstr (documentation this-command))
(advice (lambda (fn &rest args) (apply fn args))))
(advice-add this-command :around advice)
(advice-remove this-command advice)
(unless (equal (documentation this-command) docstr)
(put this-command 'function-documentation docstr)))
This bug report was last modified 110 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.