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: syntax: anonymous vs. named functions Date: Sat, 15 Nov 2008 22:42:09 -0500 Organization: History Department, University of Toronto Message-ID: <1226806929.4606.6060.camel@localhost> References: <3d16ac18-967c-4511-8c9c-9a80c40c3d8e@x16g2000prn.googlegroups.com> <1226695506.850373@arno.fh-trier.de> <1226766956.4606.4915.camel@localhost> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1226806964 12404 80.91.229.12 (16 Nov 2008 03:42:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Nov 2008 03:42:44 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: matt.price@utoronto.ca Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 16 04:43:47 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 1L1YY6-0004xl-3T for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Nov 2008 04:43:46 +0100 Original-Received: from localhost ([127.0.0.1]:56641 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L1YWx-0001hD-JX for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Nov 2008 22:42:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L1YWg-0001h8-TJ for help-gnu-emacs@gnu.org; Sat, 15 Nov 2008 22:42:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L1YWf-0001gw-1S for help-gnu-emacs@gnu.org; Sat, 15 Nov 2008 22:42:18 -0500 Original-Received: from [199.232.76.173] (port=53162 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L1YWe-0001gt-UA for help-gnu-emacs@gnu.org; Sat, 15 Nov 2008 22:42:16 -0500 Original-Received: from bureau61.ns.utoronto.ca ([128.100.132.151]:37050) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L1YWe-000480-OM for help-gnu-emacs@gnu.org; Sat, 15 Nov 2008 22:42:16 -0500 Original-Received: from anarres.mercey.org (CPE001d7e1d5798-CM0014f8cd1c4c.cpe.net.cable.rogers.com [173.32.83.31]) (authenticated bits=0) by bureau61.ns.utoronto.ca (8.13.8/8.13.8) with ESMTP id mAG3gCox017672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 15 Nov 2008 22:42:15 -0500 Original-Received: by anarres.mercey.org (Postfix, from userid 1000) id 53423120352; Sat, 15 Nov 2008 22:42:10 -0500 (EST) In-Reply-To: <1226766956.4606.4915.camel@localhost> 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:59824 Archived-At: I have working code for my tab-completion problem (again thanks to everyone for answering my painfully stupid questions). i don't understand, though, why attempts to write my function as an unnamed lambda fails, but the same function succeeds when named. the "lambda" line commented out in tab-complete-from-function below returns an error "test-completion: Invalid function", while the uncommented call to a different, trivial function is successful. cna anyone advise me why? thanks much! matt (defun tab-complete-from-function (stub) "very simple tab completion function" (interactive (list (completing-read "Name: " ;; (lambda (string) (split-string (shell-command-to-string (concat "/home/matt/mutt-eds-query " string)) "\n" t)) (do-completion (string)) nil t))) (message stub)) (defun do-completion (stub) "minimal function" (split-string (shell-command-to-string (concat "/home/matt/mutt-eds-query " stub)) "\n" t)) > > -ap -- Matt Price matt.price@utoronto.ca