From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jorgen =?UTF-8?Q?Sch=C3=A4fer?= Newsgroups: gmane.emacs.bugs Subject: bug#23098: 25.0.92; (recenter -1) can leave point in the middle of the window Date: Thu, 24 Mar 2016 16:27:53 +0000 Message-ID: References: <87r3f19gx0.fsf@loki.jorgenschaefer.de> <83d1ql2ebx.fsf@gnu.org> <83a8lp2bd4.fsf@gnu.org> <8360wb3mj5.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11410d843d7ffb052ecdee81 X-Trace: ger.gmane.org 1458836960 19512 80.91.229.3 (24 Mar 2016 16:29:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Mar 2016 16:29:20 +0000 (UTC) Cc: 23098@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 24 17:29:12 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aj88G-0001HT-BD for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Mar 2016 17:29:12 +0100 Original-Received: from localhost ([::1]:51747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj88F-0004gS-DB for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Mar 2016 12:29:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj88A-0004gB-4N for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2016 12:29:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj886-0007Z4-39 for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2016 12:29:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj885-0007Z0-VW for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2016 12:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1aj885-0000bJ-RS for bug-gnu-emacs@gnu.org; Thu, 24 Mar 2016 12:29:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jorgen =?UTF-8?Q?Sch=C3=A4fer?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Mar 2016 16:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23098 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23098-submit@debbugs.gnu.org id=B23098.14588368912239 (code B ref 23098); Thu, 24 Mar 2016 16:29:01 +0000 Original-Received: (at 23098) by debbugs.gnu.org; 24 Mar 2016 16:28:11 +0000 Original-Received: from localhost ([127.0.0.1]:36370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aj87G-0000a3-O1 for submit@debbugs.gnu.org; Thu, 24 Mar 2016 12:28:11 -0400 Original-Received: from mail-lf0-f46.google.com ([209.85.215.46]:35757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aj87F-0000Zq-H2 for 23098@debbugs.gnu.org; Thu, 24 Mar 2016 12:28:09 -0400 Original-Received: by mail-lf0-f46.google.com with SMTP id q73so36603995lfe.2 for <23098@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) In-Reply-To: <8360wb3mj5.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115444 Archived-At: --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 wrote: > > From: Jorgen Sch=C3=A4fer > > Date: Thu, 24 Mar 2016 08:12:08 +0000 > > Cc: 23098@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
>=C2=A0If you do the above, do you still get the cursor= recentered in the
> window?

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.

On Thu, Mar 24, 2016 at 4:48 PM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Jorgen Sch=C3=A4fer <jorgen.schaefer@gmail.com>
> Date: Thu, 24 Mar 2016 08:12:08 +0000
> Cc: 23098@d= ebbugs.gnu.org
>
> > If you set scroll-conservatively to a value larger than 100, don&= #39;t you
> > get point as low as possible?
>
> No.

That's strange.

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

=C2=A0 . emacs -Q
=C2=A0 . paste the following into *scratch*, which is exactly the code you<= br> =C2=A0 =C2=A0 posted with a single line added:

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

=C2=A0 . M-x eval-region RET

After this, buffer "*Bug Repro*" pops up, with point at EOB posit= ioned
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?=C2=A0 If so, I will try to play with display defaults in order to reproduce what you see.

Thanks.
--001a11410d843d7ffb052ecdee81--