From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Using passing the tempo-template user input to my function? Date: Tue, 26 Oct 2004 09:49:52 -0600 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <2u7a14F27qaajU1@uni-berlin.de> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1098805991 10707 80.91.229.6 (26 Oct 2004 15:53:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Oct 2004 15:53:11 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 26 17:53:06 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CMTdC-0001QK-00 for ; Tue, 26 Oct 2004 17:53:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CMTkt-0005ZD-1y for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Oct 2004 12:01:03 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.wirehub.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 57 Original-X-Trace: news.uni-berlin.de 60AwvWSLdxwJoDs7z0bYLQGjNtTfTYdEDvLd+IBcL+SJcwiyQ= User-Agent: Mozilla Thunderbird 0.8 (X11/20040916) X-Accept-Language: en-us, en In-Reply-To: Original-Xref: shelby.stanford.edu gnu.emacs.help:126074 Original-To: help-gnu-emacs@gnu.org 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: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:21452 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:21452 Hattuari wrote: > I've tried all the ways I can come up with to pass the string returned from > querying the user to my own function. I know the string is there, I can > paste it into the text at the point where I'm trying to paste a modified > version. > > This is an example of code that pastes the original user text: > > (tempo-define-template > "array" > '("typedef array<" > (P "Data type: " data-type) > "," > (P "Number of components: 1 to 4 " data-order) > "> Array" (s data-type))) > ;; ,----[ C-h f tempo-define-template RET ] | tempo-define-template is a compiled Lisp function in `tempo'. | (tempo-define-template NAME ELEMENTS &optional TAG DOCUMENTATION TAGLIST) | | Define a template. | This function creates a template variable `tempo-template-NAME' and an | interactive function `tempo-template-NAME' that inserts the template | at the point. The created function is returned. ... | The elements in ELEMENTS can be of several types: ... | - The symbol 'p. This position is saved in `tempo-marks'. ... | - (p PROMPT ) If `tempo-interactive' is non-nil, the | user is prompted in the minbuffer with PROMPT for a string to be | inserted. If the optional parameter NAME is non-nil, the text is | saved for later insertion with the `s' tag. If there already is | something saved under NAME that value is used instead and no | prompting is made. If NOINSERT is provided and non-nil, nothing is | inserted, but text is still saved when a NAME is provided. For | clarity, the symbol 'noinsert should be used as argument. | - (P PROMPT ) Works just like the previous tag, but | forces tempo-interactive to be true. ... | - (s NAME) Inserts text previously read with the (p ..) construct. | Finds the insertion saved under NAME and inserts it. Acts like 'p | if tempo-interactive is nil. ... If tempo-interactive is nil, perhaps you need to do something like (let ((tempo-interactive t)) (tempo-define-template ...)) which would also allow you to use (p ...) instead of (P ...) in your template. -- Kevin Rodgers