[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hydra 16fa8d109e 24/35: hydra.el (defhydra): Use "__" i
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hydra 16fa8d109e 24/35: hydra.el (defhydra): Use "__" in docstring to represent a literal "_" |
Date: |
Tue, 25 Oct 2022 22:59:06 -0400 (EDT) |
branch: externals/hydra
commit 16fa8d109ec5799931a793b2e866ea9d593bee84
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
hydra.el (defhydra): Use "__" in docstring to represent a literal "_"
* hydra-test.el (hydra-format-11): Add test.
Fixes #366
---
hydra-test.el | 9 +++++++++
hydra.el | 7 +++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/hydra-test.el b/hydra-test.el
index 2019c51801..f3c77ca57e 100644
--- a/hydra-test.el
+++ b/hydra-test.el
@@ -1219,6 +1219,15 @@ _f_ auto-fill-mode: %`auto-fill-function
", ")
"."))))
+(ert-deftest hydra-format-11 ()
+ (should
+ (equal
+ (hydra--format nil '(nil nil :hint nil) "\n_f_ #+begin__src/#+end__src"
+ '(("f" forward-char nil :exit nil)))
+ '(format
+ "%s #+begin_src/#+end_src"
+ #("f" 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 29b790e4d1..48d71a2d40 100644
--- a/hydra.el
+++ b/hydra.el
@@ -716,11 +716,14 @@ The expressions can be auto-expanded according to NAME."
(while (setq start
(string-match
(format
- "\\(?:%%\\(
?-?[0-9]*s?\\)\\(`[a-z-A-Z/0-9]+\\|(\\)\\)\\|\\(?:_%s_\\)\\|\\(?:[?]%s[?]\\)"
+ "\\(?:%%\\(
?-?[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))
+ (cond ((string= "__" (match-string 0 docstring))
+ (setq docstring (replace-match "_" nil t docstring))
+ (setq start (1- (match-end 0))))
+ ((eq ?? (aref (match-string 0 docstring) 0))
(let* ((key (match-string 6 docstring))
(head (assoc key heads)))
(if head
- [elpa] externals/hydra 9936d1c6a8 09/35: lv.el (lv-window): Set tab-line-format to nil, (continued)
- [elpa] externals/hydra 9936d1c6a8 09/35: lv.el (lv-window): Set tab-line-format to nil, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 5e29ad0092 19/35: lv.el (lv-window): Ensure fundamental-mode, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 370a5c613e 23/35: hydra.el (hydra-key-regex): Include "[]" in the char group, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 2dfc493ebc 25/35: Fixed message hint display from being escaped by percent, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 1ab885785e 29/35: hydra.el (hydra--make-defun): Allow to speficy :idle property for a head, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 2d553787ac 30/35: hydra.el (hydra--make-defun): Refactor, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra f45e64f7e1 31/35: hydra.el (hydra--describe-key): Add and bind to "<f1> k", ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 317e1de330 34/35: Fix emacs native compilation warning, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 0c5dcf7ab9 13/35: .travis.yml: Use EVM, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 82ff12666e 04/35: hydra.el (find-func): Fix advice, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 16fa8d109e 24/35: hydra.el (defhydra): Use "__" in docstring to represent a literal "_",
ELPA Syncer <=
- [elpa] externals/hydra 87873d7888 26/35: Explicitly require cl-lib., ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 798c0d810f 05/35: .github/FUNDING.yml: Add, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 74b32f3ff0 10/35: lv.el: Sience byte compiler, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra d2b921d067 22/35: hydra.el (defhydra): :exit key can now also be a sexp, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra a38690b1b7 32/35: Add GNU ELPA badge, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 112e689f75 28/35: hydra.el (hydra-add-imenu): Add, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 9e9e00cb24 33/35: hydra.el (hydra--doc): Don't quote nil in generated docstrings, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 406988f6e9 02/35: hydra.el (hydra-posframe-show-params): Add, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra bcc2d0eb5b 15/35: hydra.el (hydra--work-around-dedicated): Revert, ELPA Syncer, 2022/10/25
- [elpa] externals/hydra 6442faf3da 20/35: hydra.el (hydra--make-defun): Refactor, ELPA Syncer, 2022/10/25