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: Wed, 23 Mar 2016 19:40:50 +0000 Message-ID: References: <87r3f19gx0.fsf@loki.jorgenschaefer.de> <83d1ql2ebx.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113f17d6723f3e052ebc82d8 X-Trace: ger.gmane.org 1458762143 7495 80.91.229.3 (23 Mar 2016 19:42:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Mar 2016 19:42:23 +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 Wed Mar 23 20:42:13 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 1aiofU-0006JE-Dw for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Mar 2016 20:42:12 +0100 Original-Received: from localhost ([::1]:45625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiofT-0001Vf-OT for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Mar 2016 15:42:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiofP-0001VY-Rq for bug-gnu-emacs@gnu.org; Wed, 23 Mar 2016 15:42:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiofJ-0000Lz-Vn for bug-gnu-emacs@gnu.org; Wed, 23 Mar 2016 15:42:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiofJ-0000Lt-S2 for bug-gnu-emacs@gnu.org; Wed, 23 Mar 2016 15:42:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1aiofJ-0003MZ-KJ for bug-gnu-emacs@gnu.org; Wed, 23 Mar 2016 15:42: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: Wed, 23 Mar 2016 19:42: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.145876206812865 (code B ref 23098); Wed, 23 Mar 2016 19:42:01 +0000 Original-Received: (at 23098) by debbugs.gnu.org; 23 Mar 2016 19:41:08 +0000 Original-Received: from localhost ([127.0.0.1]:34766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aioeS-0003LQ-61 for submit@debbugs.gnu.org; Wed, 23 Mar 2016 15:41:08 -0400 Original-Received: from mail-lf0-f50.google.com ([209.85.215.50]:33208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aioeQ-0003Kz-Px for 23098@debbugs.gnu.org; Wed, 23 Mar 2016 15:41:07 -0400 Original-Received: by mail-lf0-f50.google.com with SMTP id o73so19220849lfe.0 for <23098@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) In-Reply-To: <83d1ql2ebx.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:115408 Archived-At: --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 wrote: > > From: Jorgen Schaefer > > 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
Hello!
The use case here are buffers like comint or IR= C chat buffers. It'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.

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't move point any further down, for e= xample.

Regards,
Jorgen

<= div class=3D"gmail_quote">
On Wed, Mar 23, 2016 at 8:18 PM = Eli Zaretskii <eliz@gnu.org> wrot= e:
> From: Jorgen Schaefer <<= a href=3D"mailto:jorgen.schaefer@gmail.com" target=3D"_blank">jorgen.schaef= er@gmail.com>
> 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. Certai= n
> modes (IRC) want to keep the buffer flushed at the end of the window,<= br> > this problem interferes with that behavior and causes very weird jumpy=
> scrolling.
>
>
> (require 'cl)
> (let* ((b (get-buffer-create "*Bug Repro*"))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (w (selected-window))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (l (window-height w))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 o)
>=C2=A0 =C2=A0(set-window-buffer w b)
>=C2=A0 =C2=A0(select-window w)
>=C2=A0 =C2=A0(set-buffer b)
>=C2=A0 =C2=A0(erase-buffer)
>=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(insert "fo= o\n"))
>=C2=A0 =C2=A0(goto-char (point-min))
>=C2=A0 =C2=A0(forward-line (+ l 2))
>=C2=A0 =C2=A0(setq o (make-overlay (point) (point)))
>=C2=A0 =C2=A0(overlay-put o 'after-string "\n")
>=C2=A0 =C2=A0(goto-char (point-max))
>=C2=A0 =C2=A0(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?=C2=A0 That's not
possible, AFAIK.=C2=A0 The window-start point must be a buffer position.
--001a113f17d6723f3e052ebc82d8--