Subject: Re: bug#12253: Restore window start position

From: Juri Linkov <[email-masked]>
Date: Wed, 10 Jan 2024 19:16:43 +0200

>>> This is not helpful.  It was many years ago, and I don't remember the details.
>>> In bug#12253 there is a patch that restores the window position
>>> when navigating back in Info history.  I could try to rebase it
>>> if there is still an interest in such improvement.
>>
>> I think you should try to do that.  Any sort of navigation should
>> restore window start and window point positions whenever possible.
>
> Did you make any progress with this?

With Info history or with Isearch history?

Here is how to restore the window position
when navigating back in Isearch history:

#+begin_src emacs-lisp
(setq isearch-push-state-function
      (lambda ()
        ;; Recenter new search hits outside of window boundaries
        (when (and isearch-success
                   (not (pos-visible-in-window-p)))
	  (recenter))
        `(lambda (cmd)
           (when isearch-success
             (set-window-start nil ,(window-start))))))
#+end_src