I'm currently using Emacs 24.0.91.1 and every once in a while, the cursor behavior changes when I am in c-mode (with auto-fill-mode enabled).
What I want is for the cursor to stay on the same column when I move one line up/down. However, every once in a while, it jumps to position 0, which I find highly annoying. Any tips on how to disable this?
I found myself in this same situation when jamming a lot of keys into my emacs windows without being too careful. However, I noticed that it would keep reverting my cursor to a particular column, not necessarily column 0. Like the OP, I originally resorted to killing and reopening the buffer to clear this behavior. However, after searching, I realized that I must have accidentally typed C-x C-n when trying to rapidly jam some commands, resulting in accidentally invoking
set-goal-column
.emacs manual: Moving Point:
When invoking this command, I get the following output in emacs’s
*Messages*
buffer:To supply C-x C-n with an argument and remove this effect, you may supply the argument using a “numeric prefix argument”. For example, C-0 C-x C-n (supplying a numeric prefix argument of
0
) clears the semipermanent goal column.