Re: Use region as initial search regexp
"Roland Winkler" <[email protected]> Fri, 24 May 2019 10:31:55 -0500
| Newsgroups | gmane.emacs.bbdb.user |
|---|---|
| Message-ID | <[email protected]> |
On Thu May 23 2019 Marco Wahl wrote: > What do you think about using the region as initial value for > bbdb-search-read? See the (small amount of) code below. Minor point: the 2nd arg INITIAL-INPUT of read-string is depreciated. New code should use instead DEFAULT-VALUE, see the docstring of read-string. (I believe the reason for this policy change has been that some people find a non-nil INITIAL-INPUT too obtrusive.) However, using the region as DEFAULT-VALUE wouldn't allow one to edit this string as an argument for bbdb-search-read. So in other code I have copied the value of the region to the input history (provided the region is active). Then you can step through the input history with C-p and C-n in the usual way. One can even in the end again remove the region from the input history if the user decided to use a modified string or she did something completely different (so that the input history is not getting populated with anything irrelvant). Roland