From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#5718: scroll-margin in buffer with small line count. Date: Thu, 11 Aug 2016 18:28:32 +0300 Message-ID: <83fuqbfhpb.fsf@gnu.org> References: <4B9D1C61.70903@gmail.com> <87mvkjy0l5.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1470930994 17095 195.159.176.226 (11 Aug 2016 15:56:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 11 Aug 2016 15:56:34 +0000 (UTC) Cc: ahyatt@gmail.com, 5718@debbugs.gnu.org, gavenkoa@gmail.com To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 11 17:56:21 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXsLE-00044S-Iz for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Aug 2016 17:56:20 +0200 Original-Received: from localhost ([::1]:49328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXsLB-00048Z-GN for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Aug 2016 11:56:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXrup-0000Up-Jz for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 11:29:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXruo-0007ZI-FK for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 11:29:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXruo-0007Z0-Bb for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 11:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bXruo-0001eq-6Z for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 11:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Aug 2016 15:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5718 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5718-submit@debbugs.gnu.org id=B5718.14709293396363 (code B ref 5718); Thu, 11 Aug 2016 15:29:02 +0000 Original-Received: (at 5718) by debbugs.gnu.org; 11 Aug 2016 15:28:59 +0000 Original-Received: from localhost ([127.0.0.1]:54177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXrul-0001eX-Ic for submit@debbugs.gnu.org; Thu, 11 Aug 2016 11:28:59 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXrui-0001eJ-T4 for 5718@debbugs.gnu.org; Thu, 11 Aug 2016 11:28:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXruZ-0007VF-TI for 5718@debbugs.gnu.org; Thu, 11 Aug 2016 11:28:51 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXruV-0007UJ-9X; Thu, 11 Aug 2016 11:28:43 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1699 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bXruT-0005r9-DC; Thu, 11 Aug 2016 11:28:41 -0400 In-reply-to: <87mvkjy0l5.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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" Xref: news.gmane.org gmane.emacs.bugs:122082 Archived-At: > From: npostavs@users.sourceforge.net > Date: Thu, 11 Aug 2016 08:03:18 -0400 > Cc: 5718@debbugs.gnu.org, Oleksandr Gavenko > > >> lines real-scroll-margin > >> 3,4,5,6 1 > >> 7,8,9,10 2 > >> 11,12,13,14 3 > >>>15 4 > >> > >> I count from 3 as when try make less lines Emacs warn. > >> > >> I think that whose modify scroll-margin want to see as many > >> as possible margin value up to its customization value. > >> > >> This formula produce such values: > >> > >> best-scroll-margin = min( (line_count - 1)/2, scroll-margin) > >> > >> So previous table changed to: > >> > >> lines best-scroll-margin > >> 3,4 1 > >> 5,6 2 > >> 7,8 3 > >>>9 4 > >> > >> Also as you can see in proposal case > >> user switch start work from 9 lines in window, not 15! > >> > >> Please implement described behaviour. > > > > I'm having a hard time understanding this report. However, it seems > > like more like a wishlist request than a bug: you want to change the > > scrolling behavior. I'm going to change this to wishlist for now, but > > let me know if I've misunderstood, please. > > I think the complaint is that the `scroll-margin' effective value is > capped at a 1/4 of the window height, as seen in this > window_scroll_pixel_based (window.c): > > this_scroll_margin = max (0, scroll_margin); > this_scroll_margin > = min (this_scroll_margin, window_total_lines / 4); Which reveals a subtle bug: the actual scroll margin should be 1 for 7 lines, 2 for 11, etc. The problem is that the value of window_total_lines includes the mode line, which it shouldn't. Maybe this should be fixed. > Whereas, it seems more logical to cap it at half window height. No, I think it would leave too few lines for moving the cursor. This has been Emacs behavior since time immemoriam, so if we want to have a different behavior, it should be implemented an opt-in option, not the default.