@ashnur already a answer ?
?
a answer to your emacs question ?
i just don't use parinfer now
also a solution but I think parinfer can take care that you do not come into problems with parentheses with more complex functions
that's why i started with that