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

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

[elpa] externals/hydra 5b8f662992 16/46: hydra.el (hydra--format): Allow


From: Stefan Monnier
Subject: [elpa] externals/hydra 5b8f662992 16/46: hydra.el (hydra--format): Allow e.g. "M-?" in docstring
Date: Tue, 25 Oct 2022 22:27:20 -0400 (EDT)

branch: externals/hydra
commit 5b8f66299249cc771008248279544b8eb3ecdc19
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    hydra.el (hydra--format): Allow e.g. "M-?" in docstring
    
    Fixes #286
---
 hydra.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/hydra.el b/hydra.el
index e9259f138c..e31f217963 100644
--- a/hydra.el
+++ b/hydra.el
@@ -646,17 +646,18 @@ The expressions can be auto-expanded according to NAME."
                     ""
                   (hydra--hint body heads)))
           (start 0)
+          (inner-regex (format "\\(%s\\)\\(%s\\)" hydra-width-spec-regex 
hydra-key-regex))
           varlist
           offset)
       (while (setq start
                    (string-match
                     (format
-                     "\\(?:%%\\( 
?-?[0-9]*s?\\)\\(`[a-z-A-Z/0-9]+\\|(\\)\\)\\|\\(?:[_?]\\(%s\\)\\(%s\\)[_?]\\)"
-                     hydra-width-spec-regex
-                     hydra-key-regex)
+                     "\\(?:%%\\( 
?-?[0-9]*s?\\)\\(`[a-z-A-Z/0-9]+\\|(\\)\\)\\|\\(?:_%s_\\)\\|\\(?:[?]%s[?]\\)"
+                     inner-regex
+                     inner-regex)
                     docstring start))
         (cond ((eq ?? (aref (match-string 0 docstring) 0))
-               (let* ((key (match-string 4 docstring))
+               (let* ((key (match-string 6 docstring))
                       (head (assoc key heads)))
                  (if head
                      (progn



reply via email to

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