[Top][All Lists]

[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


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."
  >"if ( " _ " )"?\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?



reply via email to

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