aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Lissner2019-12-25 20:27:17 -0500
committerGitHub2019-12-25 20:27:17 -0500
commit0d0af8a0a291aec409992bfcdae06dc36e2634b4 (patch)
treeb74598f9ef987020ac6eb01479e4995a10d3ee9f
parent1e3640e48c31f8062f018b5fc84acad696a0ea2a (diff)
downloademacs-0d0af8a0a291aec409992bfcdae06dc36e2634b4.tar.gz
emacs-0d0af8a0a291aec409992bfcdae06dc36e2634b4.zip
Strip out advice in command docstrings
-rw-r--r--which-key.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/which-key.el b/which-key.el
index 1da0cfb019e..74de73741ea 100644
--- a/which-key.el
+++ b/which-key.el
@@ -1671,7 +1671,12 @@ and `which-key-show-docstrings' is non-nil. If
1671return the docstring." 1671return the docstring."
1672 (let* ((orig-sym (intern original)) 1672 (let* ((orig-sym (intern original))
1673 (doc (when (commandp orig-sym) 1673 (doc (when (commandp orig-sym)
1674 (documentation orig-sym))) 1674 (string-trim-left
1675 (documentation orig-sym)
1676 (concat "\\(?::"
1677 "\\(?:\\(?:after\\|before\\)\\(?:-\\(?:until\\|while\\)\\)?\\|around\\|override\\|filter-\\(?:args\\|return\\)\\)"
1678 " advice: [^\n]+\n"
1679 "\\)+\n"))))
1675 (docstring (when doc 1680 (docstring (when doc
1676 (which-key--propertize (car (split-string doc "\n")) 1681 (which-key--propertize (car (split-string doc "\n"))
1677 'face 'which-key-docstring-face)))) 1682 'face 'which-key-docstring-face))))