2 Commits

Author SHA1 Message Date
Magnar Sveen 20e692ae03 Release 1.2.3 2013-08-24 20:39:37 +02:00
Magnar Sveen de3306066a Fix broken let binding 2013-08-24 20:38:49 +02:00
9 changed files with 34 additions and 113 deletions
-1
View File
@@ -1,4 +1,3 @@
(source gnu)
(source melpa) (source melpa)
(package-file "multiple-cursors.el") (package-file "multiple-cursors.el")
+2 -3
View File
@@ -69,7 +69,7 @@ You can [watch an intro to multiple-cursors at Emacs Rocks](http://emacsrocks.co
- `mc/mark-all-like-this-in-defun`: Marks all parts of the current defun that matches the current region. - `mc/mark-all-like-this-in-defun`: Marks all parts of the current defun that matches the current region.
- `mc/mark-all-words-like-this-in-defun`: Like `mc/mark-all-like-this-in-defun` but only for whole words. - `mc/mark-all-words-like-this-in-defun`: Like `mc/mark-all-like-this-in-defun` but only for whole words.
- `mc/mark-all-symbols-like-this-in-defun`: Like `mc/mark-all-like-this-in-defun` but only for whole symbols. - `mc/mark-all-symbols-like-this-in-defun`: Like `mc/mark-all-like-this-in-defun` but only for whole symbols.
- `mc/mark-all-dwim`: Tries to be smart about marking everything you want. Can be pressed multiple times. - `mc/mark-all-like-this-dwim`: Tries to be smart about marking everything you want. Can be pressed multiple times.
### Special ### Special
@@ -136,7 +136,7 @@ the location with:
## Known limitations ## Known limitations
* isearch-forward and isearch-backward aren't supported with multiple cursors. * isearch-forward and isearch-backward aren't supported with multiple cursors.
If you want this functionality, you can use [phi-search](https://github.com/zk-phi/phi-search). You should feel free to add a simplified version that can work with it.
* Commands run with `M-x` won't be repeated for all cursors. * Commands run with `M-x` won't be repeated for all cursors.
* All key bindings that refer to lambdas are always run for all cursors. If you * All key bindings that refer to lambdas are always run for all cursors. If you
need to limit it, you will have to give it a name. need to limit it, you will have to give it a name.
@@ -170,7 +170,6 @@ Run the tests with:
* [Ivan Andrus](https://github.com/gvol) added showing number of cursors in mode-line * [Ivan Andrus](https://github.com/gvol) added showing number of cursors in mode-line
* [Fuco](https://github.com/Fuco1) added the first version of `mc/mark-all-like-this-dwim` * [Fuco](https://github.com/Fuco1) added the first version of `mc/mark-all-like-this-dwim`
* [Zach Kost-Smith](https://github.com/smithzvk) added `mc/mark-pop` * [Zach Kost-Smith](https://github.com/smithzvk) added `mc/mark-pop`
* [Maciej Katafiasz](https://github.com/mathrick) added `mc/mark-all-dwim`
Thanks! Thanks!
+13 -65
View File
@@ -1,16 +1,13 @@
Feature: Mark all do-what-I-mean Feature: Mark all do-what-I-mean
Background: Scenario: Mark symbols in defun
Given I turn on emacs-lisp-mode Given I turn on emacs-lisp-mode
And I turn on delete-selection-mode And I turn on delete-selection-mode
And I insert: And I insert:
""" """
(defun abc (ghi) (message ghi)) (defun abc (ghi) (message ghi))
(defun def (ghi) (message some-other-ghi)) (defun def (ghi) (message some-other-ghi))
""" """
Scenario: Mark symbols in defun
When I go to the end of the word "abc" When I go to the end of the word "abc"
And I press "M-f" And I press "M-f"
And I press "M-$" And I press "M-$"
@@ -20,71 +17,22 @@ Feature: Mark all do-what-I-mean
(defun abc (hmm) (message hmm)) (defun abc (hmm) (message hmm))
(defun def (ghi) (message some-other-ghi)) (defun def (ghi) (message some-other-ghi))
""" """
When I press "C-g"
And I go to the front of the word "hmm"
And I press "C-$"
And I type "foo"
Then I should see:
"""
(defun abc (foo) (message foo))
(defun def (ghi) (message some-other-ghi))
"""
Scenario: Mark all symbols by pressing twice Scenario: Mark all symbols by pressing twice
When I go to the end of the word "abc" Given I turn on emacs-lisp-mode
And I press "M-f" And I turn on delete-selection-mode
And I press "M-$"
And I press "M-$"
And I type "hmm"
Then I should see:
"""
(defun abc (hmm) (message hmm))
(defun def (hmm) (message some-other-hmm))
"""
When I press "C-g"
And I press "M->"
And I insert: And I insert:
""" """
(defun def (hmm-hmm) (message hmm)) (defun abc (ghi) (message ghi))
(defun def (ghi) (message ghi))
""" """
And I go to the front of the word "hmm" When I go to the end of the word "abc"
And I press "C-$" And I press "M-f"
And I press "C-$" And I press "M-$"
And I type "humm" And I press "M-$"
And I type "hmm"
Then I should see: Then I should see:
""" """
(defun abc (humm) (message humm)) (defun abc (hmm) (message hmm))
(defun def (humm) (message some-other-humm)) (defun def (hmm) (message hmm))
(defun def (humm-humm) (message humm))
"""
Scenario: Mark dwim from selection
When I press "M-<"
And I press "S-M->"
And I press "C-$ ghi RET"
And I type "xyz"
Then I should see:
"""
(defun abc (xyz) (message xyz))
(defun def (xyz) (message some-other-xyz))
"""
When I press "C-g"
And I go to the front of the word "xyz"
And I press "C-M-SPC"
And I press "C-$"
And I type "foo"
Then I should see:
"""
(defun abc (foo) (message foo))
(defun def (xyz) (message some-other-xyz))
"""
When I press "C-g"
And I press "M-<"
And I press "S-M->"
And I press "C-u C-$"
And I type ";;"
Then I should see:
"""
;;(defun abc (foo) (message foo))
;;(defun def (xyz) (message some-other-xyz))
""" """
-1
View File
@@ -24,7 +24,6 @@
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) (global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "M-!") 'mc/mark-all-like-this) (global-set-key (kbd "M-!") 'mc/mark-all-like-this)
(global-set-key (kbd "M-$") 'mc/mark-all-like-this-dwim) (global-set-key (kbd "M-$") 'mc/mark-all-like-this-dwim)
(global-set-key (kbd "C-$") 'mc/mark-all-dwim)
(global-set-key (kbd "M-#") 'mc/mark-all-in-region) (global-set-key (kbd "M-#") 'mc/mark-all-in-region)
(global-set-key (kbd "H-0") 'mc/insert-numbers) (global-set-key (kbd "H-0") 'mc/insert-numbers)
(global-set-key (kbd "H-1") 'mc/reverse-regions) (global-set-key (kbd "H-1") 'mc/reverse-regions)
+14 -38
View File
@@ -173,9 +173,9 @@ With zero ARG, skip the last one and mark next."
(dotimes (i num-lines) (dotimes (i num-lines)
(mc/create-fake-cursor-at-point) (mc/create-fake-cursor-at-point)
(ecase direction (ecase direction
(forwards (loop do (next-logical-line 1 nil) (forwards (loop do (next-line 1 nil)
while (mc/all-fake-cursors (point) (1+ (point))))) while (mc/all-fake-cursors (point) (1+ (point)))))
(backwards (loop do (previous-logical-line 1 nil) (backwards (loop do (previous-line 1 nil)
while (mc/all-fake-cursors (point) (1+ (point)))))))) while (mc/all-fake-cursors (point) (1+ (point))))))))
;;;###autoload ;;;###autoload
@@ -268,21 +268,18 @@ With zero ARG, skip the last one and mark next."
(interactive "r") (interactive "r")
(let ((search (read-from-minibuffer "Mark all in region: ")) (let ((search (read-from-minibuffer "Mark all in region: "))
(case-fold-search nil)) (case-fold-search nil))
(if (string= search "") (mc/remove-fake-cursors)
(message "Mark aborted") (goto-char beg)
(progn (while (search-forward search end t)
(mc/remove-fake-cursors) (push-mark (match-beginning 0))
(goto-char beg) (mc/create-fake-cursor-at-point))
(while (search-forward search end t) (let ((first (mc/furthest-cursor-before-point)))
(push-mark (match-beginning 0)) (if (not first)
(mc/create-fake-cursor-at-point)) (error "Search failed for %S" search)
(let ((first (mc/furthest-cursor-before-point))) (mc/pop-state-from-overlay first))))
(if (not first) (if (> (mc/num-cursors) 1)
(error "Search failed for %S" search) (multiple-cursors-mode 1)
(mc/pop-state-from-overlay first))) (multiple-cursors-mode 0)))
(if (> (mc/num-cursors) 1)
(multiple-cursors-mode 1)
(multiple-cursors-mode 0))))))
(when (not (fboundp 'set-temporary-overlay-map)) (when (not (fboundp 'set-temporary-overlay-map))
;; Backport this function from newer emacs versions ;; Backport this function from newer emacs versions
@@ -419,27 +416,6 @@ With prefix, it behaves the same as original `mc/mark-all-like-this'"
(when (<= (mc/num-cursors) before) (when (<= (mc/num-cursors) before)
(mc/mark-all-like-this)))))) (mc/mark-all-like-this))))))
(defun mc/mark-all-dwim (arg)
"Tries even harder to guess what you want to mark all of.
If the region is active and spans multiple lines, it will behave
as if `mc/mark-all-in-region'. With the prefix ARG, it will call
`mc/edit-lines' instead.
If the region is inactive or on a single line, it will behave like
`mc/mark-all-like-this-dwim'."
(interactive "P")
(if (and (use-region-p)
(not (> (mc/num-cursors) 1))
(not (= (line-number-at-pos (region-beginning))
(line-number-at-pos (region-end)))))
(if arg
(call-interactively 'mc/edit-lines)
(call-interactively 'mc/mark-all-in-region))
(progn
(setq this-command 'mc/mark-all-like-this-dwim)
(mc/mark-all-like-this-dwim arg))))
(defun mc--in-defun () (defun mc--in-defun ()
(bounds-of-thing-at-point 'defun)) (bounds-of-thing-at-point 'defun))
+3 -2
View File
@@ -4,8 +4,9 @@
;;;###autoload ;;;###autoload
(defun mc/mark-pop () (defun mc/mark-pop ()
"Add a cursor at the current point, pop off mark ring and jump "Add one cursor to each line of the active region.
to the popped mark." Starts from mark and moves in straight down or up towards the
line point is on."
(interactive) (interactive)
;; If the mark happens to be at the current point, just pop that one off. ;; If the mark happens to be at the current point, just pop that one off.
(while (eql (mark) (point)) (while (eql (mark) (point))
-1
View File
@@ -573,7 +573,6 @@ for running commands with multiple cursors.")
mc/mark-all-words-like-this-in-defun mc/mark-all-words-like-this-in-defun
mc/mark-all-symbols-like-this-in-defun mc/mark-all-symbols-like-this-in-defun
mc/mark-all-like-this-dwim mc/mark-all-like-this-dwim
mc/mark-all-dwim
mc/mark-sgml-tag-pair mc/mark-sgml-tag-pair
mc/insert-numbers mc/insert-numbers
mc/sort-regions mc/sort-regions
+1 -1
View File
@@ -1,2 +1,2 @@
(define-package "multiple-cursors" "1.3.0" (define-package "multiple-cursors" "1.2.3"
"Multiple cursors for Emacs.") "Multiple cursors for Emacs.")
+1 -1
View File
@@ -1,2 +1,2 @@
#!/bin/sh -e #!/bin/sh -e
cask exec ecukes "$@" --no-win cask exec ecukes "$@"