emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/which-key 9d1de2f 20/51: Refactor regexp & fix incompat


From: Stefan Monnier
Subject: [elpa] externals/which-key 9d1de2f 20/51: Refactor regexp & fix incompatibility + error
Date: Tue, 8 Sep 2020 10:26:17 -0400 (EDT)

branch: externals/which-key
commit 9d1de2f1273135cafc567e7ae43a3f6ca8f32f6b
Author: Henrik Lissner <accounts@v0.io>
Commit: GitHub <noreply@github.com>

    Refactor regexp & fix incompatibility + error
---
 which-key.el | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/which-key.el b/which-key.el
index 74de737..c8029b7 100644
--- a/which-key.el
+++ b/which-key.el
@@ -1671,12 +1671,17 @@ and `which-key-show-docstrings' is non-nil. If
 return the docstring."
   (let* ((orig-sym (intern original))
          (doc (when (commandp orig-sym)
-                (string-trim-left
-                 (documentation orig-sym)
-                 (concat "\\(?::"
-                         
"\\(?:\\(?:after\\|before\\)\\(?:-\\(?:until\\|while\\)\\)?\\|around\\|override\\|filter-\\(?:args\\|return\\)\\)"
+                (documentation orig-sym)))
+         (doc (when doc
+                (replace-regexp-in-string
+                 (concat "^\\(?::"
+                         (regexp-opt '("around" "override"
+                                       "after" "after-until" "after-while"
+                                       "before" "before-until" "before-while"
+                                       "filter-args" "filter-return"))
                          " advice: [^\n]+\n"
-                         "\\)+\n"))))
+                         "\\)+\n")
+                 "" doc)))
          (docstring (when doc
                       (which-key--propertize (car (split-string doc "\n"))
                                              'face 
'which-key-docstring-face))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]