Ergus wrote: > when I save long files (C-x C-s); for some reason emacs scrolls to some different place in the buffer. I am pretty sure that it should has to do with my config, but I don't know where to start looking for the problem. (defvar movement-primitives '(forward-comment re-search-backward goto-char move-to-column vertical-motion skip-syntax-backward search-forward backward-prefix-chars recenter forward-word skip-chars-forward forward-line re-search-forward end-of-line set-window-hscroll posix-search-forward move-to-window-line skip-syntax-forward search-backward backward-char posix-search-backward set-window-start beginning-of-line skip-chars-backward search-forward-regexp move-point-visually search-backward-regexp forward-char set-window-point) "C primitives that can move a point yet not edit the buffer (I hope I enumerated them all)") (advice-add #'basic-save-buffer-1 ; before-save-hook is too early :after (lambda () (mapc #'debug-on-entry movement-primitives))) (add-hook 'after-save-hook #'cancel-debug-on-entry)