aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Malabarba2016-02-06 22:46:16 +0000
committerArtur Malabarba2016-02-06 22:58:24 +0000
commit9ffe7ddd5e1ba93f327cfe985e9476571d7a2873 (patch)
treeaa7554fd87b55c31a52bc66a9868dc182006abc9
parent16140f7ecebc82829c9720cb18979fb26063fa56 (diff)
downloademacs-9ffe7ddd5e1ba93f327cfe985e9476571d7a2873.tar.gz
emacs-9ffe7ddd5e1ba93f327cfe985e9476571d7a2873.zip
* lisp/isearch.el (isearch-define-mode-toggle): Improve logic
-rw-r--r--lisp/isearch.el8
1 files changed, 3 insertions, 5 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 6ef4f72db2f..2efa4c7e8ef 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1528,15 +1528,13 @@ The command then executes BODY and updates the isearch prompt."
1528 (if docstring (concat "\n" docstring) "")) 1528 (if docstring (concat "\n" docstring) ""))
1529 (interactive) 1529 (interactive)
1530 ,@(when function 1530 ,@(when function
1531 `((setq isearch-regexp-function 1531 `((setq isearch-regexp-function #',function)
1532 (unless (eq isearch-regexp-function #',function) 1532 (setq isearch-regexp nil)))
1533 #',function))
1534 (when isearch-regexp-function (setq isearch-regexp nil))))
1535 ,@body 1533 ,@body
1536 (setq isearch-success t isearch-adjusted t) 1534 (setq isearch-success t isearch-adjusted t)
1537 (isearch-update)) 1535 (isearch-update))
1538 (define-key isearch-mode-map ,key #',command-name) 1536 (define-key isearch-mode-map ,key #',command-name)
1539 ,@(when (symbolp function) 1537 ,@(when (and function (symbolp function))
1540 `((put ',function 'isearch-message-prefix ,(format "%s " mode)) 1538 `((put ',function 'isearch-message-prefix ,(format "%s " mode))
1541 (put ',function :advertised-binding ,key) 1539 (put ',function :advertised-binding ,key)
1542 (cl-callf (lambda (types) (cons 'choice 1540 (cl-callf (lambda (types) (cons 'choice