From: Artur Malabarba <bruce.connor.am@gmail.com>
Date: Thu, 3 Mar 2016 22:03:16 +0000 (-0300)
Subject: * lisp/isearch.el (isearch-define-mode-toggle): Fix toggling logic
X-Git-Tag: emacs-25.0.93~137
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2e78353fabe11c768627c50e48375de5693ce7ee;p=emacs.git

* lisp/isearch.el (isearch-define-mode-toggle): Fix toggling logic
---

diff --git a/lisp/isearch.el b/lisp/isearch.el
index 2efa4c7e8ef..c91ccfad27d 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1528,7 +1528,9 @@ The command then executes BODY and updates the isearch prompt."
                   (if docstring (concat "\n" docstring) ""))
          (interactive)
          ,@(when function
-             `((setq isearch-regexp-function #',function)
+             `((setq isearch-regexp-function
+                     (unless (eq isearch-regexp-function #',function)
+                       #',function))
                (setq isearch-regexp nil)))
          ,@body
          (setq isearch-success t isearch-adjusted t)