help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scroll on save


From: Dmitry Alexandrov
Subject: Re: Scroll on save
Date: Tue, 14 Jul 2020 19:54:38 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Ergus <spacibba@aol.com> 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)

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]