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: Sun, 14 Aug 2016 05:36:19 +0300 Message-ID: <83inv4cc0s.fsf@gnu.org> References: <4B9D1C61.70903@gmail.com> <87mvkjy0l5.fsf@users.sourceforge.net> <83fuqbfhpb.fsf@gnu.org> <87a8ggwcoo.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1471142246 7086 195.159.176.226 (14 Aug 2016 02:37:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 14 Aug 2016 02:37:26 +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 Sun Aug 14 04:37:22 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 1bYlIc-0001dF-Nl for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Aug 2016 04:37:18 +0200 Original-Received: from localhost ([::1]:59283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYlIZ-0001On-On for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Aug 2016 22:37:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYlIR-0001NB-5l for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2016 22:37:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYlIM-00083U-78 for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2016 22:37:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYlIM-00083Q-46 for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2016 22:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bYlIL-0008Pr-W9 for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2016 22:37: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: Sun, 14 Aug 2016 02:37: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.147114219732287 (code B ref 5718); Sun, 14 Aug 2016 02:37:01 +0000 Original-Received: (at 5718) by debbugs.gnu.org; 14 Aug 2016 02:36:37 +0000 Original-Received: from localhost ([127.0.0.1]:56670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYlHw-0008Og-UW for submit@debbugs.gnu.org; Sat, 13 Aug 2016 22:36:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50627) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYlHv-0008OV-Tg for 5718@debbugs.gnu.org; Sat, 13 Aug 2016 22:36:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYlHp-0007zy-SX for 5718@debbugs.gnu.org; Sat, 13 Aug 2016 22:36:30 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYlHj-0007wt-O0; Sat, 13 Aug 2016 22:36:23 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2123 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bYlHi-0001Zi-Pv; Sat, 13 Aug 2016 22:36:23 -0400 In-reply-to: <87a8ggwcoo.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:122187 Archived-At: > From: npostavs@users.sourceforge.net > Cc: 5718@debbugs.gnu.org, ahyatt@gmail.com, gavenkoa@gmail.com > Date: Sat, 13 Aug 2016 18:01:43 -0400 > > >> 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. > > I was looking at fixing it, but I got confused by this comment in > window.h: > > /* Height in pixels, and in lines, of the mode line. > May be zero if W doesn't have a mode line. */ > #define WINDOW_MODE_LINE_HEIGHT(W) \ > > How is the height "in pixels, and in lines"? Doesn't it have to be one > or the other? It's in pixels. The comment should be fixed. Thanks.