help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slickedit features in Emacs?


From: Bruce Ashfield
Subject: Re: Slickedit features in Emacs?
Date: Thu, 22 May 2003 08:38:02 -0400
User-agent: Mutt/1.3.25i

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 <rutt+news@cis.ohio-state.edu> wrote in message 
> news:<wc3addgrtd8.fsf@gamma.cis.ohio-state.edu>...
> > 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]