branch: externals/which-key
commit 0d0af8a0a291aec409992bfcdae06dc36e2634b4
Author: Henrik Lissner <[email protected]>
Commit: GitHub <[email protected]>
Strip out advice in command docstrings
---
which-key.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/which-key.el b/which-key.el
index 1da0cfb..74de737 100644
--- a/which-key.el
+++ b/which-key.el
@@ -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))))