all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Alexandrov <dag@gnui.org>
To: Ergus <spacibba@aol.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Scroll on save
Date: Tue, 14 Jul 2020 19:54:38 +0300	[thread overview]
Message-ID: <pn8yox4h.dag@gnui.org> (raw)
In-Reply-To: <20200713223521.jbjgmzyxxp2w45ot@Ergus> (Ergus's message of "Tue,  14 Jul 2020 00:35:21 +0200")

[-- Attachment #1: Type: text/plain, Size: 1116 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

      parent reply	other threads:[~2020-07-14 16:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200713223521.jbjgmzyxxp2w45ot.ref@Ergus>
2020-07-13 22:35 ` Scroll on save Ergus
2020-07-13 22:38   ` Narendra Joshi
2020-07-13 22:39     ` Narendra Joshi
2020-07-14 10:32     ` Ergus
2020-07-14 16:13       ` Narendra Joshi
2020-07-13 23:00   ` Óscar Fuentes
2020-07-14 10:34     ` Ergus
2020-07-14 12:26       ` Tomas Nordin
2020-07-14 16:54   ` Dmitry Alexandrov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pn8yox4h.dag@gnui.org \
    --to=dag@gnui.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=spacibba@aol.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.