Take the 2-minute tour ×

I am using Emacs 24 for MacOSX and having some problem with pasting code from clipboard to Emacs. The code that I selected usually already nicely formatted (with tab, ident, ...). However, when I paste it to Emacs, Emacs re-do the formatting so it is extremely slow for thousands lines of code.

Is there any suggestion for pasting from clipboard?

Thank you.

share|improve this question
add comment

2 Answers

try: c-toggle-syntactic-indentation before your paste.

share|improve this answer
add comment

I use clipboard-yank and clipboard-kill-region to interact with the clipboard from inside emacs. I never had indentation problems.

Does the problem persist when you use these two functions?

share|improve this answer
add comment

Your Answer


