From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Johnson Newsgroups: gmane.emacs.help Subject: Re: Skeleton With Embedded Quotes Date: Tue, 22 Nov 2005 07:32:37 -0900 Message-ID: <20051122163237.GB1828@johnsons-web.com> References: <1132522006.284995.262890@g47g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1132681367 18281 80.91.229.2 (22 Nov 2005 17:42:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 22 Nov 2005 17:42:47 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 22 18:42:36 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eec7B-00075I-57 for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Nov 2005 18:39:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eec7A-0001mv-Cv for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Nov 2005 12:39:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Eeb7d-00011T-5B for help-gnu-emacs@gnu.org; Tue, 22 Nov 2005 11:35:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Eeb7a-0000uV-Ps for help-gnu-emacs@gnu.org; Tue, 22 Nov 2005 11:35:56 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eeb7a-0000tI-B5 for help-gnu-emacs@gnu.org; Tue, 22 Nov 2005 11:35:54 -0500 Original-Received: from [208.218.214.5] (helo=postoffice.cniweb.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Eeb7a-00084Q-65 for help-gnu-emacs@gnu.org; Tue, 22 Nov 2005 11:35:54 -0500 Original-Received: from linus.johnson.com (rdbck-static-445.palmer.mtaonline.net [64.4.232.191]) by postoffice.cniweb.net (8.13.5/8.13.5) with ESMTP id jAMGZNw7013116 for ; Tue, 22 Nov 2005 11:35:24 -0500 (EST) Original-Received: from linus.johnson.com (localhost.johnson.com [127.0.0.1]) by linus.johnson.com (8.12.8/8.12.8) with ESMTP id jAMGWbDG005589 for ; Tue, 22 Nov 2005 07:32:37 -0900 Original-Received: (from tim@localhost) by linus.johnson.com (8.12.8/8.12.8/Submit) id jAMGWblf005587 for help-gnu-emacs@gnu.org; Tue, 22 Nov 2005 07:32:37 -0900 Original-To: help-gnu-emacs@gnu.org Mail-Followup-To: Tim Johnson , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <1132522006.284995.262890@g47g2000cwa.googlegroups.com> User-Agent: Mutt/1.4.2.1i 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:31252 Archived-At: * gamename [051120 12:37]: > Hi, Hello: > I'm trying to create a skeleton for a debug statement in tcl. I want > the skeleton to produce something like this: > > mylib::debug " " > > (The cursor would be placed between the quotations.) > > Unfortunately, skeleton uses double quotes as the delimiter for its own > definition. So, how do you get skeleton to print double quotes? Here > is what I have so Far: I'm not entirely sure what you are up to here, since your approach differs from mine, but you can escape a double quote with a backslash. I use the elisp 'insert function for inserting debug stubs. > > (define-skeleton tcl-debug > "Tcl debug statement" nil > > "mylib::debug " \ \n) You might find the code below useful as an example - bear in mind, that I am pretty new to elisp. (defun debug-stub-global () " Insert debugging code for non-class variable" (interactive "*") (cond ((string-equal mode-name "Rebol Mode") (beginning-of-line-text) (insert "dbg ") (tj-next-whitespace) (insert " ;; DEBUG STUB")) ((string-equal mode-name "JavaScript") (let (cur-word) (setq cur-word (current-word)) (beginning-of-line-text) (kill-line) (insert (concat "alert('" cur-word ": ' + " cur-word ");")))) ((string-equal mode-name "Python") (let (cur-word) (setq cur-word (current-word)) (beginning-of-line-text) (kill-line) (insert (concat "print \"
" cur-word " = \", " cur-word " # DEBUG " cur-word)))) (t(message "NOT IMPLEMENTED FOR THIS MODE!")))) ;; this should be the only dependency: (defun tj-next-whitespace () "Move cursor to next whitespace OR end of line." (interactive) (re-search-forward "$\\|[\t ]")) HTH -- Tim Johnson http://www.alaska-internet-solutions.com