Customize Emacs Ruby Mode for PuppetLabs conifguration

view full story

http://unix.stackexchange.com – I predominantly use emacs for editing my Puppet configuration files. I use the following settings in my .emacs to load Ruby mode and use it for Puppet config files (*.pp): (autoload 'ruby-mode "ruby-mode" "Major mode for editing ruby scripts." t) (setq auto-mode-alist (cons '(".rb$" . ruby-mode) auto-mode-alist)) (setq auto-mode-alist (cons '(".pp$" . ruby-mode) auto-mode-alist)) This works well except for the the indentation of the 'ensure' directive in my puppet files. Because ensure is a reserved word in Ruby, it outdents it: cron { logrotate: command => "/usr/sbin/logrotate", (HowTos)