[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: region around search hit
From: |
Andreas Roehler |
Subject: |
Re: region around search hit |
Date: |
Sun, 23 Jul 2006 21:20:29 +0200 |
User-agent: |
KNode/0.9.2 |
Drew Adams wrote:
> This could be programmed, but I'm wondering if there is already
> a quick way to do this: set the region around the last search
> occurrence, when isearch is exited. Likewise, for query-replace
> (even if exited with C-g).
No solution, just some ideas:
in isearch.el, (defun isearch-search, starting with
line 2009, positions `match-beginning' and `match-end'
exist.
(setq isearch-success
(funcall
(isearch-search-fun)
isearch-string nil t))
;; Clear RETRY unless we matched some invisible text
;; and we aren't supposed to do that.
(if (or (eq search-invisible t)
(not isearch-success)
(bobp) (eobp)
(= (match-beginning 0) (match-end 0))
Maybe you could some (push-mark) and (point) constructs
insert here and/or store positions.
__
Andreas Roehler