[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 1601991 07/24: Fix the regex once more and add test
From: |
Oleh Krehel |
Subject: |
[elpa] master 1601991 07/24: Fix the regex once more and add test |
Date: |
Fri, 01 May 2015 14:27:11 +0000 |
branch: master
commit 1601991a72c48eefd0ffef3a4ba327df8b7c9cf8
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Fix the regex once more and add test
* hydra.el (hydra--format): Update.
* hydra-test.el (hydra-format-5): Add test.
Fixes #117
---
hydra-test.el | 13 +++++++++++++
hydra.el | 2 +-
2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/hydra-test.el b/hydra-test.el
index ea416af..1c1ab2b 100644
--- a/hydra-test.el
+++ b/hydra-test.el
@@ -1045,6 +1045,19 @@ _f_ auto-fill-mode: %`auto-fill-function
#("j" 0 1 (face hydra-face-blue))
#("k" 0 1 (face hydra-face-blue))) ""))))
+(ert-deftest hydra-format-5 ()
+ (should
+ (equal (hydra--format
+ nil nil "\n_-_: mark _u_: unmark\n"
+ '(("-" Buffer-menu-mark)
+ ("u" Buffer-menu-unmark)))
+ '(concat
+ (format
+ "%s: mark %s: unmark\n"
+ #("-" 0 1 (face hydra-face-red))
+ #("u" 0 1 (face hydra-face-red)))
+ ""))))
+
(ert-deftest hydra-format-with-sexp-1 ()
(should (equal
(let ((hydra-fontify-head-function
diff --git a/hydra.el b/hydra.el
index 3b3dda2..bd5640c 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))
- [elpa] master updated (d183352 -> fddedd2), Oleh Krehel, 2015/05/01
- [elpa] master 8ded725 01/24: hydra.el (hydra--input-method-function): Move before first use, Oleh Krehel, 2015/05/01
- [elpa] master 8be0bff 02/24: hydra-examples.el: Add a defvar, Oleh Krehel, 2015/05/01
- [elpa] master 192c5b0 03/24: Allow heads to conditionally exit, Oleh Krehel, 2015/05/01
- [elpa] master ad8def1 04/24: Match e.g. "C-d C-o" in docstring, Oleh Krehel, 2015/05/01
- [elpa] master f472834 05/24: hydra.el (hydra--format): Be non-greedy with width spec, Oleh Krehel, 2015/05/01
- [elpa] master 0b1b966 06/24: hydra.el (hydra-face-teal): Fixup doc, Oleh Krehel, 2015/05/01
- [elpa] master 1601991 07/24: Fix the regex once more and add test,
Oleh Krehel <=
- [elpa] master c43e1cf 08/24: Add `lv-delete-window' function, Oleh Krehel, 2015/05/01
- [elpa] master b9d0687 09/24: Update `outline-regexp' and `indent-tabs-mode' file locals, Oleh Krehel, 2015/05/01
- [elpa] master 01248b1 10/24: Use one less ; for local vars, Oleh Krehel, 2015/05/01
- [elpa] master 00d2c0c 11/24: Add lv-force-update, Oleh Krehel, 2015/05/01
- [elpa] master 824f105 12/24: Optionally separate lv window and echo area using a thin line, Oleh Krehel, 2015/05/01
- [elpa] master dd02b16 13/24: .dir-locals.el: Add, Oleh Krehel, 2015/05/01
- [elpa] master bf48e63 14/24: lv.el (lv-force-update): Be nil by default, Oleh Krehel, 2015/05/01
- [elpa] master 0ae560a 15/24: lv.el (lv-message): Use `lv-use-separator', Oleh Krehel, 2015/05/01
- [elpa] master 270c38b 16/24: Add a work-around for pop-to-buffer / dedicated bug, Oleh Krehel, 2015/05/01
- [elpa] master 8db62bf 17/24: Make *LV* window fixed size, Oleh Krehel, 2015/05/01