X-Loop: help-debbugs@HIDDEN Subject: bug#16475: 24.3.50; enhancement request: remove vertical scroll bar automatically when not needed Resent-From: Drew Adams <drew.adams@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 17 Jan 2014 04:43:01 +0000 Resent-Message-ID: <handler.16475.B.138993376919662 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 16475 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.138993376919662 (code B ref -1); Fri, 17 Jan 2014 04:43:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Jan 2014 04:42:49 +0000 Received: from localhost ([127.0.0.1]:54318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1W41Ga-000573-3H for submit <at> debbugs.gnu.org; Thu, 16 Jan 2014 23:42:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55500) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <drew.adams@HIDDEN>) id 1W41GX-00056u-Ez for submit <at> debbugs.gnu.org; Thu, 16 Jan 2014 23:42:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <drew.adams@HIDDEN>) id 1W41GO-0003mP-PK for submit <at> debbugs.gnu.org; Thu, 16 Jan 2014 23:42:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <drew.adams@HIDDEN>) id 1W41GO-0003mL-N2 for submit <at> debbugs.gnu.org; Thu, 16 Jan 2014 23:42:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <drew.adams@HIDDEN>) id 1W41GH-00074V-5a for bug-gnu-emacs@HIDDEN; Thu, 16 Jan 2014 23:42:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <drew.adams@HIDDEN>) id 1W41G9-0003gl-J6 for bug-gnu-emacs@HIDDEN; Thu, 16 Jan 2014 23:42:29 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:22771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <drew.adams@HIDDEN>) id 1W41G9-0003gh-Bh for bug-gnu-emacs@HIDDEN; Thu, 16 Jan 2014 23:42:21 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s0H4gJcG014877 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for <bug-gnu-emacs@HIDDEN>; Fri, 17 Jan 2014 04:42:20 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s0H4gIRm003104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for <bug-gnu-emacs@HIDDEN>; Fri, 17 Jan 2014 04:42:19 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s0H4gIZb004360 for <bug-gnu-emacs@HIDDEN>; Fri, 17 Jan 2014 04:42:18 GMT MIME-Version: 1.0 Message-ID: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> Date: Thu, 16 Jan 2014 20:42:17 -0800 (PST) From: Drew Adams <drew.adams@HIDDEN> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -4.0 (----) This was either reported as a bug/enhancement request long ago, or else it was discussed in emacs-devel long ago. I don't recall. I seem to remember, though, that the answer was that this couldn't be done, at least on MS Windows. I don't recall the particulars, so forgive me if I misunderstood or don't remember right. Anyway, while fiddling a bit, in response to this request on StackOverflow: http://stackoverflow.com/questions/21175099/how-to-automatically-add-remove= -scroll-bars-on-the-fly I found something that seems to work OK. I do not claim that this is a good way to implement the feature - at all! But it perhaps shows that something could maybe be done for this. I repeat here what I tried, but again, I am not proposing that a solution would be along these lines. Just asking that you maybe think a bit more about whether it is feasible to come up with a satisfactory solution. One thing I notice is that if you shrink the text by scaling it that does not seem to be taken into account by the code I tried: even if all of the text is easily displayed in the window (because it is small), the scroll bar does not seem to disappear. Anyway, this is the code I tried, which seems to "work": (setq-default mode-line-position '(:eval (progn (if (> (count-lines (point-min) (point-max)) (window-height)) =09 (set-window-scroll-bars nil 20 t) (set-window-scroll-bars nil 1 t)) ; IF TRY ZERO, GET BUG #16474 `((-3 ,(propertize =09 "%p" =09 'local-map mode-line-column-line-number-mode-map =09 'mouse-face 'mode-line-highlight =09 'help-echo "Buffer position, mouse-1: Line/col menu")) (line-number-mode =09((column-number-mode =09 (10 ,(propertize =09=09" (%l,%c)" =09=09'face (and (> (current-column) =09=09=09 modelinepos-column-limit) =09=09=09 'modelinepos-column-warning) =09=09'local-map mode-line-column-line-number-mode-map =09=09'mouse-face 'mode-line-highlight =09=09'help-echo "Line and column, mouse-1: Line/col menu")) =09 (6 ,(propertize =09 " L%l" =09 'local-map mode-line-column-line-number-mode-map =09 'mouse-face 'mode-line-highlight =09 'help-echo "Line number, mouse-1: Line/col menu")))) =09((column-number-mode =09 (5 ,(propertize =09 " C%c" =09 'face (and (> (current-column) =09=09=09 modelinepos-column-limit) =09=09=09 'modelinepos-column-warning) =09 'local-map mode-line-column-line-number-mode-map =09 'mouse-face 'mode-line-highlight =09 'help-echo "Column number, mouse-1: Line/col menu"))))))))) [BTW, another thing I noticed, after scaling the text smaller in a buffer that was shown in two windows of the same frame, one above the other: After evaluating the above code, the mode lines disappeared temporarily. I grabbed the area that should have been the mode line of the top window and dragged it up a bit, and the mode lines showed up again. Seems like some redisplay was not happening immediately or something.] In GNU Emacs 24.3.50.1 (i686-pc-mingw32) of 2014-01-07 on ODIEONE Bzr revision: 115916 bzg@HIDDEN Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/c/Devel/emacs/binary --enable-checking=3Dyes,glyphs 'CFLAGS=3D-O0 -g3' LDFLAGS=3D-Lc:/Devel/emacs/lib CPPFLAGS=3D-Ic:/Devel/emacs/include'
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Drew Adams <drew.adams@HIDDEN> Subject: bug#16475: Acknowledgement (24.3.50; enhancement request: remove vertical scroll bar automatically when not needed) Message-ID: <handler.16475.B.138993376919662.ack <at> debbugs.gnu.org> References: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> X-Gnu-PR-Message: ack 16475 X-Gnu-PR-Package: emacs Reply-To: 16475 <at> debbugs.gnu.org Date: Fri, 17 Jan 2014 04:43:01 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 16475 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 16475: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D16475 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: 24.3.50; enhancement request: remove vertical scroll bar automatically when not needed Resent-From: Stefan Monnier <monnier@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 17 Jan 2014 14:36:03 +0000 Resent-Message-ID: <handler.16475.B16475.138996932331211 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Drew Adams <drew.adams@HIDDEN> Cc: 16475 <at> debbugs.gnu.org Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.138996932331211 (code B ref 16475); Fri, 17 Jan 2014 14:36:03 +0000 Received: (at 16475) by debbugs.gnu.org; 17 Jan 2014 14:35:23 +0000 Received: from localhost ([127.0.0.1]:54639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1W4AW2-00087G-Et for submit <at> debbugs.gnu.org; Fri, 17 Jan 2014 09:35:22 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:47094) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from <monnier@HIDDEN>) id 1W4AVv-00086t-QC for 16475 <at> debbugs.gnu.org; Fri, 17 Jan 2014 09:35:17 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFMCoyj/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLLQcHCxQYDSSIHgYMwSGNVYM1A4hhjkiNUYFegxU X-IPAS-Result: Av4EABK/CFFMCoyj/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLLQcHCxQYDSSIHgYMwSGNVYM1A4hhjkiNUYFegxU X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="45183297" Received: from 76-10-140-163.dsl.teksavvy.com (HELO pastel.home) ([76.10.140.163]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 17 Jan 2014 09:35:15 -0500 Received: by pastel.home (Postfix, from userid 20848) id E82BF6019C; Fri, 17 Jan 2014 09:35:14 -0500 (EST) From: Stefan Monnier <monnier@HIDDEN> Message-ID: <jwvfvomllto.fsf-monnier+emacsbugs@HIDDEN> References: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> Date: Fri, 17 Jan 2014 09:35:14 -0500 In-Reply-To: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> (Drew Adams's message of "Thu, 16 Jan 2014 20:42:17 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.3 (/) > Anyway, while fiddling a bit, in response to this request on > StackOverflow: > http://stackoverflow.com/questions/21175099/how-to-automatically-add-remove-scroll-bars-on-the-fly [...] > One thing I notice is that if you shrink the text by scaling it that > does not seem to be taken into account by the code I tried: even if all Duh! Had you followed the link from the above page to http://stackoverflow.com/questions/20923655/how-to-test-whether-lines-of-text-are-greater-than-the-window-height and read my answer in there, you'd know why. Stefan
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: 24.3.50; enhancement request: remove vertical scroll bar automatically when not needed References: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> In-Reply-To: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 12 Feb 2016 02:47:02 +0000 Resent-Message-ID: <handler.16475.B16475.14552451938497 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 16475 <at> debbugs.gnu.org Cc: Eli Zaretskii <eliz@HIDDEN>, Drew Adams <drew.adams@HIDDEN> Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.14552451938497 (code B ref 16475); Fri, 12 Feb 2016 02:47:02 +0000 Received: (at 16475) by debbugs.gnu.org; 12 Feb 2016 02:46:33 +0000 Received: from localhost ([127.0.0.1]:37095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1aU3kf-0002Cz-C3 for submit <at> debbugs.gnu.org; Thu, 11 Feb 2016 21:46:33 -0500 Received: from cobb.liquidweb.com ([50.28.13.150]:43374) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from <esq@HIDDEN>) id 1aU3kd-0002Ck-6g for 16475 <at> debbugs.gnu.org; Thu, 11 Feb 2016 21:46:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=9Eyt8G4vbKEXbrd6JVlPfH8nTuhXSp7iDARQLqAEkLA=; b=BtCevH4GvwSc7rbVWV1lmckHvqt8ZrlCk3bxWN60hAGBNEHUG7WTwfWKkQIrjjlQnnnGA57cmu6SpblGkFybIjvuCKkspZhOEIa3qWpRrDYScXIsxi7NEnOBfq0GJfKY; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54379 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from <esq@HIDDEN>) id 1aU3kT-0005yX-6M; Thu, 11 Feb 2016 21:46:21 -0500 Date: Thu, 11 Feb 2016 18:46:22 -0800 Message-ID: <m2h9hemyrl.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 (generated by - "") Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) If and when feature request 22404 ever comes to fruition (to accurately calculate window-start/window-end every command loop under all circumstances), the following is a minor mode that demonstrates how to add/remove scroll bars depending upon the length of the buffer. It can undoubtedly use some improvements, but I am already successfully using it for my own personal setup with the latest draft/patch for the `window-start-end-hook`. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22404 [NOTE: Eli has indicated that a `post-redisplay-hook' (which does not introduce user Lisp into the redisplay mix) would be a better alternative to the proposed `window-start-end-hook`, and I completely respect Eli's opinion in that regard. However, I wanted to get something working for my own personal use and I am enjoying familiarizing myself with some basic C language coding relating to feature 22404.] Thanks, Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; sb-mode ;; https://github.com/kentaro/auto-save-buffers-enhanced ;; `sb-regexp-match-p` function modified by @sds on stackoverflow ;; http://stackoverflow.com/a/20343715/2112489 (defun sb-regexp-match-p (regexps string) (and string (catch 'matched (let ((inhibit-changing-match-data t)) ; small optimization (dolist (regexp regexps) (when (string-match regexp string) (throw 'matched t))))))) (defgroup sb nil "A group for the lawlist scroll-bar." :tag "Scroll Bar" :group 'convenience) (defvar regexp-always-scroll-bar '("\\.yes" "\\*Scroll-Bar\\*") "Regexp matching buffer names that will always have scroll bars.") (defvar regexp-never-scroll-bar '("\\.off" "\\.not" "\\*Calendar\\*") "Regexp matching buffer names that will never have scroll bars.") (defun lawlist-scroll-bar-fn (win start end pbol-start peol-end fully-p) (when (and (window-live-p win) (not (minibufferp))) (let* ( (buffer-size (buffer-size)) (point-min (point-min)) (point-max (point-max)) (window-scroll-bars (window-scroll-bars)) (buffer-name (buffer-name))) (cond ;; not regexp matches | not narrow-to-region ((and (not (sb-regexp-match-p regexp-always-scroll-bar buffer-name)) (not (sb-regexp-match-p regexp-never-scroll-bar buffer-name)) (equal (- point-max point-min) buffer-size)) (cond ;; Lines of text are less-than or equal-to window height, ;; and scroll bars are present (which need to be removed). ((and (<= (- point-max point-min) (- end start)) (or (equal window-scroll-bars '(15 2 right nil)) ;; GNU Emacs 24.5.1 of 2015-04-10 on builder10-6.porkrind.org (equal window-scroll-bars '(15 2 right 0 0 nil)) ;; 10/01/2014 (equal window-scroll-bars '(15 2 right nil 0 nil)) )) ;; 11/19/2014 (set-window-scroll-bars win 0 'right nil)) ;; Lines of text are greater-than window height, and ;; scroll bars are not present (which need to be added). ((and (> (- point-max point-min) (- end start)) (or (equal window-scroll-bars '(0 0 nil nil)) ;; GNU Emacs 24.5.1 of 2015-04-10 on builder10-6.porkrind.org (equal window-scroll-bars '(0 0 t nil)) ;; GNU Emacs 24.5.1 of 2015-04-10 on builder10-6.porkrind.org (equal window-scroll-bars '(0 0 t 0 0 t)) ;; windows-nt (default) (equal window-scroll-bars '(nil 0 t nil 0 nil)) ;; darwin (default) ;; 11/19/2014 (equal window-scroll-bars '(0 0 t 0 0 nil)) ;; darwin (default) ;; 10/01/2014 (equal window-scroll-bars '(0 0 nil nil 0 nil)) ;; 11/19/2014 (after scroll bars are removed) (equal window-scroll-bars '(0 0 nil 0 0 nil)))) ;; windows-nt / darwin (set-window-scroll-bars win 15 'right nil)))) ;; Narrow-to-region is active, and scroll bars are present ;; (which need to be removed). ((and (buffer-narrowed-p) (or (equal window-scroll-bars '(15 2 right nil)) ;; GNU Emacs 24.5.1 of 2015-04-10 on builder10-6.porkrind.org (equal window-scroll-bars '(15 2 right 0 0 nil)) ;; 10/01/2014 (equal window-scroll-bars '(15 2 right nil 0 nil)) )) ;; 11/19/2014 (set-window-scroll-bars win 0 'right nil)) ;; not narrow-to-region | regexp always scroll-bars ((and (equal (- point-max point-min) buffer-size) (eq major-mode 'calendar-mode) (sb-regexp-match-p regexp-always-scroll-bar buffer-name)) (set-window-scroll-bars win 15 'right nil)) ;; not narrow-to-region | regexp never scroll-bars ((and (equal (- point-max point-min) buffer-size) (sb-regexp-match-p regexp-never-scroll-bar buffer-name)) (set-window-scroll-bars win 0 'right nil)))))) (defvar sb-mode-display-hook nil "Hook used primarily for `lawlist-scroll-bar-fn'.") (define-minor-mode sb-mode "This is a minor-mode for lawlist-scroll-bar." :init-value nil :lighter " SB" :keymap nil :global nil :group 'sb (cond (sb-mode (add-hook 'window-start-end-hook 'lawlist-scroll-bar-fn nil t) (when (called-interactively-p 'any) (message "Globally turned ON `sb-mode`."))) (t (remove-hook 'window-start-end-hook 'lawlist-scroll-bar-fn t) (set-window-scroll-bars (selected-window) 0 'right nil) (when (called-interactively-p 'any) (message "Globally turned OFF `sb-mode`.") )))) (provide 'lawlist-sb)
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed References: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> In-Reply-To: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 25 Oct 2017 05:28:01 +0000 Resent-Message-ID: <handler.16475.B16475.150890923330933 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 16475 <at> debbugs.gnu.org Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.150890923330933 (code B ref 16475); Wed, 25 Oct 2017 05:28:01 +0000 Received: (at 16475) by debbugs.gnu.org; 25 Oct 2017 05:27:13 +0000 Received: from localhost ([127.0.0.1]:60579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1e7EDf-00082p-R9 for submit <at> debbugs.gnu.org; Wed, 25 Oct 2017 01:27:12 -0400 Received: from gateway36.websitewelcome.com ([192.185.187.5]:31870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1e7EDd-00082g-KF for 16475 <at> debbugs.gnu.org; Wed, 25 Oct 2017 01:27:10 -0400 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway36.websitewelcome.com (Postfix) with ESMTP id A2406400D26CF for <16475 <at> debbugs.gnu.org>; Wed, 25 Oct 2017 00:27:08 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id 7EDceS4PT5b6T7EDceiUNK; Wed, 25 Oct 2017 00:27:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=PfgvqxbOxU1J8oGJ+7AUbup3IlgUtci11Nm1MuGrPwk=; b=ggZk5LMCTaGguQ3GclvCKr2tOd havk1xpJ//ho1etZosxtJ6aviqtSY83fH+udTMiPBlO01UAD29+Vf1+xi1kprhaiTHLKO+YsXIw93 dgueGnZJH2s0t0DNOTwwwZlsMbmzcnY8MFFhITRyp6zn1va7EQgYCHDABcrh9V331ZB9vbcqy2vCw ePJ2fmtdy1CrhZ/KaXx4fuWpxcq2Wgii3Mi/FVCqk3PK7QHpCdSE6YaAeIZfLgj8ca5jv4hg6uoOS Ncd5u6s/uwAB/MTm06Pp4QMVjQtZbPHlsDLXBSPU8HVL1vVUBJfMBgZmwiiUjOMVtQJotq8a2V7hL jlyWATcA==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:57512 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from <esq@HIDDEN>) id 1e7EDb-00161R-T2 for 16475 <at> debbugs.gnu.org; Wed, 25 Oct 2017 00:27:07 -0500 Date: Tue, 24 Oct 2017 22:27:07 -0700 Message-ID: <m2she7vluc.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Tue_Oct_24_22:27:06_2017-1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1e7EDb-00161R-T2 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:57512 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.0 (/) --Multipart_Tue_Oct_24_22:27:06_2017-1 Content-Type: text/plain; charset=US-ASCII Resending/forwarding message to the correct tracking number; i.e., it should have been 16475 instead of 28936. ;;;;;;;;;;;;;;;;;;;;;; FORWARDED MESSAGE ;;;;;;;;;;;;;;;;;;;;;; --Multipart_Tue_Oct_24_22:27:06_2017-1 Content-Type: message/rfc822 Date: Tue, 24 Oct 2017 20:46:06 -0700 Message-ID: <m21slrc2kh.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> To: 28936 <at> debbugs.gnu.org Cc: Drew Adams <drew.adams@HIDDEN> Subject: enhancement request: remove vertical scroll bar automatically when not needed MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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. finish_scroll_bars: if ((WINDOW_HAS_VERTICAL_SCROLL_BAR (w) || WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w)) && ZV - BEGV > BUF_Z (XBUFFER (w->contents)) - w->window_end_pos - marker_position (w->start)) { if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) /* Set the thumb's position and size. */ set_vertical_scroll_bar (w); if (WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w)) /* Set the thumb's position and size. */ set_horizontal_scroll_bar (w); /* Note that we actually used the scroll bar attached to this window, so it shouldn't be deleted at the end of redisplay. */ if (FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (*FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (w); } else { (*FRAME_TERMINAL (f)->condemn_scroll_bars_hook) (f); (*FRAME_TERMINAL (f)->judge_scroll_bars_hook) (f); } Keith --Multipart_Tue_Oct_24_22:27:06_2017-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed Resent-From: martin rudalics <rudalics@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 25 Oct 2017 07:48:02 +0000 Resent-Message-ID: <handler.16475.B16475.150891766113028 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Keith David Bershatsky <esq@HIDDEN>, 16475 <at> debbugs.gnu.org Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.150891766113028 (code B ref 16475); Wed, 25 Oct 2017 07:48:02 +0000 Received: (at 16475) by debbugs.gnu.org; 25 Oct 2017 07:47:41 +0000 Received: from localhost ([127.0.0.1]:60635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1e7GPc-0003O3-Ud for submit <at> debbugs.gnu.org; Wed, 25 Oct 2017 03:47:41 -0400 Received: from mout.gmx.net ([212.227.15.19]:57613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <rudalics@HIDDEN>) id 1e7GPb-0003No-8i for 16475 <at> debbugs.gnu.org; Wed, 25 Oct 2017 03:47:39 -0400 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 Message-ID: <59F04174.6090601@HIDDEN> Date: Wed, 25 Oct 2017 09:47:00 +0200 From: martin rudalics <rudalics@HIDDEN> MIME-Version: 1.0 References: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> <m2she7vluc.wl%esq@HIDDEN> In-Reply-To: <m2she7vluc.wl%esq@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable 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+hcp mB2EUpZDU/GTTdPqA4qemMhed+eeAwdLgDh+nXBTt2uaIoXz/nS/0KwWPDA0kgbolifaGtN X-Spam-Score: -3.0 (---) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.0 (---) > 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
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 25 Oct 2017 14:41:01 +0000 Resent-Message-ID: <handler.16475.B16475.150894244732345 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics <rudalics@HIDDEN> Cc: 16475 <at> debbugs.gnu.org, esq@HIDDEN Reply-To: Eli Zaretskii <eliz@HIDDEN> Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.150894244732345 (code B ref 16475); Wed, 25 Oct 2017 14:41:01 +0000 Received: (at 16475) by debbugs.gnu.org; 25 Oct 2017 14:40:47 +0000 Received: from localhost ([127.0.0.1]:33437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1e7MrP-0008Pb-IK for submit <at> debbugs.gnu.org; Wed, 25 Oct 2017 10:40:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1e7MrO-0008PN-7t for 16475 <at> debbugs.gnu.org; Wed, 25 Oct 2017 10:40:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1e7MrF-0001bd-0s for 16475 <at> debbugs.gnu.org; Wed, 25 Oct 2017 10:40:41 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1e7MrE-0001bP-TW; Wed, 25 Oct 2017 10:40:36 -0400 Received: from [176.228.60.248] (port=4878 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <eliz@HIDDEN>) id 1e7MrE-0007dF-B3; Wed, 25 Oct 2017 10:40:36 -0400 Date: Wed, 25 Oct 2017 17:40:24 +0300 Message-Id: <83po9b8f53.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-reply-to: <59F04174.6090601@HIDDEN> (message from martin rudalics on Wed, 25 Oct 2017 09:47:00 +0200) References: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> <m2she7vluc.wl%esq@HIDDEN> <59F04174.6090601@HIDDEN> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.0 (-----) > Date: Wed, 25 Oct 2017 09:47:00 +0200 > From: martin rudalics <rudalics@HIDDEN> > > > 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. It at least should be consistent about using BEGV/ZV vs BUF_BEGV/BUF_ZV. Either the code assumes that W displays the current buffer, or it doesn't. Also, I don't understand the need for this part: > else > { > (*FRAME_TERMINAL (f)->condemn_scroll_bars_hook) (f); > (*FRAME_TERMINAL (f)->judge_scroll_bars_hook) (f); > } We already call condemn_scroll_bars_hook at the beginning of a redisplay cycle, and call judge_scroll_bars_hook at its end. So why did you need to do it here again, for each window separately? More importantly, removing the scroll bar resizes the external dimensions of the frame, to keep the windows' dimensions unchanged (otherwise, we couldn't remove the scroll bars at the very end of the window's redisplay). You can see this in action if you toggle scroll-bar-mode on and off. So when the window shows _almost_ all the text of the buffer, the frame would annoyingly oscillate in its horizontal dimension. This could be caused, for example, by echo-area messages that resize the mini-window from time to time, or by the user adjusting the window size. By contrast, other applications I saw that remove the scroll bar when it is not needed leave the frame's dimensions alone, and instead leave more space for text display. That is much better, but doing this in Emacs would require to restructure the code that deals with the scroll bars, because we cannot change window dimensions after all the redisplay decisions were made, without requiring one more redisplay cycle. > 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. Actually, I think what happens with the removal of the horizontal scroll bar mirrors the vertical scroll bar, just in the other dimension. Namely, the frame's height is modified to leave the windows' dimensions unaltered. But again, this could easily cause annoying "oscillations" of the frame borders. So if we want to have this feature, it must be an opt-in, and I'd be interested how many people will like it.
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed References: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> In-Reply-To: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 25 Oct 2017 22:26:02 +0000 Resent-Message-ID: <handler.16475.B16475.150897034426775 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN>,Martin Rudalics <rudalics@HIDDEN> Cc: 16475 <at> debbugs.gnu.org Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.150897034426775 (code B ref 16475); Wed, 25 Oct 2017 22:26:02 +0000 Received: (at 16475) by debbugs.gnu.org; 25 Oct 2017 22:25:44 +0000 Received: from localhost ([127.0.0.1]:33726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1e7U7M-0006xn-BX for submit <at> debbugs.gnu.org; Wed, 25 Oct 2017 18:25:44 -0400 Received: from gateway22.websitewelcome.com ([192.185.47.144]:19959) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1e7U7K-0006xf-BY for 16475 <at> debbugs.gnu.org; Wed, 25 Oct 2017 18:25:42 -0400 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 800BC11C68 for <16475 <at> debbugs.gnu.org>; Wed, 25 Oct 2017 17:25:41 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id 7U7JenpdZRtUX7U7Je18gp; Wed, 25 Oct 2017 17:25:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Y/aQyingdB8OWFZ+BFNmElmeQlYdie9592bmLwRzFnQ=; b=DESH/A5z1nvIrdKUXqEHenfXJb HLBoGywoS6dNdmUFRoFWDoReV+EpBp11iuWb0KzWBzPZDTLviB5Nd5ZgRlbK4g7UxZbcADQb4KJc8 aUdK0ELj5UvE+LL8MSnro2lyDo/98lOtvqCSYo3C4Z/IrkKUaFmAJKOTJjGPTFld2hakC9veRqPtP NqqxYkyBR9jpyG5QxyK9CZCYbXOpzsoA7ff71YqVU1HHKXVvCJA81RLUuvOdmzfWNB0jWnemgxz8R W94vfb7aaeHmizXSqAbctZzm93AisiG09SKBvauUHR3TAwYpKscLE2xR+jNSOifPr5Qz5Nc23L+nS zIQAAIaQ==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50446 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from <esq@HIDDEN>) id 1e7U7I-0034wJ-Ne; Wed, 25 Oct 2017 17:25:40 -0500 Date: Wed, 25 Oct 2017 15:25:40 -0700 Message-ID: <m2k1zic1az.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1e7U7I-0034wJ-Ne X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:50446 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.0 (/) Thank you, Eli and Martin: I have incorporated the comment of Eli about being consistent by using BEGV/ZV vs BUF_BEGV/BUF_ZV. I have created a second draft based (in part) on the comment of Martin: "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." The visibility test for the beginning/ending points can be added in future drafts. Scroll bars are not immediately removed, however, when `window_contents_visible_p` is true and this-command is a keyboard stroke. I encountered the same problem with the first draft, and that is why I looked for a means to force immediate removal of the scroll bars by using the condemn/judge combination. Subsequently using the mouse scroll wheel *does* trigger scroll bar removal. Any ideas on how to immediately remove scroll bars from the target window when `window_contents_visible_p` is true? [I have chosen the end of `redisplay_window` to perform the test because window start/end *should be* accurate at that location of the code.] ptrdiff_t bob_disregard_narrow = BUF_BEG (buffer); ptrdiff_t eob_disregard_narrow = BUF_Z (buffer); ptrdiff_t bob_respect_narrow = BUF_BEGV (buffer); ptrdiff_t eob_respect_narrow = BUF_ZV (buffer); ptrdiff_t window_start = marker_position (w->start); ptrdiff_t window_end = eob_disregard_narrow - w->window_end_pos; ptrdiff_t buffer_size = eob_disregard_narrow - bob_disregard_narrow; bool buffer_narrowed_p = (eob_respect_narrow - bob_respect_narrow != buffer_size); bool window_contents_visible_p = (bob_respect_narrow == window_start && eob_respect_narrow == window_end); finish_scroll_bars: if ((WINDOW_HAS_VERTICAL_SCROLL_BAR (w) || WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w)) && !window_contents_visible_p) { if (WINDOW_HAS_VERTICAL_SCROLL_BAR (w)) /* Set the thumb's position and size. */ set_vertical_scroll_bar (w); if (WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w)) /* Set the thumb's position and size. */ set_horizontal_scroll_bar (w); /* Note that we actually used the scroll bar attached to this window, so it shouldn't be deleted at the end of redisplay. */ if (FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (*FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (w); } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATE: [10-25-2017 07:40:24] <25 Oct 2017 17:40:24 +0300> FROM: Eli Zaretskii <eliz@HIDDEN> > > * * * > > It at least should be consistent about using BEGV/ZV vs > BUF_BEGV/BUF_ZV. Either the code assumes that W displays the current > buffer, or it doesn't. > > Also, I don't understand the need for this part: > > > else > > { > > (*FRAME_TERMINAL (f)->condemn_scroll_bars_hook) (f); > > (*FRAME_TERMINAL (f)->judge_scroll_bars_hook) (f); > > } > > We already call condemn_scroll_bars_hook at the beginning of a > redisplay cycle, and call judge_scroll_bars_hook at its end. So why > did you need to do it here again, for each window separately?
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed Resent-From: martin rudalics <rudalics@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 26 Oct 2017 07:58:01 +0000 Resent-Message-ID: <handler.16475.B16475.150900465722841 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 16475 <at> debbugs.gnu.org, esq@HIDDEN Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.150900465722841 (code B ref 16475); Thu, 26 Oct 2017 07:58:01 +0000 Received: (at 16475) by debbugs.gnu.org; 26 Oct 2017 07:57:37 +0000 Received: from localhost ([127.0.0.1]:33957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1e7d2m-0005wL-Q4 for submit <at> debbugs.gnu.org; Thu, 26 Oct 2017 03:57:36 -0400 Received: from mout.gmx.net ([212.227.17.22]:63468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <rudalics@HIDDEN>) id 1e7d2l-0005w6-CH for 16475 <at> debbugs.gnu.org; Thu, 26 Oct 2017 03:57:35 -0400 Received: from [192.168.1.100] ([46.125.250.87]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lk81O-1db3RV3fzu-00cA6c; Thu, 26 Oct 2017 09:57:12 +0200 Message-ID: <59F1954B.7080705@HIDDEN> Date: Thu, 26 Oct 2017 09:56:59 +0200 From: martin rudalics <rudalics@HIDDEN> MIME-Version: 1.0 References: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> <m2she7vluc.wl%esq@HIDDEN> <59F04174.6090601@HIDDEN> <83po9b8f53.fsf@HIDDEN> In-Reply-To: <83po9b8f53.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:tr4oWuXgtxkgimJS6CHxLxC2FJd5iOf+eXasEqFUQEKpErvEMc3 0c7//8nBnLfAOmmygmiMtd09zCIVBwZcLRFQHWLLhYLz56rCHYUqwWduDjGrgb/4BUagseX h27vC5Bw6r7jTp4sS4L8/hbztWL6B5GLzxqj4lLGrJvNNW/N1UbUnCOw7bbMp/jEOE5aOul 4noyclfUOkk35xYf7HOcg== X-UI-Out-Filterresults: notjunk:1;V01:K0:q7XQX0NfXUk=:/SQdTnVCRhfsDa2RYgXmZv 19gPakYTDEr5U2fFsN0rVVfDZ1mNnkzFlox4EZD8w7wULCMBtk0hLzZncVmARnlOoNPj+zyCX IUwWk/cEX1ya94YF9upeFxOJhMt1sTShEL2MmXryawp8LtxI0yLeiQEeOywEmkFA2gXn5cBtF lW5OSY5L6D7KlmgoFbjigA5IOLTR9IvNYepU2pBuDX0XES9zpKi9IGVDAEnzDK6dx2qWECcES VscnuipeGHLBTa4TVqBVCHuIRyLfWl7R0J2cOqYQgVDgnW7h9ULDT0ampUIied7eWbur7dAH9 mLKV6DM7In5sFCwXBJp8AWymADAzbE0cwoVxZBvJsPvz5ZGwJGXGtn4s6Gm9m6DrTeBxFwR7O Bcot3drEipuTw+0V4Da2tOzASmtDi3rp5/CqlZKKJ2ufkBjXZ7FCF7Pu4uyLN1Yrle+c+ufxm V9bmInGJhIWlNxM68kwfUXEh5ba0QVRgxDa5jb1wgK1G9WGnp4CrxY74P2sg44WG8/iwRckZ8 vxjRgCGKjFqz5gEmpR0KUB91/tRCqhGls+z7XCxjN48fvsh4wCo0puqx0TzPP9H39uEeSpFxO k0obRmNcA7Xa1A5g7yH07Py8nc40fXbWhUGNcNAlXzANRPCoo/ap07IoVNsye2qyRvi8oO9d/ I//gj+guH0c/EhjzzT0rnvPmCib51UaZG0kF0zmvYj9bWLbWxQApwctRFN4GZaZSdPNBPcnPO 8hip8zSR08tw/2WgSe5X36PaTShENY/DaUplV99QIX/qGZ+A85FQq8R9IWzAkQy4KCk52JwkP imaAZZJwnyriX8oEpEQb6t0dvueG9a8i4jh0E97f1SP1qk66N/nHUpxS6P3C3cacvSIHdJB X-Spam-Score: -3.5 (---) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.5 (---) > More importantly, removing the scroll bar resizes the external > dimensions of the frame, to keep the windows' dimensions unchanged > (otherwise, we couldn't remove the scroll bars at the very end of the > window's redisplay). You can see this in action if you toggle > scroll-bar-mode on and off. So when the window shows _almost_ all the= > text of the buffer, the frame would annoyingly oscillate in its > horizontal dimension. This could be caused, for example, by echo-area= > messages that resize the mini-window from time to time, or by the user= > adjusting the window size. Obviously, an equivalent of =E2=80=98set-window-scroll-bars=E2=80=99 woul= d have to be used here. > By contrast, other applications I saw that remove the scroll bar when > it is not needed leave the frame's dimensions alone, and instead leave= > more space for text display. That is much better, but doing this in > Emacs would require to restructure the code that deals with the scroll= > bars, because we cannot change window dimensions after all the > redisplay decisions were made, without requiring one more redisplay > cycle. We cannot simply remove scroll bars by "clearing" the unused space with the window's background whatever that is. There might be a highlighted region or some other background that extends to the end of the line on any line displayed in that window. And obviously we have to "move" the fringes and the margins to the right and I didn't even talk about scroll bars on the left ... >> Auto-removal of horizontal scroll bars is more complicated. Basicall= y, >> 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 l= ine >> and that line could be awfully long. > > Actually, I think what happens with the removal of the horizontal > scroll bar mirrors the vertical scroll bar, just in the other > dimension. Namely, the frame's height is modified to leave the > windows' dimensions unaltered. But again, this could easily cause > annoying "oscillations" of the frame borders. Again =E2=80=98set-window-scroll-bars=E2=80=99 would take care of that. martin
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 26 Oct 2017 16:00:02 +0000 Resent-Message-ID: <handler.16475.B16475.150903356317389 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics <rudalics@HIDDEN> Cc: 16475 <at> debbugs.gnu.org, esq@HIDDEN Reply-To: Eli Zaretskii <eliz@HIDDEN> Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.150903356317389 (code B ref 16475); Thu, 26 Oct 2017 16:00:02 +0000 Received: (at 16475) by debbugs.gnu.org; 26 Oct 2017 15:59:23 +0000 Received: from localhost ([127.0.0.1]:35272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1e7kZ0-0004WP-Se for submit <at> debbugs.gnu.org; Thu, 26 Oct 2017 11:59:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1e7kYz-0004WC-1z for 16475 <at> debbugs.gnu.org; Thu, 26 Oct 2017 11:59:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1e7kYq-0005QT-Jt for 16475 <at> debbugs.gnu.org; Thu, 26 Oct 2017 11:59:15 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58437) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1e7kYq-0005QN-GZ; Thu, 26 Oct 2017 11:59:12 -0400 Received: from [176.228.60.248] (port=2119 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <eliz@HIDDEN>) id 1e7kYp-0005MR-SU; Thu, 26 Oct 2017 11:59:12 -0400 Date: Thu, 26 Oct 2017 18:59:02 +0300 Message-Id: <8360b199yx.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-reply-to: <59F1954B.7080705@HIDDEN> (message from martin rudalics on Thu, 26 Oct 2017 09:56:59 +0200) References: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> <m2she7vluc.wl%esq@HIDDEN> <59F04174.6090601@HIDDEN> <83po9b8f53.fsf@HIDDEN> <59F1954B.7080705@HIDDEN> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.0 (-----) > Date: Thu, 26 Oct 2017 09:56:59 +0200 > From: martin rudalics <rudalics@HIDDEN> > CC: esq@HIDDEN, 16475 <at> debbugs.gnu.org > > > More importantly, removing the scroll bar resizes the external > > dimensions of the frame, to keep the windows' dimensions unchanged > > (otherwise, we couldn't remove the scroll bars at the very end of the > > window's redisplay). You can see this in action if you toggle > > scroll-bar-mode on and off. So when the window shows _almost_ all the > > text of the buffer, the frame would annoyingly oscillate in its > > horizontal dimension. This could be caused, for example, by echo-area > > messages that resize the mini-window from time to time, or by the user > > adjusting the window size. > > Obviously, an equivalent of ‘set-window-scroll-bars’ would have to be > used here. I agree, but then the right place to call this is not from redisplay, but from keyboard.c, before it calls read_char (which calls redisplay). set-window-scroll-bars triggers a redisplay cycle, so calling it from (the end of) redisplay is not very wise, IMO.
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed References: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> In-Reply-To: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> Resent-From: Keith David Bershatsky <esq@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 26 Oct 2017 16:04:01 +0000 Resent-Message-ID: <handler.16475.B16475.150903379617861 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 16475 <at> debbugs.gnu.org, Martin Rudalics <rudalics@HIDDEN> Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.150903379617861 (code B ref 16475); Thu, 26 Oct 2017 16:04:01 +0000 Received: (at 16475) by debbugs.gnu.org; 26 Oct 2017 16:03:16 +0000 Received: from localhost ([127.0.0.1]:35288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1e7kcl-0004e1-Se for submit <at> debbugs.gnu.org; Thu, 26 Oct 2017 12:03:16 -0400 Received: from gateway30.websitewelcome.com ([192.185.197.25]:40278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <esq@HIDDEN>) id 1e7kcj-0004ds-B5 for 16475 <at> debbugs.gnu.org; Thu, 26 Oct 2017 12:03:13 -0400 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 7CCA479F2 for <16475 <at> debbugs.gnu.org>; Thu, 26 Oct 2017 11:03:12 -0500 (CDT) Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id 7kcieddo0DL8r7kcieUBws; Thu, 26 Oct 2017 11:03:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6MxFR5EWmK1sI2sSQ4WhKYUitLRGKEeGJlLAqwsSK9g=; b=dejKL9Fswb+ydJmYEbplHMFBBF mqsM8yX1q4Fks++NF4S+gxscg3gUuKF5w/o45yUxuLkox8tShjzQwPI58EA+3/vOWui6gdaLrPsDt jplir+ogoFqgATrIRvrtqcTzQtBjwNxWedFqhZ8KdOoydYLYYz4J4F1kVg0KUrHq5Jqgx6S34/9Dw ymJBVgIua4OFF88N0w6GfIHJ70RzQA1YP9eLcNGM538hO1VvksQ/+DKzPnfjCPusFzwU7tA7qqwJ3 Rmbew9MPRR2Y6ed4+LT3HiK6vfuYruTq8vTaPJzQLoedwcQFXREPLP+ljFgDHkLIKDpwmNwVIccN1 hHqomqrw==; Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:49266 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from <esq@HIDDEN>) id 1e7kch-000VLB-Fb; Thu, 26 Oct 2017 11:03:11 -0500 Date: Thu, 26 Oct 2017 09:03:10 -0700 Message-ID: <m24lql99s1.wl%esq@HIDDEN> From: Keith David Bershatsky <esq@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1e7kch-000VLB-Fb X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private) [45.48.239.195]:49266 X-Source-Auth: lawlist X-Email-Count: 2 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.0 (/) The values for window-start and window-end will not necessarily be accurate until somewhere towards the end of redisplay. A test that relies upon those values to add/remove scroll bars will often fail. Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATE: [10-26-2017 08:59:02] <26 Oct 2017 18:59:02 +0300> FROM: Eli Zaretskii <eliz@HIDDEN> > > * * * > > I agree, but then the right place to call this is not from redisplay, > but from keyboard.c, before it calls read_char (which calls > redisplay). set-window-scroll-bars triggers a redisplay cycle, so > calling it from (the end of) redisplay is not very wise, IMO.
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 26 Oct 2017 16:31:01 +0000 Resent-Message-ID: <handler.16475.B16475.150903544323238 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Keith David Bershatsky <esq@HIDDEN> Cc: 16475 <at> debbugs.gnu.org, rudalics@HIDDEN Reply-To: Eli Zaretskii <eliz@HIDDEN> Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.150903544323238 (code B ref 16475); Thu, 26 Oct 2017 16:31:01 +0000 Received: (at 16475) by debbugs.gnu.org; 26 Oct 2017 16:30:43 +0000 Received: from localhost ([127.0.0.1]:35330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1e7l3L-00062L-2U for submit <at> debbugs.gnu.org; Thu, 26 Oct 2017 12:30:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36649) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1e7l3H-0005sj-2x for 16475 <at> debbugs.gnu.org; Thu, 26 Oct 2017 12:30:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1e7l36-0002pq-6b for 16475 <at> debbugs.gnu.org; Thu, 26 Oct 2017 12:30:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59254) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1e7l36-0002pg-0s; Thu, 26 Oct 2017 12:30:28 -0400 Received: from [176.228.60.248] (port=2225 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <eliz@HIDDEN>) id 1e7l35-0006SA-BX; Thu, 26 Oct 2017 12:30:27 -0400 Date: Thu, 26 Oct 2017 19:30:17 +0300 Message-Id: <83zi8d7tye.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-reply-to: <m2k1zic1az.wl%esq@HIDDEN> (message from Keith David Bershatsky on Wed, 25 Oct 2017 15:25:40 -0700) References: <m2k1zic1az.wl%esq@HIDDEN> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.0 (-----) > Date: Wed, 25 Oct 2017 15:25:40 -0700 > From: Keith David Bershatsky <esq@HIDDEN> > Cc: 16475 <at> debbugs.gnu.org > > Scroll bars are not immediately removed, however, when `window_contents_visible_p` is true and this-command is a keyboard stroke. Most probably because some redisplay optimization bypasses your code. > Any ideas on how to immediately remove scroll bars from the target window when `window_contents_visible_p` is true? [I have chosen the end of `redisplay_window` to perform the test because window start/end *should be* accurate at that location of the code.] Like I said: I think the way this works will cause annoying visual effects, so I propose to call set-window-scroll-bars from keyboard.c, before we enter redisplay.
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 26 Oct 2017 17:09:02 +0000 Resent-Message-ID: <handler.16475.B16475.150903768531219 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Keith David Bershatsky <esq@HIDDEN> Cc: 16475 <at> debbugs.gnu.org, rudalics@HIDDEN Reply-To: Eli Zaretskii <eliz@HIDDEN> Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.150903768531219 (code B ref 16475); Thu, 26 Oct 2017 17:09:02 +0000 Received: (at 16475) by debbugs.gnu.org; 26 Oct 2017 17:08:05 +0000 Received: from localhost ([127.0.0.1]:35355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1e7ldV-00087T-H0 for submit <at> debbugs.gnu.org; Thu, 26 Oct 2017 13:08:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1e7ldS-00086y-Hf for 16475 <at> debbugs.gnu.org; Thu, 26 Oct 2017 13:08:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1e7ldM-00044o-9n for 16475 <at> debbugs.gnu.org; Thu, 26 Oct 2017 13:07:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1e7ldF-0003ut-Hf; Thu, 26 Oct 2017 13:07:49 -0400 Received: from [176.228.60.248] (port=2244 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from <eliz@HIDDEN>) id 1e7ldF-0007cv-0P; Thu, 26 Oct 2017 13:07:49 -0400 Date: Thu, 26 Oct 2017 20:07:39 +0300 Message-Id: <83vaj17s84.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-reply-to: <m24lql99s1.wl%esq@HIDDEN> (message from Keith David Bershatsky on Thu, 26 Oct 2017 09:03:10 -0700) References: <m24lql99s1.wl%esq@HIDDEN> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.0 (-----) > Date: Thu, 26 Oct 2017 09:03:10 -0700 > From: Keith David Bershatsky <esq@HIDDEN> > Cc: 16475 <at> debbugs.gnu.org,Martin Rudalics <rudalics@HIDDEN> > > The values for window-start and window-end will not necessarily be accurate until somewhere towards the end of redisplay. A test that relies upon those values to add/remove scroll bars will often fail. We have the ability to check whether the entire buffer fits in the window without actually displaying it. The move_it_to function can be used for that.
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed Resent-From: Richard Stallman <rms@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 27 Oct 2017 02:45:02 +0000 Resent-Message-ID: <handler.16475.B16475.15090722899272 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics <rudalics@HIDDEN> Cc: 16475 <at> debbugs.gnu.org, eliz@HIDDEN, esq@HIDDEN Reply-To: rms@HIDDEN Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.15090722899272 (code B ref 16475); Fri, 27 Oct 2017 02:45:02 +0000 Received: (at 16475) by debbugs.gnu.org; 27 Oct 2017 02:44:49 +0000 Received: from localhost ([127.0.0.1]:35849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1e7udc-0002PT-DK for submit <at> debbugs.gnu.org; Thu, 26 Oct 2017 22:44:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <rms@HIDDEN>) id 1e7uda-0002PF-Sl for 16475 <at> debbugs.gnu.org; Thu, 26 Oct 2017 22:44:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <rms@HIDDEN>) id 1e7udV-0005e5-4m for 16475 <at> debbugs.gnu.org; Thu, 26 Oct 2017 22:44:41 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rms@HIDDEN>) id 1e7udS-0005Yv-Kg; Thu, 26 Oct 2017 22:44:38 -0400 Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from <rms@HIDDEN>) id 1e7udS-0001VM-0W; Thu, 26 Oct 2017 22:44:38 -0400 Content-Type: text/plain; charset=Utf-8 From: Richard Stallman <rms@HIDDEN> In-reply-to: <59F1954B.7080705@HIDDEN> (message from martin rudalics on Thu, 26 Oct 2017 09:56:59 +0200) References: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> <m2she7vluc.wl%esq@HIDDEN> <59F04174.6090601@HIDDEN> <83po9b8f53.fsf@HIDDEN> <59F1954B.7080705@HIDDEN> Message-Id: <E1e7udS-0001VM-0W@HIDDEN> Date: Thu, 26 Oct 2017 22:44:38 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.0 (-----) [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] I would find it annoying for the scroll bar to appear and disappear. I have nothing against offering that feature but I'd like to turn it off. -- Dr Richard Stallman President, Free Software Foundation (gnu.org, fsf.org) Internet Hall-of-Famer (internethalloffame.org) Skype: No way! See stallman.org/skype.html.
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed Resent-From: martin rudalics <rudalics@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 27 Oct 2017 08:27:01 +0000 Resent-Message-ID: <handler.16475.B16475.150909278316152 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: 16475 <at> debbugs.gnu.org, esq@HIDDEN Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.150909278316152 (code B ref 16475); Fri, 27 Oct 2017 08:27:01 +0000 Received: (at 16475) by debbugs.gnu.org; 27 Oct 2017 08:26:23 +0000 Received: from localhost ([127.0.0.1]:35928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1e7zyB-0004CR-E3 for submit <at> debbugs.gnu.org; Fri, 27 Oct 2017 04:26:23 -0400 Received: from mout.gmx.net ([212.227.15.15]:56639) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <rudalics@HIDDEN>) id 1e7zy8-0004C6-7d for 16475 <at> debbugs.gnu.org; Fri, 27 Oct 2017 04:26:22 -0400 Received: from [192.168.1.100] ([46.125.249.5]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MHX0m-1eBHke2iIG-003Lv6; Fri, 27 Oct 2017 10:25:56 +0200 Message-ID: <59F2ED92.70702@HIDDEN> Date: Fri, 27 Oct 2017 10:25:54 +0200 From: martin rudalics <rudalics@HIDDEN> MIME-Version: 1.0 References: <8bfbddfb-237e-47b1-aed7-b28fc97d1f92@default> <m2she7vluc.wl%esq@HIDDEN> <59F04174.6090601@HIDDEN> <83po9b8f53.fsf@HIDDEN> <59F1954B.7080705@HIDDEN> <8360b199yx.fsf@HIDDEN> In-Reply-To: <8360b199yx.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:1yMSJXt/3+okX6DIOIcDbg8IGCPxhvzXi/B9aUtr+ZMzUIP9lsw PxFQrlYseiv9WphB4Dl8iL+pUmBmrI95Bylm70z6rzkhLWEnecv9S98ag41Ofj9VZ2oKeyr PxbSHXBFtyLFwQvWuQX4+DlvZbXnTgAdaztyd52RWDiciuN9hipkNLvll1A0zlYvQPHbGEe /rfYDAH2iawb8pVclUDIw== X-UI-Out-Filterresults: notjunk:1;V01:K0:nb1r7nbLu5k=:mxCm0FJZEuxNgVzsS8i924 RSWoYQz44cFBLp83sQnJXYdBSjH0dLY3rvmOJM0v/DCZho0gjNuamZrMvz34hR3sidBWpuXVH mSdO3SH9FB6AlcNLF7S72a13WsOx675a8yZt9spD+1cnvv7BZRai1lJ07h+lUisb6/VdjUthJ MMyJyFYktKqlxRk5WGiBEIbt4sVaV9WPsHX3e2A7ctuVIsgIUhF2y1Wezhvgs/pCGpNnBLS/U THLZrKKSogvq+e0B5228pHVovAfmtDoURgKwJTa8D2HOtgAKehH5vkBoECB5M7nORrrA3/VEJ qgHvYIFPgNyxIbuQ5ZA82gDPJt2+wkrV+Wu9NpJFZMzoDS64Svijhbo7+SjHsNrD/JDTofUA8 cN+R4qm5CCZ+z+PP4xDt8gZtf11Mo4s3vDKR4jnshZLh9Xsd307RjVbciH6fodCJRQuwcOUH1 mg2j6mDOjNr8KkBBCcXz3w32PLiNXdCsQxjFhZz+gjbRsmC6rtZIXQWKTprL5LoFmClz4Jy2H sxTymi1HIXIkYNSlEOwko1CPCHcQqrcizEdqK+VHDdDrww5Q56qRBwx2jOh6GvxusM9q9WfNU EdALhDQ9a/5tQAr28b2+O9HyNwHQXpbbckz+/WsQ2yxMntbu4/Sw5Imiobk7a+csaF4IQSY4B ak0YoCT4t2+BEVME6QxgrLu8KZmRl5JI1RCd6KT9K86i6mpJqToX2KhROdN03loNQAIDqPCcu iJsMKvLqLeehLauj28D/pznoNy3OlJyTyIJ+m35IM8TUXQ5lHSchyp6ExQWFsV3iP1SK8c7hs WjLvdDW1BP94lG/qkXjytOvA/R43UUwYFYCOOa3lMPwY7flwspvrSmGiLXCGvUx3o9Nj+/2 X-Spam-Score: -0.2 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.2 (/) >> Obviously, an equivalent of =E2=80=98set-window-scroll-bars=E2=80=99 = would have to be >> used here. > > I agree, but then the right place to call this is not from redisplay, > but from keyboard.c, before it calls read_char (which calls > redisplay). set-window-scroll-bars triggers a redisplay cycle, so > calling it from (the end of) redisplay is not very wise, IMO. It's ecologically questionable in any case: After every change affecting the buffer (insertion/deletion, overlays, visibility) we'd have to check whether its text still fits into its window(s) and then either add or remove the scroll bar(s). And note that we may scroll lines out of view (and thus implicitly should show a vertical scroll bar) even when the text would entirely fit into its window. martin
X-Loop: help-debbugs@HIDDEN Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed Resent-From: martin rudalics <rudalics@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 27 Oct 2017 08:27:02 +0000 Resent-Message-ID: <handler.16475.B16475.150909278316158 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 16475 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN>, Keith David Bershatsky <esq@HIDDEN> Cc: 16475 <at> debbugs.gnu.org Received: via spool by 16475-submit <at> debbugs.gnu.org id=B16475.150909278316158 (code B ref 16475); Fri, 27 Oct 2017 08:27:02 +0000 Received: (at 16475) by debbugs.gnu.org; 27 Oct 2017 08:26:23 +0000 Received: from localhost ([127.0.0.1]:35930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1e7zyB-0004CT-LJ for submit <at> debbugs.gnu.org; Fri, 27 Oct 2017 04:26:23 -0400 Received: from mout.gmx.net ([212.227.15.19]:64902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <rudalics@HIDDEN>) id 1e7zy9-0004C9-PH for 16475 <at> debbugs.gnu.org; Fri, 27 Oct 2017 04:26:22 -0400 Received: from [192.168.1.100] ([46.125.249.5]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Mbwm6-1dqsYR0GbG-00JIaw; Fri, 27 Oct 2017 10:26:01 +0200 Message-ID: <59F2ED98.3010805@HIDDEN> Date: Fri, 27 Oct 2017 10:26:00 +0200 From: martin rudalics <rudalics@HIDDEN> MIME-Version: 1.0 References: <m24lql99s1.wl%esq@HIDDEN> <83vaj17s84.fsf@HIDDEN> In-Reply-To: <83vaj17s84.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:pbFjRU4y54leVKp7euHcukbcSld/X1lfuimgXusgui4cmyOHQHn hAvTB1Xvpp/Q3vEypW9hzQxcr8zbmfntMF/uz+T46Wise+7efyzTUSkLrApoy92S94VSM29 QpBwr6ZeXl3Ig7evIoj2aLz2T5sZKeBO1cp2rXbmTN02U737F743IUmo472lx8/Go+latH3 j2gvAdGzfS4rAzHeCgAlg== X-UI-Out-Filterresults: notjunk:1;V01:K0:NsHNYr8lTFA=:yg88ZtqEbb+khp+n2kmT2Q GJlx2gydWYzUoBegSNRSSpzj6znIleZmk534atG8LqUonZgy4Ojo5Q/zLUsNj3r+uEHkDU9U4 14xVEq0GLWMLKm2ou680lvN4Som0Zi0hkFUepLhFFQeqSq2ZFhfMe4k2J6qL7cFiwx6wT/WuR lNM+N4jbqVPC4zOFInfumWyHG8N5HDYaIRBlQ9UcTHtgvPnGVB5VaMfEBENpO00jaas3qRH2n EJA7JtFXAVXJTM1Vn4OPUWc71yW78vgCxYidv6zkDWLgPY0gplSbfzHMtrmD61tN1ERBj+PMZ o24sVZQvCNwFiUdrXSWKDcCZBWklQBIPDQke52v6FJ1qGNBn4iPyo6MJjIz7ylyw6+1nBJygN AXkFTYSgW2qlkCQA94sHqvSmxTXUi4PdpQff+94RFwBPZM8GVXGz6NhEgIrs+Y2TP2SUSTZ4E b5HC2ThQ6vA9vl5skBI5ggzVN/4YnaBrMUDXqOhGDtviQBAp5JgDSZG/1bOwSZwTeWjFmQFhl gkPogS6ZZXdE5C7BfzouU7ypQHcgJwMUZQA7HdlPW5H5tqzTLLFbjg6I82PMCAM6XYsUD1/4f 0FaKFG8L6a2qxSHBycj0DMZ66pR/IJqFcA1ELcLG5a1vEcu4Oj/+shNvJo6gV7r1ifYw3cz/L /bGLkK44lEU9qWDuqAmvtrqh4rRMu8Jj+GNQMz57/6pPu9GPyMOQ0yj5Lnx1TP31r3OD0+hzX ZjnY74C8cqMY9QdZb51w9yCJQ3XGOhABZJdc6HEItzmE5B2ngjn4PgSyDMHTzkZMUKps5c9ci oBdphXRqwUxSCusXESABrxqOCmnHB29c2zMvX25+tF73IJMgYWJ0/aBAnhOOXgJYWeB2cTJ X-Spam-Score: -0.2 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.2 (/) > We have the ability to check whether the entire buffer fits in the > window without actually displaying it. The move_it_to function can be= > used for that. Or =E2=80=98window-text-pixel-size=E2=80=99. martin
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.