>>>>> "Alex" == Alex Schroeder <[EMAIL PROTECTED]> writes:
Alex> Alex Schroeder <[EMAIL PROTECTED]> writes: >> Alex Schroeder <[EMAIL PROTECTED]> writes: >> >>> There is, however, no way to search for people without phone numbers, >>> or all people without an address matching "gnu". Do you think this is >>> important? Alex> Ok, so I was bored. Now you can also search for stuff *not* Alex> matching something, for example for all people whose name do Alex> not contain the letter a. I'm still not sure such a thing Alex> is actually needed, though. Plus I think the user interface Alex> is bad. At the moment you have to call M-x Alex> bbdb-search-invert-set to invert the meaning of the next Alex> search. M-x bbdb searches for records matching regexp. Why not make a C-u prefix invert the sense of the search to find records not matching regexp? The prompt would have to be changed though to make sense again. His is the current doc for `bbdb': Display all entries in the BBDB matching the regexp STRING in either the name(s), company, network address, or notes. How about this, then: Display all entries in the BBDB matching the regexp STRING in either the name(s), company, network address, or notes. With prefix argument display all entries not matching regexp STRING. Alex> I'll leave it up to other people to decide wether such code Alex> is worth having in the BBDB. Alex> Alex. Alex> *** bbdb-com.el.~1.136.~ Mon Jan 21 23:02:54 2002 Alex> --- bbdb-com.el Mon Jan 21 23:35:09 2002 Alex> *************** Alex> *** 77,85 **** Alex> 'bbdb-display-layout)) Alex> (defmacro bbdb-search (records &optional name company net notes phone) Alex> ! ;; this macro only emits code for those things being searched for; Alex> ! ;; literal nils at compile-time cause no code to be emitted. Alex> (let (clauses) Alex> ;; I didn't protect these vars from multiple evaluation because that Alex> ;; actually generates *less efficient code* in elisp, because the extra Alex> --- 77,109 ---- Alex> 'bbdb-display-layout)) Alex> + (defvar bbdb-search-invert nil Alex> + "Bind this variable to t in order to invert the result of `bbdb-search'. Alex> + Alex> + \(let ((bbdb-search-invert t)) Alex> + \(bbdb-search records foo foo))") Alex> + Alex> + (defun bbdb-search-invert-get () Alex> + "Return `bbdb-search-invert' and set it to nil. Alex> + To set it on again, use `bbdb-search-invert-set'." Alex> + (let ((result bbdb-search-invert)) Alex> + (setq bbdb-search-invert nil) Alex> + result)) Alex> + Alex> + (defun bbdb-search-invert-set () Alex> + "Set `bbdb-search-invert' to t. Alex> + This will invert the meaning of the next search command. Alex> + You will have to call this function again, if you want to Alex> + do repeated inverted searches." Alex> + (interactive) Alex> + (setq bbdb-search-invert t)) Alex> + Alex> (defmacro bbdb-search (records &optional name company net notes phone) Alex> ! "Search RECORDS for optional arguments NAME, COMPANY, NET, NOTES, PHONE. Alex> ! This macro only emits code for those things being searched for; Alex> ! literal nils at compile-time cause no code to be emitted. Alex> ! Alex> ! If you want to reverse the search, bind `bbdb-search-invert' to t." Alex> (let (clauses) Alex> ;; I didn't protect these vars from multiple evaluation because that Alex> ;; actually generates *less efficient code* in elisp, because the extra Alex> *************** Alex> *** 170,183 **** Alex> nil)) Alex> (case-fold-search bbdb-case-fold-search) Alex> (records (, records)) Alex> record) Alex> (while records Alex> (setq record (car records)) Alex> ! (if (or (,@ clauses)) Alex> ! (setq matches (cons record matches))) Alex> ! (setq records (cdr records))) Alex> (nreverse matches))))) Alex> - Alex> ;;;###autoload Alex> (defun bbdb (string elidep) Alex> --- 194,210 ---- Alex> nil)) Alex> (case-fold-search bbdb-case-fold-search) Alex> (records (, records)) Alex> + (invert (bbdb-search-invert-get)) Alex> record) Alex> (while records Alex> (setq record (car records)) Alex> ! (if (or (and invert Alex> ! (not (or (,@ clauses)))) Alex> ! (and (not invert) Alex> ! (or (,@ clauses)))) Alex> ! (setq matches (cons record matches))) Alex> ! (setq records (cdr records))) Alex> (nreverse matches))))) Alex> ;;;###autoload Alex> (defun bbdb (string elidep) Alex> _______________________________________________ Alex> [EMAIL PROTECTED] Alex> https://lists.sourceforge.net/lists/listinfo/bbdb-info Alex> BBDB Home Page: http://bbdb.sourceforge.net/ -- Adrian Aichner mailto:[EMAIL PROTECTED] http://www.xemacs.org/ _______________________________________________ [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/bbdb-info BBDB Home Page: http://bbdb.sourceforge.net/