GNU bug report logs - #27008
26.0.50; auto-hscroll-mode and scroll-left

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Sun, 21 May 2017 14:11:02 UTC

Severity: minor

Found in version 26.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: stephen.berman <at> gmx.net
Cc: 27008 <at> debbugs.gnu.org
Subject: bug#27008: 26.0.50; auto-hscroll-mode and scroll-left
Date: Tue, 30 May 2017 20:31:38 +0300
> Date: Tue, 30 May 2017 20:18:27 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 27008 <at> debbugs.gnu.org
> 
> > From: Stephen Berman <stephen.berman <at> gmx.net>
> > Cc: 27008 <at> debbugs.gnu.org
> > Date: Tue, 30 May 2017 18:57:01 +0200
> > 
> > Thanks very much for pursuing this.  I updated my master branch, applied
> > your patch and rebuilt, but when I executed the recipe of my OP, I saw
> > the same effect with the patch as without it: only the current line
> > respects w->min_hscroll, the other are displayed from BOL.  I'd be happy
> > to try and help diagnose this further, if you can advise me what to do.
> 
> I don't have any advice, because your recipe worked for me after the
> changes.  I'm confused now.

Ah, I see: I sent the wrong patch.  Here's the right one:

diff --git a/src/xdisp.c b/src/xdisp.c
index ddb26b8..3ccd035 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2890,8 +2890,19 @@ init_iterator (struct it *it, struct window *w,
     }
   else
     {
+      /* When hscrolling only the current line, don't apply the
+	 hscroll here, it will be applied by display_line when it gets
+	 to laying out the line showing point.  However, if the
+	 window's min_hscroll is positive, the user specified a lower
+	 bound for automatic hscrolling, so they expect the
+	 non-current lines to obey that hscroll amount.  */
       if (hscrolling_current_line_p (w))
-	it->first_visible_x = 0;
+	{
+	  if (w->min_hscroll > 0)
+	    it->first_visible_x = w->min_hscroll * FRAME_COLUMN_WIDTH (it->f);
+	  else
+	    it->first_visible_x = 0;
+	}
       else
 	it->first_visible_x =
 	  window_hscroll_limited (w, it->f) * FRAME_COLUMN_WIDTH (it->f);




This bug report was last modified 8 years and 48 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.