[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-surround 2bc8aa6425 160/175: Merge pull request #186
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-surround 2bc8aa6425 160/175: Merge pull request #186 from leungbk/prefix-calls |
Date: |
Mon, 9 Oct 2023 13:01:16 -0400 (EDT) |
branch: elpa/evil-surround
commit 2bc8aa6425f1311e985cf51ea6b5233c1ee6ce1c
Merge: 648da3c544 191ad92fb8
Author: Tom Dalziel <33435574+tomdl89@users.noreply.github.com>
Commit: GitHub <noreply@github.com>
Merge pull request #186 from leungbk/prefix-calls
Add support for surrounding with function calls in prefix form
---
evil-surround.el | 8 ++++++++
test/evil-surround-test.el | 10 ++++++++++
2 files changed, 18 insertions(+)
diff --git a/evil-surround.el b/evil-surround.el
index 942e25209a..e20e0cd97a 100644
--- a/evil-surround.el
+++ b/evil-surround.el
@@ -64,6 +64,7 @@
(?> . ("<" . ">"))
(?t . evil-surround-read-tag)
(?< . evil-surround-read-tag)
+ (?\C-f . evil-surround-prefix-function)
(?f . evil-surround-function))
"Association list of surround items.
Each item is of the form (TRIGGER . (LEFT . RIGHT)), all strings.
@@ -132,6 +133,13 @@ Each item is of the form (OPERATOR . OPERATION)."
(cons (format "%s(" (or fname ""))
")")))
+(defun evil-surround-prefix-function ()
+ "Read a function name from the minibuffer and wrap selection in a
+function call in prefixed form."
+ (let ((fname (evil-surround-read-from-minibuffer "prefix function: " "")))
+ (cons (format "(%s " (or fname ""))
+ ")")))
+
(defconst evil-surround-tag-name-re "\\([0-9a-zA-Z\.-]+\\)"
"Regexp matching an XML tag name.")
diff --git a/test/evil-surround-test.el b/test/evil-surround-test.el
index 1da5d37d8b..44662f580e 100644
--- a/test/evil-surround-test.el
+++ b/test/evil-surround-test.el
@@ -99,6 +99,16 @@
"function(argument1) argument2"
("W.")
"function(argument1) function(argument2)"))
+ (ert-info ("prefix-function surrounding with dot repeat")
+ (evil-test-buffer
+ :visual-start nil
+ :visual-end nil
+ "argument1 argument2"
+ (turn-on-evil-surround-mode)
+ ("ysiw\C-ffunction" [return])
+ "(function argument1) argument2"
+ ("WW.")
+ "(function argument1) (function argument2)"))
(ert-info ("even more examples from readme: tag surrounding with dot repeat")
(evil-test-buffer
:visual-start nil
- [nongnu] elpa/evil-surround 2d878b6cce 166/175: Enable lexical binding, (continued)
- [nongnu] elpa/evil-surround 2d878b6cce 166/175: Enable lexical binding, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 6028c76399 131/175: readme: add missing link to `define-and-bind-text-object` macro, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 83c2e0f369 137/175: add a "make emacs" makefile option to fire up a clean emacs..., ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 440d391c89 130/175: Fix visible narrowing when surrounding within a field (#135), ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround b11048d92a 173/175: Trim whitespace from delimeters before using for deletion/change, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 4d6cc94df0 146/175: Add surround text objects from local keymap (#165), ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 282a975bda 154/175: Typo fix, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround a3803cfb51 141/175: Add a test for surrounding with a tag in a macro, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 6d37e5c910 115/175: add melpa stable badge, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround f273821f57 165/175: Merge pull request #188 from skangas/nongnu-elpa-fixes, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 2bc8aa6425 160/175: Merge pull request #186 from leungbk/prefix-calls,
ELPA Syncer <=
- [nongnu] elpa/evil-surround 4a21d756b7 168/175: Revert "Enable lexical binding", ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround a3034c284d 049/175: Fix surrounding with invalid chars, like ESC (Fix #51), ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 27eb4112db 050/175: Merge pull request #53 from hlissner/block-surround, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 71f380b6b6 042/175: Merge pull request #35 from Silex/master, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround ce36c8307c 047/175: correct README.md, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 641498131a 059/175: Refactor evil-surround-block, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 0eeef7a3a9 070/175: Merge pull request #68 from hlissner/master, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 8b2ca83b7c 068/175: Fix #52, #39, and #5 (linewise surrounding), ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 78eddc8077 063/175: Merge pull request #50 from yangguang760/master, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 06071c3425 060/175: let* => let, ELPA Syncer, 2023/10/09