point moves when switching buffers in emacs (Aquamacs)

128 Views Asked by At

Like every emacs user I am constantly switching between buffers, and it's pretty important that the point (cursor) stays where I last edited the file. However, every now and then emacs enters a state where switching between buffers jumps the point to a different location. That is, I'm editing buffer A at line 3043, I switch to buffer B (C-x b), switch back to A, point is now at line 200 (or whatever).

The only solution I have found is to restart emacs (Aquamacs), which is obviously less than ideal. Any ideas on how to fix this, or even where the point position information is stored by emacs?

1

There are 1 best solutions below

2
On

My first guess would be what @legoscia mentioned: multiple windows for the same buffer, with different window points. Experiment to see if this isn't what is happening. See the

Other than that, yes, @Lindydancer is right in recommending that you narrow this down to something reproducible starting with emacs -Q (no init file). There might well be an Emacs bug or an Aquamacs bug, but you first have to rule out something else coming from your init file (~/.emacs).

Narrow it down (e.g., by bisecting your init file recursively, if you cannot repro the problem without the init file). Then, if it is an Emacs problem, report it to Emacs Dev: M-x report-emacs-bug. If it is an Aquamacs but then report it to the Aquamacs maintainers.

As it stands now, your question is too broad for people here to help much. But please do follow up, not only to solve your problem but, if there is a bug, to report it and get it fixed at the source.

FWIW, I've filed an Emacs doc bug report about this, asking that the Emacs manual be more clear about the notion of window-point.