views:

428

answers:

2

When i'm trying to paste some code from browser to Emacs, it will indent code automatically, is there any way to stop Emacs from indenting temporarily like :set paste in vim?

A: 

You could try

c-toggle-syntactic-indentation
mamboking
c-toggle-syNtactic-indentation
PanCrit
Thanks for catching the typo. Fixed.
mamboking
+3  A: 

Switch into the *scratch* buffer (or just to some nonexistent buffer; it will be in Fundamental mode, which shouldn't do any autoindentation unless you have somehow configured it to do so), type C-SPC to start the region, paste your text, type C-w to cut it within Emacs, switch back to your original buffer, type C-y to paste.

Jouni K. Seppänen