From 5e879f9b5cb5785fe266435b45333fd002d2dc05 Mon Sep 17 00:00:00 2001 From: Maciej Katafiasz Date: Thu, 5 Sep 2013 17:36:47 +0200 Subject: [PATCH] Guard against empty search pattern in 'mc/mark-all-in-region', otherwise it will enter an infinite loop --- mc-mark-more.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mc-mark-more.el b/mc-mark-more.el index 7e240a1..22110c6 100644 --- a/mc-mark-more.el +++ b/mc-mark-more.el @@ -270,7 +270,8 @@ With zero ARG, skip the last one and mark next." (case-fold-search nil)) (mc/remove-fake-cursors) (goto-char beg) - (while (search-forward search end t) + (while (and (not (string= search "")) + (search-forward search end t)) (push-mark (match-beginning 0)) (mc/create-fake-cursor-at-point)) (let ((first (mc/furthest-cursor-before-point)))