Augeas is a tool to surgically edit Unix configuration files. The augeas type in Puppet allows changing single entries in a configuration file instead of deploying the whole file as a monolithic blob.
Augeas understands a lot of different configuration file formats but you may need to write Augeas code yourself if you want to parse your own file format. I didn't find an Emacs major mode for Augeas so I started writing my own. It is currently still at an early stage. You can find the code at https://github.com/smoeding/emacs-augeas-mode.