[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Use region as initial search regexp
From: |
Marco Wahl |
Subject: |
Re: Use region as initial search regexp |
Date: |
Sat, 25 May 2019 21:35:00 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
"Roland Winkler" <address@hidden> writes:
> On Fri May 24 2019 Basil L. Contovounesios wrote:
>> FWIW, DEFAULT-VALUE is made available for editing via M-n
>> (next-history-element).
>
> Thanks, good to know! - When I wrote the previous message I thought
> that implementing such a scheme n times reinvents the wheel (n-1)
> times. But this problem has been solved.
Thanks Roland and Basil for the enlightenment.
IIUC you could consider
#v+
(defun bbdb-search-read (&optional field)
"Read regexp to search FIELD values of records.
When region is active make it available at the prompt via M-n."
(read-string (format "Search records%s %smatching regexp: "
(if field (concat " with " field) "")
(if bbdb-search-invert "not " ""))
nil nil
(when (region-active-p)
(buffer-substring (region-beginning) (region-end)))))
#v-
as a new candidate.
Ciao,
--
Marco
- Use region as initial search regexp, Marco Wahl, 2019/05/23
- Re: Use region as initial search regexp, Roland Winkler, 2019/05/24
- Re: Use region as initial search regexp, Basil L. Contovounesios, 2019/05/24
- Re: Use region as initial search regexp, Roland Winkler, 2019/05/24
- Re: Use region as initial search regexp,
Marco Wahl <=
- Re: Use region as initial search regexp, Roland Winkler, 2019/05/26
- Re: Use region as initial search regexp, Roland Winkler, 2019/05/26
- Re: Use region as initial search regexp, Marco Wahl, 2019/05/26
- Re: Use region as initial search regexp, Roland Winkler, 2019/05/26
- Re: Use region as initial search regexp, Marco Wahl, 2019/05/26