branch: elpa/multiple-cursors
commit 373dcbe0022061c0ab14298b9dca07f4a7216ef2
Author: Takafumi Arakaki <[email protected]>
Commit: Takafumi Arakaki <[email protected]>
Add a scenario for mc/mark-all-symbols-like-this
---
features/mark-things.feature | 18 ++++++++++++++++++
features/step-definitions/multiple-cursors-steps.el | 8 ++++++++
2 files changed, 26 insertions(+)
diff --git a/features/mark-things.feature b/features/mark-things.feature
new file mode 100644
index 0000000..cfe880a
--- /dev/null
+++ b/features/mark-things.feature
@@ -0,0 +1,18 @@
+Feature: Mark things
+
+ Scenario: Mark symbols in defun with select
+ Given I turn on emacs-lisp-mode
+ And I turn on delete-selection-mode
+ And I insert:
+ """
+ (defun abc (ghi) (message ghi))
+ (defun def (ghi) (message some-other-ghi))
+ """
+ When I select "ghi"
+ And I mark all symbols like this in defun
+ And I type "hmm"
+ Then I should see:
+ """
+ (defun abc (hmm) (message hmm))
+ (defun def (ghi) (message some-other-ghi))
+ """
diff --git a/features/step-definitions/multiple-cursors-steps.el
b/features/step-definitions/multiple-cursors-steps.el
index 900eeed..ba25181 100644
--- a/features/step-definitions/multiple-cursors-steps.el
+++ b/features/step-definitions/multiple-cursors-steps.el
@@ -95,3 +95,11 @@
(assert search nil "The text '%s' was not found in the current
buffer." text))
(set-mark (point))
(re-search-forward text)))
+
+(When "^I mark all \\(.+\\)$"
+ (lambda (rest)
+ (let ((func (intern (mapconcat 'identity
+ (cons "mc/mark-all"
+ (split-string rest))
+ "-"))))
+ (call-interactively func))))