Re: bbdb-search is a macro
Bob Newell <[email protected]> Thu, 10 Aug 2023 18:34:49 -1000
| Newsgroups | gmane.emacs.bbdb.user |
|---|---|
| Organization | Avi Gobbler Publishing |
| Message-ID | <[email protected]> |
Bob Newell <[email protected]> writes: > I'm wondering why (in my ignorance) in bbdb-com.el, > bbdb-search is a very long defmacro and not a defun. Here's > why. On my Emacs implementations on a Termux phone and > tablet, Emacs 28.3, the following code, which works on Emacs > 28/29 on my Arch systems > > (setq person (car (bbdb-search (bbdb-records) :mail netaddr))) > > throws an error saying "bbdb-search invalid-function". > "netaddr" is of course previously defined. > > I think this has to do with bbdb-search being a macro and not > a function. Maybe? > > Any thoughts? Or is this just too unclear? > > I'm baffled why it works on one group of systems and not > another. Never mind. It's an age-old problem. Yes, it does have to do with bbdb-search being a macro (which it turns out is necessary) and with byte-compiling. A macro must be defined BEFORE byte-compiling a routine in which the macro is called. I was getting seeming random results on different machines because of compilation order. Adding (require 'bbdb) (require 'bbdb-com) at the top solved this right away. -- Bob Newell Honolulu, Hawai`i - Via GNU/Linux/Emacs/Gnus/BBDB