From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed Date: Wed, 25 Oct 2017 09:47:00 +0200 Message-ID: <59F04174.6090601@gmx.at> References: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1508917765 30116 195.159.176.226 (25 Oct 2017 07:49:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 25 Oct 2017 07:49:25 +0000 (UTC) To: Keith David Bershatsky , 16475@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 25 09:49:22 2017 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 1e7GR8-0006TS-SL for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Oct 2017 09:49:14 +0200 Original-Received: from localhost ([::1]:47030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7GRG-0001zS-8K for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Oct 2017 03:49:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7GQ2-0001KI-BO for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 03:48:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7GPz-0001yG-1D for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 03:48:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51954) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e7GPy-0001y1-UD for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 03:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e7GPy-0003Ok-2a for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 03:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Oct 2017 07:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16475-submit@debbugs.gnu.org id=B16475.150891766113028 (code B ref 16475); Wed, 25 Oct 2017 07:48:02 +0000 Original-Received: (at 16475) by debbugs.gnu.org; 25 Oct 2017 07:47:41 +0000 Original-Received: from localhost ([127.0.0.1]:60635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7GPc-0003O3-Ud for submit@debbugs.gnu.org; Wed, 25 Oct 2017 03:47:41 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:57613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7GPb-0003No-8i for 16475@debbugs.gnu.org; Wed, 25 Oct 2017 03:47:39 -0400 Original-Received: from [192.168.1.100] ([46.125.249.113]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M6BKc-1dEuiy3kHS-00y8U8; Wed, 25 Oct 2017 09:47:10 +0200 In-Reply-To: X-Provags-ID: V03:K0:ivQJF7oy2n7+Yl4UpPuWBwf0aDZjpASrilCLl+md6CfvgHgVAsU ip8rFz2m28qnk8wLUV+DCvcB5GkzZ9vlWYmbij7xXedejB2UEd1BR2R4zEDeK/uhOlV5cSa f2WxiT7Mjafy5lzvvEQJZBC8OkPjG4P7XI1x6cNQ7y87nzHfrZfmxOsQ12mJUecRUlUioZA gN3J/F6WF9rfGkKbxFz1w== X-UI-Out-Filterresults: notjunk:1;V01:K0:s+7fBZR1v+A=:tiLwqAZUbJjyS2wWYxWB3j PST34Bg8x9SRtOpSe9mv9JExePTGjm8fp8f+8/WLrILtxP6CldC3QCeN5ocGBY9Um0ZJ4yi8K oV8wymERYfEIYmdfsNMcnkX2u5tNhJZcIEwkxV4q1C33ZlpNMz+QgbE9lApyagl/iXWY8ddIo v4HA4M6EN3ExDxFYUzAvAVFmbmXxcwdUpPz/dfLlhnAjQ6E/8ZlqNSIdVBDJKrbIeN7W+bcsw 64FaEFmnAuZ+uejyT92N7/zyj4QAfc2+Bk5O7OedDfRo8prz5UPUg/LCxJhJKVbVx/ThnTar0 YCKq0katxcD+vNwql2v7VSBAYpjDpRhl2DD1dyUsWLrn3MtvfDZzMUnwSQ+gcnqobviTKPtDi uawOm1Kgz2fC5rhkLoxH1Vwwv78WuWWc2knA+HjMd/pNrr/8THtfUrpklaDqOnbsGc07rPNuM OHce9sx6qpVVYv262OuoDpJK2AFW9xdmlsIPH9/PDtmefaaBAW40OVtG+U31w6cvWzkN/fu1/ cwm9XzeXydoQ+tWuV3N9UmOIBgWaEWnCJ9roVpwQ8oQE40jVxDDVVIHzryAsKyrUS4SiE/nEi f5NnlwZFIE3rgqwUnwLxR5kUhXaGsK/1HZIHm0kObeYaiBHDPVEEO/N47CeXfXmcpcM3TjL2T h1aHxcoUSEVTKwtsq51kE+auSfMs0DxGa2KLeZST2LOExri0uNkvnAY4rV4xfoWu8MoTIOaug TjTeo+e3yUpFBgm7EuTpVcd4RbcR8dt9VoU25iGM2wb6kWzGTuXOTGlUWAsM2QEyLILFH+hc 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:138951 Archived-At: > Here is a first draft with a simple test (modifying xdisp.c), which > probably nukes more than just the selected window's scroll bars when > removing them, but it may be sufficient to revive this enhancement > request in the event anyone is interested. Thanks for looking into this. The test for the vertical scroll bar case is whether the buffer beginning and its end are both visible in the window, taking into account visibility, overlays and the like. I'm not sure whether && ZV - BEGV > BUF_Z (XBUFFER (w->contents)) - w->window_end_pos= - marker_position (w->start)) can handle that. Auto-removal of horizontal scroll bars is more complicated. Basically, we could remove the horizontal scroll bar when no line in the window had to be truncated. But then we have space to display the next buffer line and that line could be awfully long. So some lookahead is needed which will consume processing time. Obviously, we could just use the check whether the entire buffer is visible as for the vertical case but that's not what other applications usually do. Also, the state of a window is usually reflected in its variables and parameters. The question with auto-removal of scroll bars is how we reflect a new state in functions like =E2=80=98window-scroll-bars=E2=80=99= and =E2=80=98set-window-scroll-bars=E2=80=99. Personally I never cared much about this auto-removal because when space to display things is scarce, usually a buffer cannot be displayed in its entirety and scroll bars are needed. When space abandons I don't mind a scroll bar being present anyway. But since most applications usually remove scroll bars when they are not needed we should probably conform. Thanks again, martin