Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

share|improve this answer

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
Yes, the problem persists for me: emacs 24, OSX 10.10. – joelparkerhenderson Jan 6 '15 at 5:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.