bbdb-user
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]