* lisp/isearch.el (isearch-define-mode-toggle): Improve logic
This commit is contained in:
parent
16140f7ece
commit
9ffe7ddd5e
1 changed files with 3 additions and 5 deletions
|
@ -1528,15 +1528,13 @@ The command then executes BODY and updates the isearch prompt."
|
||||||
(if docstring (concat "\n" docstring) ""))
|
(if docstring (concat "\n" docstring) ""))
|
||||||
(interactive)
|
(interactive)
|
||||||
,@(when function
|
,@(when function
|
||||||
`((setq isearch-regexp-function
|
`((setq isearch-regexp-function #',function)
|
||||||
(unless (eq isearch-regexp-function #',function)
|
(setq isearch-regexp nil)))
|
||||||
#',function))
|
|
||||||
(when isearch-regexp-function (setq isearch-regexp nil))))
|
|
||||||
,@body
|
,@body
|
||||||
(setq isearch-success t isearch-adjusted t)
|
(setq isearch-success t isearch-adjusted t)
|
||||||
(isearch-update))
|
(isearch-update))
|
||||||
(define-key isearch-mode-map ,key #',command-name)
|
(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 'isearch-message-prefix ,(format "%s " mode))
|
||||||
(put ',function :advertised-binding ,key)
|
(put ',function :advertised-binding ,key)
|
||||||
(cl-callf (lambda (types) (cons 'choice
|
(cl-callf (lambda (types) (cons 'choice
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue