GNU bug report logs -
#39512
28.0.50; Add command isearch-yank-region
Previous Next
Reported by: Tino Calancha <tino.calancha <at> gmail.com>
Date: Sat, 8 Feb 2020 18:06:01 UTC
Severity: wishlist
Tags: fixed, patch
Fixed in version 28.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>> Thanks for creating a new feature request that unlike these discussions
>> on emacs-devel won't fall into oblivion.
>
> This was in February, though, and the patch still hasn't been applied. :-/
>
> I think this addition makes sense... was there any particular reason
> it's not applied?
I really don't see a need for adding isearch-yank-region. I think that
isearch-forward-region proposed by Ergus should be sufficient because
typing 'M-s M-.' (bound globally to isearch-forward-region) even when
isearch mode is active, will exit Isearch and restart Isearch with the
contents of the still active region added to the search string.
This will cover all cases requested here with just one new command:
(defun isearch-forward-region ()
"Do incremental search forward for text from the active region.
Like ordinary incremental search except that text from the region
is added to the search string initially if the region is active."
(interactive)
(isearch-forward nil 1)
(cond
((use-region-p)
(when (< (mark) (point))
(exchange-point-and-mark))
(isearch-yank-string
(buffer-substring-no-properties (region-beginning) (region-end)))
(deactivate-mark))
(t
(setq isearch-error "No active region")
(isearch-push-state)
(isearch-update))))
(define-key search-map "\M-." 'isearch-forward-region)
This bug report was last modified 4 years and 115 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.