[refmt.el] Use write extention when formatting files (#367)
[refmt.el] Use write extention when formatting files (#367)

In refmt.el, we copy current buffer into a tmp file and apply refmt to it.
Previously we only copy the buffer as ".re" files, this reports syntax errors
on ".rei" files.

This patch checks the extention of the current buffer, and creates
a tmp file with the right extention.
cristianoc/reason,yunxing/reason,yunxing/reason,yunxing/reason,let-def/reason,ak3n/reason,cristianoc/reason,cristianoc/reason,ak3n/reason,chenglou/reason,facebook/reason,let-def/reason,let-def/reason,ak3n/reason,facebook/reason,ak3n/reason,yunxing/reason,chenglou/reason,facebook/reason,chenglou/reason