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

From: Eli Zaretskii <[email-masked]>
Date: Wed, 23 Mar 2016 05:41:18 +0200

> From: Stefan Monnier <[email-masked]>
> Date: Tue, 22 Mar 2016 21:59:38 -0400
> Cc: [email-masked], [email-masked]
> 
> >       (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?

Deletion of overlays, perhaps?  And there are all those hooks which
might not be nil.