From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matt Price Newsgroups: gmane.emacs.help Subject: RE: pymacs & interactivel isp functions Date: Sat, 22 Nov 2008 16:07:51 -0500 Organization: History Department, University of Toronto Message-ID: <1227388071.16060.698.camel@localhost> References: <1227111389.17262.159.camel@localhost> <000801c94a6d$7d216100$c2b22382@us.oracle.com> <1227343194.20766.717.camel@localhost> <000f01c94cb6$d5ac5690$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1227388152 25194 80.91.229.12 (22 Nov 2008 21:09:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Nov 2008 21:09:12 +0000 (UTC) Cc: 'help-gnu-emacs' To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 22 22:10:14 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L3zk4-0002h3-RV for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Nov 2008 22:10:13 +0100 Original-Received: from localhost ([127.0.0.1]:49189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3ziv-0003FV-OB for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Nov 2008 16:09:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3zhv-0002x2-UC for help-gnu-emacs@gnu.org; Sat, 22 Nov 2008 16:08:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3zhu-0002wL-O1 for help-gnu-emacs@gnu.org; Sat, 22 Nov 2008 16:07:59 -0500 Original-Received: from [199.232.76.173] (port=46806 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3zhu-0002wF-Ja for help-gnu-emacs@gnu.org; Sat, 22 Nov 2008 16:07:58 -0500 Original-Received: from bureau60.ns.utoronto.ca ([128.100.132.147]:52875) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L3zhu-0002j6-JE for help-gnu-emacs@gnu.org; Sat, 22 Nov 2008 16:07:58 -0500 Original-Received: from anarres.mercey.org (CPE001d7e1d5798-CM0014f8cd1c4c.cpe.net.cable.rogers.com [173.32.83.31]) (authenticated bits=0) by bureau60.ns.utoronto.ca (8.13.8/8.13.8) with ESMTP id mAML7r4e005713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 22 Nov 2008 16:07:55 -0500 Original-Received: by anarres.mercey.org (Postfix, from userid 1000) id C6A751203A4; Sat, 22 Nov 2008 16:07:52 -0500 (EST) In-Reply-To: <000f01c94cb6$d5ac5690$0200a8c0@us.oracle.com> X-Mailer: Evolution 2.24.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:60028 Archived-At: On Sat, 2008-11-22 at 07:27 -0800, Drew Adams wrote: > Dunno. Your function that does all of the completion, > `edsquery-return-addresslist' isn't shown. > that code is python. here it is, but i don't think it's the problem (see next bit below): def return_addresslist (queryterm, predicate, buff): results = abook.search(queryterm) names =[] for record in results: name = record.get_name() address = record.get_property('email_1') names.append(name + " " + "<" + address +">") for i in ["2","3"]: if record.get_property('email_' + i): address = record.get_property('email_' + i) record.get_property('email_' + i) names.append(name + ' '+ "<" + address +">") return names it just returns a list of strings, which is what i thought completing-read wanted to receive. > The error message is saying that function `ad-Orig-minibuffer-complete' expected > a number or a marker but received the list of strings. > i think ad-Orig-minibuffer-complete comes from the minibuffer-complete-cycle package; i've taken out references to it in my .emacs for now. but my issue persists. > You also apparently advised the standard function `minibuffer-complete', and > that code isn't shown either. So it's difficult to guess what is the problem. i think this came from minibuffer-complete-cycle. > > i'm not sure, but it looks like it isn't breaking the cdr > > cell down into its components before evaluating it? > > suggesting to me that, again, there's something wrong with my syntax. > > No comprendo. What isn't breaking what cdr cell down into what components? > um, i'm sure i just don't know what i'm talking about... > FWIW, I see nothing wrong with the call to completing-read. The problem is > likely in your completion function `edsquery-return-addresslist'. or in my understanding of completing-read, see below. > > > i appreciate the remedial lisp lessons. sorry to just continue not > > getting it... thanks again, > > The error message should help. Look at your advised version of > `minibuffer-complete', `ad-Orig-minibuffer-complete', and see why and where it > expects a number or marker. Look at why your function `eds...' gives it a list > of strings in that place instead. Perhaps try unadvising `minibuffer-complete', > at least for testing. hmm, i thought i wanted edsquery to give a list of strings. i have the following trivial code which is still giving the same kind of error, and i think probably illustrates my conceptual error, whatever it is: ( matt/external-addressbook-completion (stub) "get a list of addresses for tab-completion in a new email" (interactive (list (completing-read "Name: " #'static-list ;; collection nil t)))) (defun static-list (s p n) '("matt1" "matt2" "matt3")) (setq collection '("matt1" "matt2" "matt3")) if i let 'collection' serve as the collection, the function works as expected; but if 'static list' is called instead, i once again have a type error: minibuffer-complete: Wrong type argument: number-or-marker-p, ("matt2" "matt3") my confusion, i guess, is that I'd thought the two should evaluate to the same list '("matt1" "matt2" "matt3"). clearly i'm misunderstanding something but it's the kind of conceptual error i have trouble finding an answer for in the documentation. thanks again. you should feel free to drop me, though, drew -- i appreciate all your efforts. matt -- Matt Price matt.price@utoronto.ca