GNU bug report logs - #23098
25.0.92; (recenter -1) can leave point in the middle of the window

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Jorgen Schaefer <jorgen.schaefer@HIDDEN>; dated Wed, 23 Mar 2016 18:41:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 23098 <at> debbugs.gnu.org:


Received: (at 23098) by debbugs.gnu.org; 24 Mar 2016 16:38:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 24 12:38:36 2016
Received: from localhost ([127.0.0.1]:36387 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aj8HM-0000yA-Ae
	for submit <at> debbugs.gnu.org; Thu, 24 Mar 2016 12:38:36 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41122)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1aj8HK-0000xv-QD
 for 23098 <at> debbugs.gnu.org; Thu, 24 Mar 2016 12:38:35 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1aj8HC-0001Lh-KH
 for 23098 <at> debbugs.gnu.org; Thu, 24 Mar 2016 12:38:29 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53113)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1aj8HC-0001Ld-HG; Thu, 24 Mar 2016 12:38:26 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3447
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1aj8HB-0000pq-Sv; Thu, 24 Mar 2016 12:38:26 -0400
Date: Thu, 24 Mar 2016 18:38:12 +0200
Message-Id: <83y49725mz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jorgen =?utf-8?Q?Sch=C3=A4fer?= <jorgen.schaefer@HIDDEN>
In-reply-to: <CALqDrSdksWUz35oL47GX66YLRmw1pq+-CBfp80RSPTF4-0gyVQ@HIDDEN>
 (message from Jorgen =?utf-8?Q?Sch=C3=A4fer?= on Thu, 24 Mar 2016 16:27:53
 +0000)
Subject: Re: bug#23098: 25.0.92; (recenter -1) can leave point in the middle
 of the window
References: <87r3f19gx0.fsf@HIDDEN> <83d1ql2ebx.fsf@HIDDEN>
 <CALqDrSe7GUay_h0q9aKzfrwgP6OVU_QzS_tVhCHn5DV8a+CoUw@HIDDEN>
 <83a8lp2bd4.fsf@HIDDEN>
 <CALqDrSfFddK7B_nMuuDHe+eHgq=dhWOAE2rZk0C1JZ4nmbMqFw@HIDDEN>
 <8360wb3mj5.fsf@HIDDEN>
 <CALqDrSdksWUz35oL47GX66YLRmw1pq+-CBfp80RSPTF4-0gyVQ@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 23098
Cc: 23098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Jorgen Schäfer <jorgen.schaefer@HIDDEN>
> Date: Thu, 24 Mar 2016 16:27:53 +0000
> Cc: 23098 <at> debbugs.gnu.org
> 
> > If you do the above, do you still get the cursor recentered in the
> > window?
> 
> Hm. That seems to work.

OK, so at least we see the same behavior.

> I was using let-binding around recenter, which does not work.

Indeed, it won't work because the value of scroll-conservatively needs
to be seen by redisplay, which runs after the code of the test case
finishes execution.  You could try let-binding it around a call to
'redisplay', but that's probably gross.

>  Even resetting
> scroll-conservatively after the call to recenter will exhibit the bug again. So setting scroll-conservatively is a
> possible workaround, although it means that *all* scrolling will be affected by scroll-conservatively. E.g.
> scrolling through the backlog of a M-x shell session would be affected, even though it just should affect the
> scrolling when the last line of the buffer is visible at all.

Well, setting scroll-conservatively is the only way in Emacs to
reliably avoid recentering of point in all kinds of corner cases.  So
if you cannot use that setting, I'm afraid I'm out of ideas.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23098; Package emacs. Full text available.

Message received at 23098 <at> debbugs.gnu.org:


Received: (at 23098) by debbugs.gnu.org; 24 Mar 2016 16:28:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 24 12:28:11 2016
Received: from localhost ([127.0.0.1]:36370 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aj87G-0000a3-O1
	for submit <at> debbugs.gnu.org; Thu, 24 Mar 2016 12:28:11 -0400
Received: from mail-lf0-f46.google.com ([209.85.215.46]:35757)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jorgen.schaefer@HIDDEN>) id 1aj87F-0000Zq-H2
 for 23098 <at> debbugs.gnu.org; Thu, 24 Mar 2016 12:28:09 -0400
Received: by mail-lf0-f46.google.com with SMTP id q73so36603995lfe.2
 for <23098 <at> debbugs.gnu.org>; Thu, 24 Mar 2016 09:28:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=VwZUeB1SVWheAy7IyfBsW4CzLZ6rkp8b4O/8Z4JRTLM=;
 b=Sjq8DO0uybHi+Er+VxbGIDkzgcQ8Lef7q5XLayJcG0fVCkcfno0m480gWHDjqcrAO4
 e0Zr3WvlZS1IUI4rt85toLBULDH7RdE33eJ+EifPzXCU7mYhhMiFeMvuNLldxNCb8mTO
 6xaPeB60m5S3F+5c/LH/XuxkAMd8z7nXQmQNDH8ZUlmf5SMhNQDl+PMrV6ASaVAURSCj
 Dt3AeY9Ng5xFK7b4UBl3NDCAOE/LuB9Ohb+yHZfQ88lWS4L0KDHtQwjWicMyyT28BlYG
 HV7GsEZICeMbWgEZjiCO4voGjcjdQO3K+lObEkQQGWkdVes7jzzKuDSIetGsIGHxKpuD
 Edug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=VwZUeB1SVWheAy7IyfBsW4CzLZ6rkp8b4O/8Z4JRTLM=;
 b=GTv0HIuZKcJ6g/SS/Q12yRRkkR2L3YJwhWs1WhTg63UjXSE0IiKMSnVZtSunE4Vw5o
 ZBl1Xe4RLfRI8fRmVD+vHiRUNNJ53il9/X7kpbR+HzWgWdK/ZzN6uplv5tGuvUwgGE2j
 rbS8k4T/RzX2o2+1rPD0y4olxGlUp8Oqc7JpW19bA9ZUhacGY/VBeRgTsTzBmaduJdmM
 HjdNSjne4gr4ZY/zpBWEnrOnDnA6ankbcKvd6jXepfjETHvhYJGsr6se06FX45B34JG6
 FsIuW/mbm1Cq4I8rUnbN4T2R47zaaMqZQeAUWuf3X/ihYFMAu12AlKjwxhZMMy2Dk5fK
 Hz0w==
