When using ESS under emacs for writing R code, is useful to have the default behavior os having '_' substituted by '<-' (inserting two consecutive '_' would insert the underscore itself). But when pasting code to any buffer in ESS-mode, this substituion also happens and any '_' gets substituted by '<-' and this is not a desired behavior by me.
Is there a way of preventing the substitution only when pasting text?
At the moment I have fully disabled the substitution adding this code to my .emacs
(ess-toggle-underscore nil)
But I would like to recover the '_' to '<-' substitution only when writing not when pasting.
Any idea?