all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Matt Price <matt.price@utoronto.ca>
To: matt.price@utoronto.ca
Cc: help-gnu-emacs@gnu.org
Subject: syntax:  anonymous vs. named functions
Date: Sat, 15 Nov 2008 22:42:09 -0500	[thread overview]
Message-ID: <1226806929.4606.6060.camel@localhost> (raw)
In-Reply-To: <1226766956.4606.4915.camel@localhost>

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




  reply	other threads:[~2008-11-16  3:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.201.1226528857.26697.help-gnu-emacs@gnu.org>
2008-11-12 23:08 ` starting an external command from emacs Dan Espen
2008-11-13  3:48   ` Matt Price
     [not found]   ` <mailman.217.1226563070.26697.help-gnu-emacs@gnu.org>
2008-11-13 13:54     ` Dan Espen
2008-11-13 15:50 ` Xah
2008-11-14 13:24   ` break a chunk of text into a list of lines Matt Price
2008-11-14 15:33   ` starting an external command from emacs Matt Price
     [not found]   ` <mailman.359.1226672766.26697.help-gnu-emacs@gnu.org>
2008-11-14 19:33     ` break a chunk of text into a list of lines Xah
2008-11-14 20:43     ` Andreas Politz
2008-11-15 16:35       ` interactive function: generate tab-completion list with another function Matt Price
2008-11-16  3:42         ` Matt Price [this message]
2008-11-16  8:01           ` syntax: anonymous vs. named functions Drew Adams
2008-11-16 15:48             ` Matt Price
2008-11-17  1:06               ` Drew Adams
     [not found]               ` <mailman.552.1226883997.26697.help-gnu-emacs@gnu.org>
2008-11-17  8:08                 ` Andreas Politz
     [not found]   ` <mailman.365.1226676836.26697.help-gnu-emacs@gnu.org>
2008-11-14 19:43     ` starting an external command from emacs Xah
2008-11-14 20:31     ` Andreas Politz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1226806929.4606.6060.camel@localhost \
    --to=matt.price@utoronto.ca \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.