X-Gm-Message-State: AD7BkJKxrI+1Jdt+qBU19Sxm7m7dY6P528yIpVJSDvv3syJSXWCFyeLTx1ChOs0TLsFVqXvFCdd9SyRJU6qXJg==
X-Received: by 10.25.86.195 with SMTP id k186mr3883534lfb.155.1458836883732;
 Thu, 24 Mar 2016 09:28:03 -0700 (PDT)
MIME-Version: 1.0
References: <87r3f19gx0.fsf@HIDDEN> <83d1ql2ebx.fsf@HIDDEN>
 <CALqDrSe7GUay_h0q9aKzfrwgP6OVU_QzS_tVhCHn5DV8a+CoUw@HIDDEN>
 <83a8lp2bd4.fsf@HIDDEN>
 <CALqDrSfFddK7B_nMuuDHe+eHgq=dhWOAE2rZk0C1JZ4nmbMqFw@HIDDEN>
 <8360wb3mj5.fsf@HIDDEN>
In-Reply-To: <8360wb3mj5.fsf@HIDDEN>
From: =?UTF-8?Q?Jorgen_Sch=C3=A4fer?= <jorgen.schaefer@HIDDEN>
Date: Thu, 24 Mar 2016 16:27:53 +0000
Message-ID: <CALqDrSdksWUz35oL47GX66YLRmw1pq+-CBfp80RSPTF4-0gyVQ@HIDDEN>
Subject: Re: bug#23098: 25.0.92; (recenter -1) can leave point in the middle
 of the window
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary=001a11410d843d7ffb052ecdee81
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 23098
Cc: 23098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--001a11410d843d7ffb052ecdee81
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

> If you do the above, do you still get the cursor recentered in the
> window?

Hm. That seems to work. I was using let-binding around recenter, which does
not work. Even resetting scroll-conservatively after the call to recenter
will exhibit the bug again. So setting scroll-conservatively is a possible
workaround, although it means that *all* scrolling will be affected by
scroll-conservatively. E.g. scrolling through the backlog of a M-x shell
session would be affected, even though it just should affect the scrolling
when the last line of the buffer is visible at all.

