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

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

Re: CC-Mode, Skeletons, Abbrevs and correct indentation


From: Gabriel Foster
Subject: Re: CC-Mode, Skeletons, Abbrevs and correct indentation
Date: Wed, 28 Aug 2002 07:59:53 -0700

Hmmm...

No one seems to have a clue about how to solve this issue, or if they do, they are not responding to this message. I believe something is broken here, because the skeletons are not working as documented... In any case, has someone succeeded in doing what I am trying to do using ANY method?

Thanks,

        Gabriel


On Monday, August 26, 2002, at 09:00 AM, Gabriel Foster wrote:

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
        address@hidden






reply via email to

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