tweaking emacs puppet mode ?

100 views
Skip to first unread message

Philip Brown

unread,
Dec 17, 2012, 3:34:11 PM12/17/12
to puppet...@googlegroups.com
I enjoy the puppet mode that comes with emacs by default.
However... people in our organization prefer a slightly different formating standard.

Would anyone be able to tell me what tweaks I could put in my .emacs file, to make it so that code gets autoformatted as


class foo {
TAB line here
TAB line here
}


So, one to change the tabstops thing, and one to make the closing brace outdent?




Steven VanDevender

unread,
Dec 17, 2012, 4:02:20 PM12/17/12
to puppet...@googlegroups.com
You might look at the customization group for "puppet", since that
should list all the variables intended for controlling its behavior (and
let you automatically change and save settings in your .emacs). I find
puppet-mode doesn't always auto-indent the closing brace the way you
(and I also) want, but if I move the closing brace back to where I want
it, puppet-mode will leave it there.

Philip Brown

unread,
Dec 17, 2012, 4:41:27 PM12/17/12
to puppet...@googlegroups.com


On Monday, December 17, 2012 1:02:20 PM UTC-8, Steven VanDevender wrote:
Philip Brown writes:
 > ...

 > So, one to change the tabstops thing, and one to make the closing brace
 > outdent?

You might look at the customization group for "puppet", since that
should list all the variables intended for controlling its behavior (and
let you automatically change and save settings in your .emacs).  I find
puppet-mode doesn't always auto-indent the closing brace the way you
(and I also) want, but if I move the closing brace back to where I want
it, puppet-mode will leave it there.


Thanks for the reply.  I'm not actually an emacs expert.. so I dont understand what "customization group" is.
I did notice that if I move the brace, it stays.. but reformatting Every Single Closing Brace manually, is really annoying.
 

Steven VanDevender

unread,
Dec 17, 2012, 4:50:38 PM12/17/12
to puppet...@googlegroups.com
Try "M-x customize-group" and answer the prompt with "puppet". Sadly
not much is documented there and there aren't a whole lot of control
variables. I suspect in this case you'd either have to mess with the
Emacs Lisp source (or at least have your own modified version of the
indentation functions). puppet-mode is kind of rudimentary but I know
the author and he would probably be amenable to improving it, if you
allow him some time.

Philip Brown

unread,
Dec 17, 2012, 7:13:09 PM12/17/12
to puppet...@googlegroups.com, ste...@uoregon.edu


On Monday, December 17, 2012 1:50:38 PM UTC-8, Steven VanDevender wrote:
puppet-mode is kind of rudimentary but I know
the author and he would probably be amenable to improving it, if you
allow him some time.

that would be most appreciated
 
Reply all
Reply to author
Forward
0 new messages