You can find the teams narrow-to-regionboth widenuseful C-h f narrow-to-region RETand C-h f widen RETto find out more
UPDATE
, , , ,
(add-hook 'isearch-mode-end-hook (lambda ()
(when (buffer-narrowed-p)
(widen))))
(defun my-isearch(&optional start end)
(interactive "r")
(when (region-active-p)
(narrow-to-region start end))
(call-interactively 'isearch-forward-regexp))
2
, ,
(defun my-isearch(&optional start end)
(interactive "r")
(if (region-active-p)
(progn
(let ((string (buffer-substring-no-properties start end)))
(deactivate-mark)
(isearch-resume string nil nil t string nil)))
(call-interactively 'isearch-forward-regexp)))
user2053036