From ad8def17059776c8edbbdaac38f3cf13ede39563 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Thu, 23 Apr 2015 15:53:02 +0200 Subject: [PATCH] Match e.g. "C-d C-o" in docstring * hydra.el (hydra--format): Allow space; make the regex non-greedy. Fixes #116 --- hydra.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydra.el b/hydra.el index fdd3847..125bb1c 100644 --- a/hydra.el +++ b/hydra.el @@ -474,7 +474,7 @@ The expressions can be auto-expanded according to NAME." offset) (while (setq start (string-match - "\\(?:%\\( ?-?[0-9]*s?\\)\\(`[a-z-A-Z/0-9]+\\|(\\)\\)\\|\\(?:_\\( ?-?[0-9]*\\)\\([[:alnum:]-~.,;:/|?<>={}*+#]+\\)_\\)" + "\\(?:%\\( ?-?[0-9]*s?\\)\\(`[a-z-A-Z/0-9]+\\|(\\)\\)\\|\\(?:_\\( ?-?[0-9]*\\)\\([[:alnum:] -~.,;:/|?<>={}*+#]+?\\)_\\)" docstring start)) (cond ((eq ?_ (aref (match-string 0 docstring) 0)) (let* ((key (match-string 4 docstring))