On Thu, Mar 24, 2016 at 4:48 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Jorgen Sch=C3=A4fer <jorgen.schaefer@HIDDEN>
> > Date: Thu, 24 Mar 2016 08:12:08 +0000
> > Cc: 23098 <at> debbugs.gnu.org
> >
> > > If you set scroll-conservatively to a value larger than 100, don't yo=
u
> > > get point as low as possible?
> >
> > No.
>
> That's strange.
>
> Let me be absolutely sure we are trying the same thing.  What I did is
> the following:
>
>   . emacs -Q
>   . paste the following into *scratch*, which is exactly the code you
>     posted with a single line added:
>
>     (require 'cl)
>     (let* ((b (get-buffer-create "*Bug Repro*"))
>            (w (selected-window))
>            (l (window-height w))
>            o)
>       (set-window-buffer w b)
>       (select-window w)
>       (set-buffer b)
>       (erase-buffer)
>       (setq scroll-conservatively 101) ;; <<<<< this line was added
>       (cl-dotimes (i (* l 2))
>                   (insert "foo\n"))
>       (goto-char (point-min))
>       (forward-line (+ l 2))
>       (setq o (make-overlay (point) (point)))
>       (overlay-put o 'after-string "\n")
>       (goto-char (point-max))
>       (recenter -1))
>
>   . M-x eval-region RET
>
> After this, buffer "*Bug Repro*" pops up, with point at EOB positioned
> on the 2nd line from bottom of the window (instead of the last line).
>
> If you do the above, do you still get the cursor recentered in the
> window?  If so, I will try to play with display defaults in order to
> reproduce what you see.
>
> Thanks.
>

--001a11410d843d7ffb052ecdee81
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt;=C2=A0If you do the above, do you still get the cursor=
 recentered in the<br>&gt; window?<div><br></div><div>Hm. That seems to wor=
k. I was using let-binding around recenter, which does not work. Even reset=
ting scroll-conservatively after the call to recenter will exhibit the bug =
again. So setting scroll-conservatively is a possible workaround, although =
it means that *all* scrolling will be affected by scroll-conservatively. E.=
g. scrolling through the backlog of a M-x shell session would be affected, =
even though it just should affect the scrolling when the last line of the b=
uffer is visible at all.</div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr">On Thu, Mar 24, 2016 at 4:48 PM Eli Zaretskii &lt;<a href=3D"mailt=
o:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"g=
mail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-l=
eft:1ex">&gt; From: Jorgen Sch=C3=A4fer &lt;<a href=3D"mailto:jorgen.schaef=
er@HIDDEN" target=3D"_blank">jorgen.schaefer@HIDDEN</a>&gt;<br>
&gt; Date: Thu, 24 Mar 2016 08:12:08 +0000<br>
&gt; Cc: <a href=3D"mailto:23098 <at> debbugs.gnu.org" target=3D"_blank">23098@d=
ebbugs.gnu.org</a><br>
&gt;<br>
&gt; &gt; If you set scroll-conservatively to a value larger than 100, don&=
#39;t you<br>
&gt; &gt; get point as low as possible?<br>
&gt;<br>
&gt; No.<br>
<br>
That&#39;s strange.<br>
<br>
Let me be absolutely sure we are trying the same thing.=C2=A0 What I did is=
<br>
the following:<br>
<br>
=C2=A0 . emacs -Q<br>
=C2=A0 . paste the following into *scratch*, which is exactly the code you<=
br>
=C2=A0 =C2=A0 posted with a single line added:<br>
<br>
=C2=A0 =C2=A0 (require &#39;cl)<br>
=C2=A0 =C2=A0 (let* ((b (get-buffer-create &quot;*Bug Repro*&quot;))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(w (selected-window))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(l (window-height w))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0o)<br>
=C2=A0 =C2=A0 =C2=A0 (set-window-buffer w b)<br>
=C2=A0 =C2=A0 =C2=A0 (select-window w)<br>
=C2=A0 =C2=A0 =C2=A0 (set-buffer b)<br>
=C2=A0 =C2=A0 =C2=A0 (erase-buffer)<br>
=C2=A0 =C2=A0 =C2=A0 (setq scroll-conservatively 101) ;; &lt;&lt;&lt;&lt;&l=
t; this line was added<br>
=C2=A0 =C2=A0 =C2=A0 (cl-dotimes (i (* l 2))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (insert &quo=
t;foo\n&quot;))<br>
=C2=A0 =C2=A0 =C2=A0 (goto-char (point-min))<br>
=C2=A0 =C2=A0 =C2=A0 (forward-line (+ l 2))<br>
=C2=A0 =C2=A0 =C2=A0 (setq o (make-overlay (point) (point)))<br>
=C2=A0 =C2=A0 =C2=A0 (overlay-put o &#39;after-string &quot;\n&quot;)<br>
=C2=A0 =C2=A0 =C2=A0 (goto-char (point-max))<br>
=C2=A0 =C2=A0 =C2=A0 (recenter -1))<br>
<br>
=C2=A0 . M-x eval-region RET<br>
<br>
After this, buffer &quot;*Bug Repro*&quot; pops up, with point at EOB posit=
ioned<br>
on the 2nd line from bottom of the window (instead of the last line).<br>
<br>
If you do the above, do you still get the cursor recentered in the<br>
window?=C2=A0 If so, I will try to play with display defaults in order to<b=
r>
reproduce what you see.<br>
<br>
Thanks.<br>
</blockquote></div>

--001a11410d843d7ffb052ecdee81--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23098; Package emacs. Full text available.

Message received at 23098 <at> debbugs.gnu.org:


Received: (at 23098) by debbugs.gnu.org; 24 Mar 2016 15:48:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 24 11:48:24 2016
Received: from localhost ([127.0.0.1]:36302 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aj7Um-00080S-E7
	for submit <at> debbugs.gnu.org; Thu, 24 Mar 2016 11:48:24 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50775)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1aj7Uk-00080E-Hf
 for 23098 <at> debbugs.gnu.org; Thu, 24 Mar 2016 11:48:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1aj7Ua-0002p1-Db
 for 23098 <at> debbugs.gnu.org; Thu, 24 Mar 2016 11:48:17 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51870)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1aj7Ua-0002ov-Ar; Thu, 24 Mar 2016 11:48:12 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3353
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1aj7UZ-0007dn-Ne; Thu, 24 Mar 2016 11:48:12 -0400
Date: Thu, 24 Mar 2016 17:47:58 +0200
Message-Id: <8360wb3mj5.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jorgen =?utf-8?Q?Sch=C3=A4fer?= <jorgen.schaefer@HIDDEN>
In-reply-to: <CALqDrSfFddK7B_nMuuDHe+eHgq=dhWOAE2rZk0C1JZ4nmbMqFw@HIDDEN>
 (message from Jorgen =?utf-8?Q?Sch=C3=A4fer?= on Thu, 24 Mar 2016 08:12:08
 +0000)
Subject: Re: bug#23098: 25.0.92; (recenter -1) can leave point in the middle
 of the window
References: <87r3f19gx0.fsf@HIDDEN> <83d1ql2ebx.fsf@HIDDEN>
 <CALqDrSe7GUay_h0q9aKzfrwgP6OVU_QzS_tVhCHn5DV8a+CoUw@HIDDEN>
 <83a8lp2bd4.fsf@HIDDEN>
 <CALqDrSfFddK7B_nMuuDHe+eHgq=dhWOAE2rZk0C1JZ4nmbMqFw@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 23098
Cc: 23098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Jorgen Schäfer <jorgen.schaefer@HIDDEN>
> Date: Thu, 24 Mar 2016 08:12:08 +0000
> Cc: 23098 <at> debbugs.gnu.org
> 
> > If you set scroll-conservatively to a value larger than 100, don't you
> > get point as low as possible?
> 
> No.

That's strange.

Let me be absolutely sure we are trying the same thing.  What I did is
the following:

  . emacs -Q
  . paste the following into *scratch*, which is exactly the code you
    posted with a single line added:

    (require 'cl)
    (let* ((b (get-buffer-create "*Bug Repro*"))
	   (w (selected-window))
	   (l (window-height w))
	   o)
      (set-window-buffer w b)
      (select-window w)
      (set-buffer b)
      (erase-buffer)
      (setq scroll-conservatively 101) ;; <<<<< this line was added
      (cl-dotimes (i (* l 2))
		  (insert "foo\n"))
      (goto-char (point-min))
      (forward-line (+ l 2))
      (setq o (make-overlay (point) (point)))
      (overlay-put o 'after-string "\n")
      (goto-char (point-max))
      (recenter -1))

  . M-x eval-region RET

After this, buffer "*Bug Repro*" pops up, with point at EOB positioned
on the 2nd line from bottom of the window (instead of the last line).

If you do the above, do you still get the cursor recentered in the
window?  If so, I will try to play with display defaults in order to
reproduce what you see.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23098; Package emacs. Full text available.

Message received at 23098 <at> debbugs.gnu.org:


Received: (at 23098) by debbugs.gnu.org; 24 Mar 2016 08:12:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 24 04:12:26 2016
Received: from localhost ([127.0.0.1]:35046 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aj0NW-0001Ma-Gd
	for submit <at> debbugs.gnu.org; Thu, 24 Mar 2016 04:12:26 -0400
Received: from mail-lb0-f176.google.com ([209.85.217.176]:34095)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jorgen.schaefer@HIDDEN>) id 1aj0NU-0001MN-Pk
 for 23098 <at> debbugs.gnu.org; Thu, 24 Mar 2016 04:12:25 -0400
Received: by mail-lb0-f176.google.com with SMTP id k12so25387209lbb.1
 for <23098 <at> debbugs.gnu.org>; Thu, 24 Mar 2016 01:12:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=E8DTXFGMcfnmT14H37CZGGpxa18FKhE+siIxxCxEwhY=;
 b=q4u2aChS2WU0j2HmWZlU4Iq8ZOej7lwGn9QsnuZRQuKza0dWKBaJa3WkqkTpg8+U0F
 QreO9FK7/yrjow3s8ojr5xwFXuT2fpmp1+J/OkSevgfnocAiYzU5tKKM2dLTWkUigp8i
 8Xodgvdj7lOdbK8f7BtRUfHQHW7NFvfJpGcc2VNwHzvXYaGyR+CsxjgkJpy/Nxutx1Y0
 YyTemBqYruH+B97GqxknlXgnc26KyOC18672bv4OtSWjLmNHvJw9iFoa85IXaQ1xWVG/
 LuQaqlEjUkHn3q626qXZ6oTMGj8ajDqETOmgBRN9lDkMFUt6RSbz6+ptSSc1f3motHDk
 1+NQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=E8DTXFGMcfnmT14H37CZGGpxa18FKhE+siIxxCxEwhY=;
 b=iAWCvI/LXjaigV8QzCcNq1nu8jeAHbpDYVjFBmCEoDKe/wx8WE77LvCpRxc0RqOWVK
 WUDZNbaxgeKM25MUD+0hC6xAQCeh+A6fP2eV7YxXXVoTh1rd5pzbG7VM/vep3zN+uC9Y
 wfjrQR9Y5I8BgESWCWYe/ktkb0Myf/F1VuuFve1yoDyfrL4POotSuFmhO0ouczLV1wO7
 1EnhY8/I/l/EhM6M7hJy7ASQrYD7fPdiQo18aceZXJgmR5004ldr0mX8IWZaobERmxjn
 /VIHSsoiW2xwx/pgGsTcvC8S6o41c7L2Rb2d5HZMNtvC1SxLWcmTJeMjGpWgzUbv6rSV
 v+JA==
X-Gm-Message-State: AD7BkJJg3op4pAUd4vObh2tv1UxmkAtA0+Fsd0FjMvdC0ZiuAMqqlqlEUUNY1DkOXFRMELUSzsOyfMFnhNBjYQ==
X-Received: by 10.112.161.131 with SMTP id xs3mr2851806lbb.65.1458807138819;
 Thu, 24 Mar 2016 01:12:18 -0700 (PDT)
MIME-Version: 1.0
References: <87r3f19gx0.fsf@HIDDEN> <83d1ql2ebx.fsf@HIDDEN>
 <CALqDrSe7GUay_h0q9aKzfrwgP6OVU_QzS_tVhCHn5DV8a+CoUw@HIDDEN>
 <83a8lp2bd4.fsf@HIDDEN>
In-Reply-To: <83a8lp2bd4.fsf@HIDDEN>
From: =?UTF-8?Q?Jorgen_Sch=C3=A4fer?= <jorgen.schaefer@HIDDEN>
Date: Thu, 24 Mar 2016 08:12:08 +0000
Message-ID: <CALqDrSfFddK7B_nMuuDHe+eHgq=dhWOAE2rZk0C1JZ4nmbMqFw@HIDDEN>
Subject: Re: bug#23098: 25.0.92; (recenter -1) can leave point in the middle
 of the window
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary=001a11c31f524e2447052ec701cc
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 23098
Cc: 23098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--001a11c31f524e2447052ec701cc
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

> If you set scroll-conservatively to a value larger than 100, don't you
> get point as low as possible?

No.

On Wed, Mar 23, 2016 at 9:22 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Jorgen Sch=C3=A4fer <jorgen.schaefer@HIDDEN>
> > Date: Wed, 23 Mar 2016 19:40:50 +0000
> > Cc: 23098 <at> debbugs.gnu.org
> >
> > The use case here are buffers like comint or IRC chat buffers. It's nic=
e
> to keep the last line of the buffer flush
> > with the last line of the window, to show the maximum amount of data.
> (recenter -1) at the end of a buffer is
> > supposed to do just that. In this case, it does not, but instead leaves
> point in the *middle* of the window.
>
> Yes, because the scrolling fails, and Emacs falls back on recentering.
>
> > If it is not possible to display that line halfway (which sounds like a
> missing feature to begin with), I would
> > expect Emacs to least try to leave point as low in the window as
> possible, instead of in the middle of the
> > window. C-l likewise won't move point any further down, for example.
>
> If you set scroll-conservatively to a value larger than 100, don't you
> get point as low as possible?
>

--001a11c31f524e2447052ec701cc
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt;=C2=A0If you set scroll-conservatively to a value larg=
er than 100, don&#39;t you<br>&gt; get point as low as possible?<div><br></=
div><div>No.</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On =
Wed, Mar 23, 2016 at 9:22 PM Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN=
rg">eliz@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&gt=
; From: Jorgen Sch=C3=A4fer &lt;<a href=3D"mailto:jorgen.schaefer@HIDDEN=
" target=3D"_blank">jorgen.schaefer@HIDDEN</a>&gt;<br>
&gt; Date: Wed, 23 Mar 2016 19:40:50 +0000<br>
&gt; Cc: <a href=3D"mailto:23098 <at> debbugs.gnu.org" target=3D"_blank">23098@d=
ebbugs.gnu.org</a><br>
&gt;<br>
&gt; The use case here are buffers like comint or IRC chat buffers. It&#39;=
s nice to keep the last line of the buffer flush<br>
&gt; with the last line of the window, to show the maximum amount of data. =
(recenter -1) at the end of a buffer is<br>
&gt; supposed to do just that. In this case, it does not, but instead leave=
s point in the *middle* of the window.<br>
<br>
Yes, because the scrolling fails, and Emacs falls back on recentering.<br>
<br>
&gt; If it is not possible to display that line halfway (which sounds like =
a missing feature to begin with), I would<br>
&gt; expect Emacs to least try to leave point as low in the window as possi=
ble, instead of in the middle of the<br>
&gt; window. C-l likewise won&#39;t move point any further down, for exampl=
e.<br>
<br>
If you set scroll-conservatively to a value larger than 100, don&#39;t you<=
br>
get point as low as possible?<br>
</blockquote></div>

--001a11c31f524e2447052ec701cc--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23098; Package emacs. Full text available.

Message received at 23098 <at> debbugs.gnu.org:


Received: (at 23098) by debbugs.gnu.org; 23 Mar 2016 20:22:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 23 16:22:42 2016
Received: from localhost ([127.0.0.1]:34808 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aipIg-0004QX-FW
	for submit <at> debbugs.gnu.org; Wed, 23 Mar 2016 16:22:42 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48666)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1aipIe-0004QH-9y
 for 23098 <at> debbugs.gnu.org; Wed, 23 Mar 2016 16:22:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1aipIW-0002mo-55
 for 23098 <at> debbugs.gnu.org; Wed, 23 Mar 2016 16:22:35 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58223)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1aipIW-0002mk-1K; Wed, 23 Mar 2016 16:22:32 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2447
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1aipIV-0004Z0-1X; Wed, 23 Mar 2016 16:22:31 -0400
Date: Wed, 23 Mar 2016 22:22:15 +0200
Message-Id: <83a8lp2bd4.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jorgen =?utf-8?Q?Sch=C3=A4fer?= <jorgen.schaefer@HIDDEN>
In-reply-to: <CALqDrSe7GUay_h0q9aKzfrwgP6OVU_QzS_tVhCHn5DV8a+CoUw@HIDDEN>
 (message from Jorgen =?utf-8?Q?Sch=C3=A4fer?= on Wed, 23 Mar 2016 19:40:50
 +0000)
Subject: Re: bug#23098: 25.0.92; (recenter -1) can leave point in the middle
 of the window
References: <87r3f19gx0.fsf@HIDDEN> <83d1ql2ebx.fsf@HIDDEN>
 <CALqDrSe7GUay_h0q9aKzfrwgP6OVU_QzS_tVhCHn5DV8a+CoUw@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 23098
Cc: 23098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Jorgen Schäfer <jorgen.schaefer@HIDDEN>
> Date: Wed, 23 Mar 2016 19:40:50 +0000
> Cc: 23098 <at> debbugs.gnu.org
> 
> The use case here are buffers like comint or IRC chat buffers. It's nice to keep the last line of the buffer flush
> with the last line of the window, to show the maximum amount of data. (recenter -1) at the end of a buffer is
> supposed to do just that. In this case, it does not, but instead leaves point in the *middle* of the window.

Yes, because the scrolling fails, and Emacs falls back on recentering.

> If it is not possible to display that line halfway (which sounds like a missing feature to begin with), I would
> expect Emacs to least try to leave point as low in the window as possible, instead of in the middle of the
> window. C-l likewise won't move point any further down, for example.

If you set scroll-conservatively to a value larger than 100, don't you
get point as low as possible?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23098; Package emacs. Full text available.

Message received at 23098 <at> debbugs.gnu.org:


Received: (at 23098) by debbugs.gnu.org; 23 Mar 2016 19:41:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 23 15:41:08 2016
Received: from localhost ([127.0.0.1]:34766 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aioeS-0003LQ-61
	for submit <at> debbugs.gnu.org; Wed, 23 Mar 2016 15:41:08 -0400
Received: from mail-lf0-f50.google.com ([209.85.215.50]:33208)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jorgen.schaefer@HIDDEN>) id 1aioeQ-0003Kz-Px
 for 23098 <at> debbugs.gnu.org; Wed, 23 Mar 2016 15:41:07 -0400
Received: by mail-lf0-f50.google.com with SMTP id o73so19220849lfe.0
 for <23098 <at> debbugs.gnu.org>; Wed, 23 Mar 2016 12:41:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=qt3E6pcPr7Soqv2NmK/CQP5xQMwntWpQ26esfcSCcSo=;
 b=i4v9duHNLuxvMi21/p6z4HpNISm+1n0idVvCH56NDyNArkPpt/ZkF5mfKBv/BodpHI
 2J4wbCN7MZwXfgmgC0vcRK3NKsE1HmP/IjN1y46W1vzgFbNyFuqdAeI1QLI+WK6gg60g
 Nh2IbV9N30/aJ9FPM0LAw8500sQYiRqeoeTkDQlztZF5qrDd8dmdCo/8NLflWnq0ALf1
 zwK/BFDpmCf7hRR5JDL0EV6908YwAmG/5Wa9t1CeBrxl76iMLmBX4xacv35wKqkrl8Ww
 TBaaLlB5fs49iWqEBbRizkvDi+R9ZJGYOyc0zHx/CPs6g3T5lP3P+rj3v5rya8NWNc9S
 eCQg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=qt3E6pcPr7Soqv2NmK/CQP5xQMwntWpQ26esfcSCcSo=;
 b=gM3a6h+lD5nCuiXew0C4RIDcMJXWhCNTvzvptOLAUEjpRBJLYzeiuzPxnYY1feQcdW
 pCTe18TaInWaHXFcLfwoDhcqV8YnJQAqXm4EfduoVdsgW5JH5W565rCLfe2cEiQmgFhp
 tuhlQoN5UlWFEO0oix0uGmMVnAzZv1D+wiryGR6zla/bWJArDPAnfxinCQch80EuJ2u+
 rlhKpfTGzIEmgeC5KM/fm+diuk7RSGgdiiyEazUTK7beBkTRHfvKCngBPXF6IipqAL05
 O++JgkyZmPpg0gTKn4L/LE7DfhGCrCfviaPk+6u45LHpIoYgCahW7f8/oQJmrmlinjnd
 I5GQ==
X-Gm-Message-State: AD7BkJLs2x2iAM0KLdUxG56YUxGZn7h5F1KaGJFUikqtvpJk+MC5eYabJX87lbmDrx+X4uFE1aaKx2K5rMmBOA==
X-Received: by 10.25.21.94 with SMTP id l91mr1963262lfi.25.1458762060806; Wed,
 23 Mar 2016 12:41:00 -0700 (PDT)
MIME-Version: 1.0
References: <87r3f19gx0.fsf@HIDDEN> <83d1ql2ebx.fsf@HIDDEN>
In-Reply-To: <83d1ql2ebx.fsf@HIDDEN>
From: =?UTF-8?Q?Jorgen_Sch=C3=A4fer?= <jorgen.schaefer@HIDDEN>
Date: Wed, 23 Mar 2016 19:40:50 +0000
Message-ID: <CALqDrSe7GUay_h0q9aKzfrwgP6OVU_QzS_tVhCHn5DV8a+CoUw@HIDDEN>
Subject: Re: bug#23098: 25.0.92; (recenter -1) can leave point in the middle
 of the window
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary=001a113f17d6723f3e052ebc82d8
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 23098
Cc: 23098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--001a113f17d6723f3e052ebc82d8
Content-Type: text/plain; charset=UTF-8

Hello!
The use case here are buffers like comint or IRC chat buffers. It's nice to
keep the last line of the buffer flush with the last line of the window, to
show the maximum amount of data. (recenter -1) at the end of a buffer is
supposed to do just that. In this case, it does not, but instead leaves
point in the *middle* of the window.

If it is not possible to display that line halfway (which sounds like a
missing feature to begin with), I would expect Emacs to least try to leave
point as low in the window as possible, instead of in the middle of the
window. C-l likewise won't move point any further down, for example.

Regards,
Jorgen

On Wed, Mar 23, 2016 at 8:18 PM Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Jorgen Schaefer <jorgen.schaefer@HIDDEN>
> > Date: Wed, 23 Mar 2016 19:40:27 +0100
> >
> > Evaluating the following code in "emacs -Q" leaves point in the middle
> > of the window, instead of at the end of the window as expected. Certain
> > modes (IRC) want to keep the buffer flushed at the end of the window,
> > this problem interferes with that behavior and causes very weird jumpy
> > scrolling.
> >
> >
> > (require 'cl)
> > (let* ((b (get-buffer-create "*Bug Repro*"))
> >        (w (selected-window))
> >        (l (window-height w))
> >        o)
> >   (set-window-buffer w b)
> >   (select-window w)
> >   (set-buffer b)
> >   (erase-buffer)
> >   (cl-dotimes (i (* l 2))
> >               (insert "foo\n"))
> >   (goto-char (point-min))
> >   (forward-line (+ l 2))
> >   (setq o (make-overlay (point) (point)))
> >   (overlay-put o 'after-string "\n")
> >   (goto-char (point-max))
> >   (recenter -1))
> >
> >
> > That is, if there is a multi-line overlay that would be shown only
> > halfway.
>
> I'm not sure I understand: are you trying to display a window whose
> start point is in the middle of an overlay string?  That's not
> possible, AFAIK.  The window-start point must be a buffer position.
>

--001a113f17d6723f3e052ebc82d8
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello!<div>The use case here are buffers like comint or IR=
C chat buffers. It&#39;s nice to keep the last line of the buffer flush wit=
h the last line of the window, to show the maximum amount of data. (recente=
r -1) at the end of a buffer is supposed to do just that. In this case, it =
does not, but instead leaves point in the *middle* of the window.</div><div=
><br></div><div>If it is not possible to display that line halfway (which s=
ounds like a missing feature to begin with), I would expect Emacs to least =
try to leave point as low in the window as possible, instead of in the midd=
le of the window. C-l likewise won&#39;t move point any further down, for e=
xample.</div><div><br></div><div>Regards,</div><div>Jorgen</div></div><br><=
div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, Mar 23, 2016 at 8:18 PM =
Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrot=
e:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex">&gt; From: Jorgen Schaefer &lt;<=
a href=3D"mailto:jorgen.schaefer@HIDDEN" target=3D"_blank">jorgen.schaef=
er@HIDDEN</a>&gt;<br>
&gt; Date: Wed, 23 Mar 2016 19:40:27 +0100<br>
&gt;<br>
&gt; Evaluating the following code in &quot;emacs -Q&quot; leaves point in =
the middle<br>
&gt; of the window, instead of at the end of the window as expected. Certai=
n<br>
&gt; modes (IRC) want to keep the buffer flushed at the end of the window,<=
br>
&gt; this problem interferes with that behavior and causes very weird jumpy=
<br>
&gt; scrolling.<br>
&gt;<br>
&gt;<br>
&gt; (require &#39;cl)<br>
&gt; (let* ((b (get-buffer-create &quot;*Bug Repro*&quot;))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 (w (selected-window))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 (l (window-height w))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 o)<br>
&gt;=C2=A0 =C2=A0(set-window-buffer w b)<br>
&gt;=C2=A0 =C2=A0(select-window w)<br>
&gt;=C2=A0 =C2=A0(set-buffer b)<br>
&gt;=C2=A0 =C2=A0(erase-buffer)<br>
&gt;=C2=A0 =C2=A0(cl-dotimes (i (* l 2))<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(insert &quot;fo=
o\n&quot;))<br>
&gt;=C2=A0 =C2=A0(goto-char (point-min))<br>
&gt;=C2=A0 =C2=A0(forward-line (+ l 2))<br>
&gt;=C2=A0 =C2=A0(setq o (make-overlay (point) (point)))<br>
&gt;=C2=A0 =C2=A0(overlay-put o &#39;after-string &quot;\n&quot;)<br>
&gt;=C2=A0 =C2=A0(goto-char (point-max))<br>
&gt;=C2=A0 =C2=A0(recenter -1))<br>
&gt;<br>
&gt;<br>
&gt; That is, if there is a multi-line overlay that would be shown only<br>
&gt; halfway.<br>
<br>
I&#39;m not sure I understand: are you trying to display a window whose<br>
start point is in the middle of an overlay string?=C2=A0 That&#39;s not<br>
possible, AFAIK.=C2=A0 The window-start point must be a buffer position.<br=
>
</blockquote></div>

--001a113f17d6723f3e052ebc82d8--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23098; Package emacs. Full text available.

Message received at 23098 <at> debbugs.gnu.org:


Received: (at 23098) by debbugs.gnu.org; 23 Mar 2016 19:18:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 23 15:18:40 2016
Received: from localhost ([127.0.0.1]:34761 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aioIi-0002gG-8e
	for submit <at> debbugs.gnu.org; Wed, 23 Mar 2016 15:18:40 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53704)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1aioIg-0002g3-42
 for 23098 <at> debbugs.gnu.org; Wed, 23 Mar 2016 15:18:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1aioIX-000211-23
 for 23098 <at> debbugs.gnu.org; Wed, 23 Mar 2016 15:18:33 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56964)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1aioIW-00020x-Us; Wed, 23 Mar 2016 15:18:28 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2371
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1aioIV-0002mU-99; Wed, 23 Mar 2016 15:18:28 -0400
Date: Wed, 23 Mar 2016 21:18:10 +0200
Message-Id: <83d1ql2ebx.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jorgen Schaefer <jorgen.schaefer@HIDDEN>
In-reply-to: <87r3f19gx0.fsf@HIDDEN> (message from Jorgen
 Schaefer on Wed, 23 Mar 2016 19:40:27 +0100)
Subject: Re: bug#23098: 25.0.92;
 (recenter -1) can leave point in the middle of the window
References: <87r3f19gx0.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 23098
Cc: 23098 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Jorgen Schaefer <jorgen.schaefer@HIDDEN>
> Date: Wed, 23 Mar 2016 19:40:27 +0100
> 
> Evaluating the following code in "emacs -Q" leaves point in the middle
> of the window, instead of at the end of the window as expected. Certain
> modes (IRC) want to keep the buffer flushed at the end of the window,
> this problem interferes with that behavior and causes very weird jumpy
> scrolling.
> 
> 
> (require 'cl)
> (let* ((b (get-buffer-create "*Bug Repro*"))
>        (w (selected-window))
>        (l (window-height w))
>        o)
>   (set-window-buffer w b)
>   (select-window w)
>   (set-buffer b)
>   (erase-buffer)
>   (cl-dotimes (i (* l 2))
>               (insert "foo\n"))
>   (goto-char (point-min))
>   (forward-line (+ l 2))
>   (setq o (make-overlay (point) (point)))
>   (overlay-put o 'after-string "\n")
>   (goto-char (point-max))
>   (recenter -1))
> 
> 
> That is, if there is a multi-line overlay that would be shown only
> halfway.

I'm not sure I understand: are you trying to display a window whose
start point is in the middle of an overlay string?  That's not
possible, AFAIK.  The window-start point must be a buffer position.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23098; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Mar 2016 18:40:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 23 14:40:40 2016
Received: from localhost ([127.0.0.1]:34743 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ainhw-0001nM-JU
	for submit <at> debbugs.gnu.org; Wed, 23 Mar 2016 14:40:40 -0400
Received: from eggs.gnu.org ([208.118.235.92]:44006)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jorgen.schaefer@HIDDEN>) id 1ainhv-0001n9-7G
 for submit <at> debbugs.gnu.org; Wed, 23 Mar 2016 14:40:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <jorgen.schaefer@HIDDEN>) id 1ainho-0000up-Jf
 for submit <at> debbugs.gnu.org; Wed, 23 Mar 2016 14:40:33 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:59141)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jorgen.schaefer@HIDDEN>) id 1ainho-0000uk-H1
 for submit <at> debbugs.gnu.org; Wed, 23 Mar 2016 14:40:32 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:34974)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jorgen.schaefer@HIDDEN>) id 1ainhn-0007mS-LN
 for bug-gnu-emacs@HIDDEN; Wed, 23 Mar 2016 14:40:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <jorgen.schaefer@HIDDEN>) id 1ainhm-0000uP-JR
 for bug-gnu-emacs@HIDDEN; Wed, 23 Mar 2016 14:40:31 -0400
Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:32817)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jorgen.schaefer@HIDDEN>) id 1ainhm-0000uJ-CZ
 for bug-gnu-emacs@HIDDEN; Wed, 23 Mar 2016 14:40:30 -0400
Received: by mail-wm0-x22e.google.com with SMTP id l68so245503666wml.0
 for <bug-gnu-emacs@HIDDEN>; Wed, 23 Mar 2016 11:40:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:subject:date:message-id:mime-version;
 bh=NGxjo6dogXAXussS96ZmrJrLS41ARqdczWqpYhbBLEA=;
 b=e7ZrPip9SBe1vMHfTlrVsgjeywvS99eWwKBATPixTJvQzKMiv4QjXYobV7iOuK5vIv
 WRuReEdV94q9eLzmr/yewsPQaqKlgqk/6jJ2Jj7dBb4PWjLJg1NV1n6r0fgYgyn8zase
 BBENoeS24zhNfYGd3r+JTCkKsldmvqszEav3d4lGqzK1uzKFyovNnQZ4kJC+4AI+DaDf
 zu1M10AJX7KuKxeF4UWyWwLvwJIx91wj9HRn1pKS1giu7g9WaSkG3ewG4Qv0YhPSaRL7
 u95tfiKgdspa7EaiAM49vZn9kWLrJIhp3qzw7a/vA4cokYXBu0jvso+JgnhRdv6CMHmO
 9H6A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version;
 bh=NGxjo6dogXAXussS96ZmrJrLS41ARqdczWqpYhbBLEA=;
 b=CtTF/vPBk18jWpzNHlGTD1PbE2ck7Kg+ogtdnxQ+FIalfYuchP8g9Rq+Cd5mrRCrms
 LTqq0YgcxZel42Cr8Xb3rLYlRuUYATXMli4TwsyhMUvaINpu834w3CNsoY5lBgAUERki
 mLI0Tn6vQFjKCx7liqZKtB7h0E3Ja0unnGX4rin21F9ohkzlEM+GH7d9tfLoOZ9X+QfP
 t7AUOkXTuPcQ1EArgWT9phJvGVaBOvc4c3bVCDOPMVLyC0OW5/1tni8ZNcCh1XvTnLrn
 GGWESsrH1THjpacMxrC+217JmJSQhsTaxaKD1fIy9R43hcUe9hhmgMtC6VonR2GUGfWo
 CvVA==
X-Gm-Message-State: AD7BkJJx/1a9mwQXt5Z/Xjo76gcb5JQr3sQsauRMxu7nn6ykQpx2VEs9V+AGTya6VYV7cw==
X-Received: by 10.194.223.104 with SMTP id qt8mr5061000wjc.11.1458758429160;
 Wed, 23 Mar 2016 11:40:29 -0700 (PDT)
Received: from loki.jorgenschaefer.de (loki.jorgenschaefer.de.
 [2a01:488:66:1000:5c33:a55f:0:1])
 by smtp.gmail.com with ESMTPSA id d2sm3821595wjf.28.2016.03.23.11.40.27
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 23 Mar 2016 11:40:27 -0700 (PDT)
From: Jorgen Schaefer <jorgen.schaefer@HIDDEN>
X-Google-Original-From: Jorgen Schaefer <contact@HIDDEN>
Received: (nullmailer pid 15106 invoked by uid 1000);
 Wed, 23 Mar 2016 18:40:27 -0000
To: bug-gnu-emacs@HIDDEN
Subject: 25.0.92; (recenter -1) can leave point in the middle of the window
Date: Wed, 23 Mar 2016 19:40:27 +0100
Message-ID: <87r3f19gx0.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

Hello!

Evaluating the following code in "emacs -Q" leaves point in the middle
of the window, instead of at the end of the window as expected. Certain
modes (IRC) want to keep the buffer flushed at the end of the window,
this problem interferes with that behavior and causes very weird jumpy
scrolling.


(require 'cl)
(let* ((b (get-buffer-create "*Bug Repro*"))
       (w (selected-window))
       (l (window-height w))
       o)
  (set-window-buffer w b)
  (select-window w)
  (set-buffer b)
  (erase-buffer)
  (cl-dotimes (i (* l 2))
              (insert "foo\n"))
  (goto-char (point-min))
  (forward-line (+ l 2))
  (setq o (make-overlay (point) (point)))
  (overlay-put o 'after-string "\n")
  (goto-char (point-max))
  (recenter -1))


That is, if there is a multi-line overlay that would be shown only
halfway.

I have seen similar behavior with some forms of invisible text, but have
not been able to create reproduction steps for that.

Regards,
Jorgen


In GNU Emacs 25.0.92.1 (x86_64-unknown-linux-gnu)
 of 2016-03-14 built on loki.jorgenschaefer.de
Repository revision: 1b9d6163b023aaefd15d38ea28e968a113202402
System Description:	Debian GNU/Linux 8.3 (jessie)

Configured using:
 'configure --enable-checking --without-x 'CFLAGS=-ggdb3 -O0'
 LDFLAGS=-ggdb3'




Acknowledgement sent to Jorgen Schaefer <jorgen.schaefer@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#23098; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 24 Mar 2016 16:45:02 UTC

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