From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Bruce Ashfield Newsgroups: gmane.emacs.help Subject: Re: Slickedit features in Emacs? Date: Thu, 22 May 2003 08:38:02 -0400 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <20030522123802.GA19286@zedd.org> References: <87e77d96.0305211059.3e15858a@posting.google.com> <87e77d96.0305212307.60c099ef@posting.google.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1053609127 12887 80.91.224.249 (22 May 2003 13:12:07 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 22 May 2003 13:12:07 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Thu May 22 15:12:05 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19IpqU-0003Gn-00 for ; Thu, 22 May 2003 15:10:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Ipdb-0008TM-A9 for gnu-help-gnu-emacs@m.gmane.org; Thu, 22 May 2003 08:57:39 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19IpdQ-0008Sf-HI for help-gnu-emacs@gnu.org; Thu, 22 May 2003 08:57:28 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19IpWO-00071F-Ry for help-gnu-emacs@gnu.org; Thu, 22 May 2003 08:50:43 -0400 Original-Received: from ashfield.istop.com ([66.11.173.38] helo=zedd.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19IpKd-0003Gf-LA for help-gnu-emacs@gnu.org; Thu, 22 May 2003 08:38:03 -0400 Original-Received: from bruce by zedd.org with local (Exim 4.12) id 19IpKc-0005j3-00; Thu, 22 May 2003 08:38:02 -0400 Original-To: Henrik@zedd.org, J@zedd.org Content-Disposition: inline In-Reply-To: <87e77d96.0305212307.60c099ef@posting.google.com> User-Agent: Mutt/1.3.25i X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10020 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10020 Hi, abbrev is using the current modes definition of a word to trigger autocomplete. I added the following in my .emacs files: ;; modifying the syntax table to put ":" in the word constituent ;; table. This allows abbrev mode to use colon's as part of expansions (modify-syntax-entry ?: "w" c-mode-syntax-table) (define-abbrev c-mode-abbrev-table ":hstart" "" 'tempo-template-c-header-start) You would have to do the same thing with "(" if you want it to trigger. But making these changes will impact any other operations that work on "words" in your mode. i.e. delete word would now snack on your "if(" and not just if. That's just my understanding, I'm sure I'll be corrected if I'm wrong. Cheers, Bruce In message: Re: Slickedit features in Emacs? on May 22 Henrik J?nsson wrote: > Benjamin Rutt wrote in message news:... > > henrik.jonsson@se.transport.bombardier.com (Henrik Jönsson) writes: > > > > > My initial question was of course if the functions in Slickedit a full if template. Can this be done with > > > skeletons? > > > > Yes, you just combine skeletons with abbrev. I like to type "ifx " to > > expand my template in C mode: > > > > (define-skeleton my-skeleton-c-if > > "Insert a c if statement" nil > > "if (" > _ ")" \n > > "{" '(indent-for-tab-command) \n > > \n > > "}" '(indent-for-tab-command)) > > (define-abbrev c-mode-abbrev-table "ifx" "" 'my-skeleton-c-if) > > > > Nice! Binding this to "ifx" works great. But I can't get it to bind to > "if(". Is it possible? > > /henrik > _______________________________________________ > Help-gnu-emacs mailing list > Help-gnu-emacs@gnu.org > http://mail.gnu.org/mailman/listinfo/help-gnu-emacs -- Bruce Ashfield | "Thou shalt not follow the NULL pointer, for ashfield@computer.org | chaos and madness await thee at its end." bruce@zedd.org | - unknown