Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • I don't have an answer but a reason why: "Pasting" in a terminal is not like pasting normally, it is actually more like executing a keyboard macro. In this case newlines are autoindenting like they would if you were typing, and then the tabs are beings inserted in already indented lines. You might also notice this if you use key-chords, ie. if you have a ea key-chord, then pasting the word each will execute it. Because of this, I use my own paste function in terminal that just runs: (insert (shell-command-to-string "pbpaste -Prefer txt"))) which works on my osx system. Commented Mar 16, 2015 at 0:47
  • What happens if you just press return in a buffer with newline mode? If it indents then, you might have been hit by a bug. Check the value of indent-line-function. Commented Mar 16, 2015 at 11:21
  • the next line will inherit the indent of the current line. @MeaningfulUsername. Don't know how to check the value of indent-line-function. Commented Mar 16, 2015 at 12:09
  • C-h v indent-line-function. It doesn't seem you're hit by the bug I was thinking of, since then it would keep on indenting. It was the stair like appearance of your example I recognized. Commented Mar 16, 2015 at 12:21
  • its value is indent-relative. @MeaningfulUsername. Does it explain my problem? Commented Mar 16, 2015 at 12:29