[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 9ffe7dd 4/4: * lisp/isearch.el (isearch-define-mo
From: |
Artur Malabarba |
Subject: |
[Emacs-diffs] emacs-25 9ffe7dd 4/4: * lisp/isearch.el (isearch-define-mode-toggle): Improve logic |
Date: |
Sun, 07 Feb 2016 01:05:12 +0000 |
branch: emacs-25
commit 9ffe7ddd5e1ba93f327cfe985e9476571d7a2873
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
* lisp/isearch.el (isearch-define-mode-toggle): Improve logic
---
lisp/isearch.el | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 6ef4f72..2efa4c7 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -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