1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-24 00:40:35 -08:00

Strip out advice in command docstrings

This commit is contained in:
Henrik Lissner 2019-12-25 20:27:17 -05:00 committed by GitHub
parent 1e3640e48c
commit 0d0af8a0a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1671,7 +1671,12 @@ and `which-key-show-docstrings' is non-nil. If
return the docstring."
(let* ((orig-sym (intern original))
(doc (when (commandp orig-sym)
(documentation orig-sym)))
(string-trim-left
(documentation orig-sym)
(concat "\\(?::"
"\\(?:\\(?:after\\|before\\)\\(?:-\\(?:until\\|while\\)\\)?\\|around\\|override\\|filter-\\(?:args\\|return\\)\\)"
" advice: [^\n]+\n"
"\\)+\n"))))
(docstring (when doc
(which-key--propertize (car (split-string doc "\n"))
'face 'which-key-docstring-face))))