branch: externals/which-key
commit b11227b24be1c56b31380395f266983e889a7f8d
Author: Henrik Lissner <accou...@v0.io>
Commit: Justin Burkett <jus...@burkett.cc>

    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 de96a49..2adda88 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))))

Reply via email to