(define-key map [?\M-%] 'isearch-query-replace)
(define-key map [?\C-\M-%] 'isearch-query-replace-regexp)
(define-key map "\M-so" 'isearch-occur)
+ (define-key map "\M-s\M-s" 'search-from-isearch)
(define-key map "\M-shr" 'isearch-highlight-regexp)
(define-key map "\M-shl" 'isearch-highlight-lines-matching-regexp)
;; - Support multi-buffer `search'.
;; - Add regexp completion style and use it for `search' completion.
-;; - Isearch-to-search and vice versa.
;; - Search non-matches.
;; - Highlight subgroups in matches.
;; - Improve documentation.
+;; - Support toggling search case sensitivity.
;;; Code:
(goto-char beg)
(pulse-momentary-highlight-region beg end 'isearch))
+;;;###autoload
+(defun search-from-isearch (beg end)
+ (interactive
+ (if isearch-mode
+ (save-excursion
+ (isearch-done)
+ (search-read-target nil nil
+ (if isearch-regexp
+ isearch-string
+ (regexp-quote isearch-string))))
+ (user-error "Isearch not in progress")))
+ ;; TODO: Consider handling `isearch-recursive-edit' like
+ ;; `isearch-query-replace' does.
+ (search beg end))
+
;;;###autoload
(defun search-lines (beg end)
"Go to and pulse line starting at BEG and ending at END."