[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: killing the result of isearch
From: |
Drew Adams |
Subject: |
RE: killing the result of isearch |
Date: |
Tue, 7 Nov 2017 09:24:51 -0800 (PST) |
> Several years ago, when I wanted to do this, I wrote the following:
>
> (define-key isearch-mode-map (kbd "M-m") 'my-isearch-mark-search-as-region)
> (defun my-isearch-mark-search-as-region ()
> (interactive)
> (if (not isearch-mode)
> (message "This is only useful during isearch")
> (isearch-exit)
> (push-mark isearch-other-end)
> (activate-mark)))
That's essentially the same thing used in Isearch+:
(defun isearchp-set-region-around-search-target ()
"Set the region around the last search or query-replace target."
(interactive)
(case last-command
((isearch-forward isearch-backward
isearch-forward-regexp isearch-backward-regexp)
(push-mark isearch-other-end t 'activate))
(t (push-mark (match-beginning 0) t 'activate)))
(setq deactivate-mark nil))
> I guess that's just a tiny half-step in the direction that isearch+ is
> headed.
Isearch+ isn't really headed anywhere. ;-) I just add/change things as
they come to me.
> Another very good facility to get comfortable with is recursive editing:
> type "C-r" during search mode, do whatever editing you like, then
> "C-M-c" to go back into search mode.
+1
But that's not in vanilla Emacs, AFAIK. (It's certainly not
bound to `C-r' by default - `C-r' is ` isearch-repeat-backward'.)
With Isearch+, `C-x o' during Isearch opens a recursive edit.
And `C-M-c' (`exit-recursive-edit') resumes searching.
> I think what people are trying to say is that Emacs' defaults can often
> seem lacking, but it makes up for it by giving you enormous power to
> create your ideal behavior yourself... I think we all expect that we
> need to go the last half-mile ourselves.
+1
But sometimes it's not so much that we need to go the last
half mile ourselves. Sometimes it's more that we want to
go the next N miles, for fun and learning.
- Re: killing the result of isearch, (continued)
- Message not available
- Re: killing the result of isearch, Loris Bennett, 2017/11/07
- Re: killing the result of isearch, Jean-Christophe Helary, 2017/11/07
- Re: killing the result of isearch, Jean-Christophe Helary, 2017/11/07
- Message not available
- Re: killing the result of isearch, Loris Bennett, 2017/11/07
- Re: killing the result of isearch, Jean-Christophe Helary, 2017/11/07
- RE: killing the result of isearch, Drew Adams, 2017/11/07
- Re: killing the result of isearch, Jean-Christophe Helary, 2017/11/07
- RE: killing the result of isearch, Drew Adams, 2017/11/07
- Re: killing the result of isearch, Jean-Christophe Helary, 2017/11/07
- Re: killing the result of isearch, Eric Abrahamsen, 2017/11/07
- RE: killing the result of isearch,
Drew Adams <=
- Re: killing the result of isearch, Eric Abrahamsen, 2017/11/07
- Re: killing the result of isearch, Thien-Thi Nguyen, 2017/11/08
- Re: killing the result of isearch, Emanuel Berg, 2017/11/08
- Re: killing the result of isearch, Charles A. Roelli, 2017/11/11
- Message not available
- Re: killing the result of isearch, Loris Bennett, 2017/11/07
- Re: killing the result of isearch, Jean-Christophe Helary, 2017/11/07
- RE: killing the result of isearch, Drew Adams, 2017/11/07
- Re: killing the result of isearch, Jean-Christophe Helary, 2017/11/07
- RE: killing the result of isearch, Drew Adams, 2017/11/07
- Re: killing the result of isearch, Tomas Nordin, 2017/11/08