From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: emacs lisp - unable to write a function maker Date: Fri, 16 Sep 2011 19:19:08 +0800 Message-ID: <87ehzglopf.fsf@ericabrahamsen.net> References: <87pqj0q2wo.fsf@ambire.localdomain> <87iposlshu.fsf@ericabrahamsen.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1316171983 32159 80.91.229.12 (16 Sep 2011 11:19:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 16 Sep 2011 11:19:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 16 13:19:39 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R4WSF-0005Ns-9T for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Sep 2011 13:19:35 +0200 Original-Received: from localhost ([::1]:34065 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4WSE-0002Gz-NW for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Sep 2011 07:19:34 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:53545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4WSA-0002Gj-Pk for help-gnu-emacs@gnu.org; Fri, 16 Sep 2011 07:19:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4WS9-00062x-MQ for help-gnu-emacs@gnu.org; Fri, 16 Sep 2011 07:19:30 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:50952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4WS9-00062m-G8 for help-gnu-emacs@gnu.org; Fri, 16 Sep 2011 07:19:29 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1R4WS5-0005HY-Ei for help-gnu-emacs@gnu.org; Fri, 16 Sep 2011 13:19:25 +0200 Original-Received: from 125.33.7.201 ([125.33.7.201]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Sep 2011 13:19:25 +0200 Original-Received: from eric by 125.33.7.201 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Sep 2011 13:19:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 125.33.7.201 User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:GHgBYSBEL7ZyKpIWycEvU9ZHCTk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82250 Archived-At: On Fri, Sep 16 2011, C K Kashyap wrote: > Perhaps I'm ruining some didactic exercise here, but if you're > using > eval on something you don't want eval'd until the function is > run, you > should backquote it. This works for me: > > > (defun functionmaker (name form) >  (eval >   `(defun ,name () >      ,form))) > > I used to associate backquoting exclusively with macros, but I > think > that was wrong thinking. > > Hope someone will correct me if I've done something dumb here… > > > > Wow .. .This worked as I was wanting ... Could you please point me to > some documentation that would help me with things like, when to use > "," in front of the name etc? > > Regards, > Kashyap  I'm the wrong one to ask about this -- my elisp only works because of liberal sprinklings of pixie dust -- but if you read the elisp manual on macros, and keep in mind that backquoting works in contexts other than that of macros, you'll be most of the way there. What I used in this tiny example (plus the ,@ form for splicing lists) is pretty much all there is to it, though the ramifications do get complicated… Good luck! E -- GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.24.4) of 2011-04-04 on rothera, modified by Debian