Re: Use region as initial search regexp
"Basil L. Contovounesios" <[email protected]> Fri, 24 May 2019 18:16:16 +0100
| Newsgroups | gmane.emacs.bbdb.user |
|---|---|
| Message-ID | <[email protected]> |
Roland Winkler <[email protected]> writes: > 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. FWIW, DEFAULT-VALUE is made available for editing via M-n (next-history-element). > 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). Thanks, -- Basil