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

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

bug#23079: 25.0.92; Movement commands leave cursor in invisible line


From: Stefan Monnier
Subject: bug#23079: 25.0.92; Movement commands leave cursor in invisible line
Date: Tue, 22 Mar 2016 21:59:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

>       (let ((inhibit-read-only t)
>             (deactivate-mark nil)
>             (selection (magit-region-sections)))
>         (mapc #'delete-overlay magit-section-highlight-overlays)
>         (setq magit-section-unhighlight-sections
>               magit-section-highlighted-sections
>               magit-section-highlighted-sections nil)
>         (unless (eq section magit-root-section)
>           (run-hook-with-args-until-success
>            'magit-section-highlight-hook section selection))
>         (--each magit-section-unhighlight-sections
>           (run-hook-with-args-until-success
>            'magit-section-unhighlight-hook it selection))
>         (restore-buffer-modified-p nil)

Hmm... what kind of buffer modifications might happen in here?
I think this might be the problem: point-adjustment is only applied after
"movement commands" and is disabled if the buffer was modified during
the course of the command (including post-command-hook).
[ This is mostly due to the simplistic way we keep track of the
  "previous state", which we can't trust if the buffer was modified.  ]

> This function doesn't move point, but it somehow interferes with point
> adjustment in another way.

It's difficult to adjust point without risking adverse effects in corner
cases (typically problems like "repeated C-n gets stuck" or "forward-foo
moves backward"), so point-adjustment is conservative to try and make
sure it's only done when we're sure it's "safe".


        Stefan





reply via email to

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