Subject: Re: bug#35659: 26.1; Weird horizontal scroll behavior with certain settings for `auto-hscroll-mode' and `hscroll-step`.

From: Clemens Radermacher <[email-masked]>
Date: Fri, 10 May 2019 16:25:05 +0200

> I think the fact that it happens for hscroll-step of zero is "by sheer
> luck".  I certainly don't remember explicitly coding that.

Programmers need luck, too ;)

> Maybe someone will find an easy fix, volunteers are welcome.  Emacs
> really shouldn't depend for its display code development on one old
> curmudgeon such as myself...

I had some success with this workaround (ugly but it's enough for my use case):

    (defun my-temporary-change-hscroll (f &rest args)
      (setq hscroll-step 0)
      (apply f args)
      (run-at-time 0.1 nil
                   (lambda ()
                     (setq hscroll-step 1))))

    (advice-add #'previous-line :around 'my-temporary-change-hscroll)
    (advice-add #'next-line :around 'my-temporary-change-hscroll)

I would really like to dig into it but I hardly know any C and I have read several times
that the Emacs code base is reserved for advanced C programmers. Thank you for 
all the work you are doing, Emacs is such a great software!

        Clemens