unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Bruce Ashfield <bruce@zedd.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Slickedit features in Emacs?
Date: Thu, 22 May 2003 08:38:02 -0400	[thread overview]
Message-ID: <20030522123802.GA19286@zedd.org> (raw)
In-Reply-To: <87e77d96.0305212307.60c099ef@posting.google.com>

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	other threads:[~2003-05-22 12:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-21 18:59 Slickedit features in Emacs? Henrik Jönsson
2003-05-21 19:08 ` Phillip Lord
2003-05-21 19:29 ` Benjamin Rutt
2003-05-22  7:07   ` Henrik Jönsson
2003-05-22 12:38     ` Bruce Ashfield [this message]
2003-05-22 14:14     ` Stefan Monnier
2003-05-22 17:12     ` Peter Lee
2003-05-22 19:42       ` Mark Mynsted
2003-05-22 20:04         ` Peter Lee
2003-05-22 20:23           ` Kai Großjohann
2003-05-22 20:52           ` Mark Mynsted
2003-05-22 21:03             ` Stefan Monnier
2003-05-23 13:38               ` Mark Mynsted
2003-05-23 15:44                 ` Peter Lee
2003-05-21 19:34 ` Peter Lee
2003-05-21 19:38 ` Burton Samograd
2003-05-21 20:30 ` Stefan Monnier
2003-05-22 13:56   ` Benjamin Rutt
2003-05-21 20:53 ` Ole Laursen
2003-05-22 15:31 ` Kai Großjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030522123802.GA19286@zedd.org \
    --to=bruce@zedd.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).