From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#5718: scroll-margin in buffer with small line count. Date: Thu, 11 Aug 2016 08:03:18 -0400 Message-ID: <87mvkjy0l5.fsf@users.sourceforge.net> References: <4B9D1C61.70903@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1470917059 19338 195.159.176.226 (11 Aug 2016 12:04:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 11 Aug 2016 12:04:19 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 5718@debbugs.gnu.org, Oleksandr Gavenko To: Andrew Hyatt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 11 14:04:15 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 1bXoic-0004tV-N5 for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Aug 2016 14:04:14 +0200 Original-Received: from localhost ([::1]:48167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXoiZ-00083L-Fb for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Aug 2016 08:04:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXoiT-00083F-Fj for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 08:04:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXoiQ-0007pH-9E for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 08:04:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXoiQ-0007pD-4e for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 08:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bXoiP-00035n-Uo for bug-gnu-emacs@gnu.org; Thu, 11 Aug 2016 08:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Aug 2016 12:04:01 +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.147091699711826 (code B ref 5718); Thu, 11 Aug 2016 12:04:01 +0000 Original-Received: (at 5718) by debbugs.gnu.org; 11 Aug 2016 12:03:17 +0000 Original-Received: from localhost ([127.0.0.1]:53077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXohh-00034f-4W for submit@debbugs.gnu.org; Thu, 11 Aug 2016 08:03:17 -0400 Original-Received: from mail-it0-f52.google.com ([209.85.214.52]:38613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXohg-00034T-3I for 5718@debbugs.gnu.org; Thu, 11 Aug 2016 08:03:16 -0400 Original-Received: by mail-it0-f52.google.com with SMTP id x130so3812107ite.1 for <5718@debbugs.gnu.org>; Thu, 11 Aug 2016 05:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=FV9muWqJGd3TARkqp3dv0VJismJlkc/xT2NS2vmegqU=; b=LUSECsk2IYbWaECCC44G09ldRTVjua0Syik8AXwk/LneY3e12xU25ijaTdgyBo0yc3 YdiAm0/wa/eX2dI2RtSh4n1x9+1/IdEANFjgSplP+IlCc0yP1+8fpP4e9HF4Zb+33Tzo 08TMppqle+BfQal9Whm1+0muE1Nk7PPnsR2WVvpORTNsF4KQ63pId/FQAnC5Lyga3+lh WXpLPu0fvGlH/XG6MwfZEuJt8H4mYCEbr88tD5B9phQFiLSS2ccVXUZSMxtI4Yn1YzH7 vhwPvjaufgcaNFK8rxDnIj0/HRVDZNioASohXIjU/xbC7j70aQ3F9WdmM/oc9Q/dyn9I uo+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=FV9muWqJGd3TARkqp3dv0VJismJlkc/xT2NS2vmegqU=; b=kDfFrxp9gDgqLXqpx+gB6xWMD/jnIDKh5pinWKBTjiHCmpiovkz3X3xWlAzKa1vI6n vCuThdmGcFrMyCvxkbmZ0XDCZ+OuuzJzVoiAPzeO7aFk4t0mTNGpcQQft67yDjCVRFu4 Ad6qvA0rhRF/LxMIuMlzXCcPBy5VtcJIbhfxpeJGzxiVmbeRC7jGwrtIoYnJzKrnfhLg bGtCnswXIYumsCCnH9PJJUoaJlCo1/wriCwmTj4j6enBZkOGP2eGoqh2IsyByaRd+G8x tpYJBDRXwV/V0BwLiBISXVhnYhwmesdMx0+yLTu7bPK07Q+vc086yyBezt+drBsN7lPm Aekw== X-Gm-Message-State: AEkoouuW5SXCrBiScDtEwNVny7N59n7H9hA3dahWR50QMBzdMO7lWjntBw8oE1AWg5mnVQ== X-Received: by 10.36.129.213 with SMTP id q204mr9549079itd.38.1470916990479; Thu, 11 Aug 2016 05:03:10 -0700 (PDT) Original-Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id b66sm5987258itd.0.2016.08.11.05.03.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Aug 2016 05:03:09 -0700 (PDT) In-Reply-To: (Andrew Hyatt's message of "Thu, 11 Aug 2016 00:11:22 -0400") 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:122066 Archived-At: Andrew Hyatt writes: > Oleksandr Gavenko writes: > >> I have official Emacs 22.3 from FSF ftp server for Windows. >> >> When set >> >> (setq scroll-margin 4) >> >> in buffer with window width 6 lines real margin value is 1 >> (so real line scrolling done when press on second line >> or when press on fifth line). >> >> Experiment show such dependence of real margin on line count: >> >> 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); Whereas, it seems more logical to cap it at half window height. I seem to recall another feature request that I can't find now about always keeping the cursor in the middle of the window. If this restriction were loosened it might be possible to implement by setting scroll-margin to a very high number. There might well be some important reason to divide by 4 though (I haven't looked at the following code).