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

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

CC-Mode, Skeletons, Abbrevs and correct indentation


From: Gabriel Foster
Subject: CC-Mode, Skeletons, Abbrevs and correct indentation
Date: Mon, 26 Aug 2002 09:00:28 -0700

Greetings,

I'm trying to get abbrev's for if, while, for, and others to work with cc-mode and skeletons. I'm having troubles getting the indentation to work correctly, and was hoping someone could point out the right direction to go. My definitions go as follows:

(define-skeleton my-skel-c-if-stmt
  "Insert an if statement template."
  nil
  >"if ( " _ " )"?\n
  >"{"?\n
  ?\n
  >"}"?\n
  )
(define-abbrev c++-mode-abbrev-table "if" "" my-skel-c-if-stmt)o

Given my current cc-mode setup, my if's should look like

main( )
{
    if (  )
    {

    }

// but what I end up with is:
    if (  )
        {

            }

}

I've tried various combinations of >, \n and ?\n, but with no luck so far. Can anyone see a way to fix this?

Thanks,

        Gabriel
        gabriel@apple.com





reply via email to

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