]> code.delx.au - gnu-emacs/commitdiff
* lisp/isearch.el (isearch-define-mode-toggle): Improve logic
authorArtur Malabarba <bruce.connor.am@gmail.com>
Sat, 6 Feb 2016 22:46:16 +0000 (22:46 +0000)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Sat, 6 Feb 2016 22:58:24 +0000 (22:58 +0000)
lisp/isearch.el

index 6ef4f72db2f311ae3f377b6dbc4975138ac6d7eb..2efa4c7e8ef6b6b8b7038c23f887f16613c586f7 100644 (file)
@@ -1528,15 +1528,13 @@ The command then executes BODY and updates the isearch prompt."
                   (if docstring (concat "\n" docstring) ""))
          (interactive)
          ,@(when function
-             `((setq isearch-regexp-function
-                     (unless (eq isearch-regexp-function #',function)
-                       #',function))
-               (when isearch-regexp-function (setq isearch-regexp nil))))
+             `((setq isearch-regexp-function #',function)
+               (setq isearch-regexp nil)))
          ,@body
          (setq isearch-success t isearch-adjusted t)
          (isearch-update))
        (define-key isearch-mode-map ,key #',command-name)
-       ,@(when (symbolp function)
+       ,@(when (and function (symbolp function))
            `((put ',function 'isearch-message-prefix ,(format "%s " mode))
              (put ',function :advertised-binding ,key)
              (cl-callf (lambda (types) (cons 'choice