So here is (in attachment) a first patch proposal.
I used anonymous enum as Nick wished.
Moreover, I droped the editor_prefs.complete_snippets test in the auto_close_chars function (ex. auto_close_bracket) as it seems there's no relation between auto-closing chars and auto-complete snippets.
I only built/tested this code under Linux.
Thanks for your feedbacks !