Add a scenario for mc/mark-all-symbols-like-this

This commit is contained in:
Takafumi Arakaki 2013-03-10 06:43:50 +01:00
parent a6e0ccb22f
commit 373dcbe002
2 changed files with 26 additions and 0 deletions

View File

@ -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))
"""

View File

@ -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))))