From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Improving Scroll Bar Tools Date: Sat, 11 May 2024 11:31:45 +0300 Message-ID: <86plts3g26.fsf@gnu.org> References: <875xvl25sx.fsf@yahoo.com> <871q69237j.fsf@yahoo.com> <1ICXks4QeJPHggA-e4wSMYxpTpXSYkXJBnUqpf2GfutGPYTX-qKpvK__UEV5IV-7BZ_iTCVCXIJwF0F5Z3gkxrhRtvO-Bz40azno5wGTLdM=@protonmail.com> <86seyo3kkf.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23850"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 11 10:32:26 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s5i9a-000601-LC for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 11 May 2024 10:32:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5i92-0000Fj-OC; Sat, 11 May 2024 04:31:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5i90-0000FG-K0 for help-gnu-emacs@gnu.org; Sat, 11 May 2024 04:31:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5i90-0004se-Bv for help-gnu-emacs@gnu.org; Sat, 11 May 2024 04:31:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=b2xuYknji5mvIi+S7nvhjRWDpm1fxqyGxpS2eKcWb0w=; b=c0U4mpiAZRUt Tlm2a0yjcLgzaRVjOYwz81OQFwW1pTajpcfrc1yroORdRj7bMNge1orE2UttfjypxVoJqW3rjIacs 04iMglBuRMJ4WIXpsjXq+yW7yQT7T3z9xtVSCjGpsxHEOmGeDUcPrzbhuFy9qAVo5BC2oGc5hPXFi juVqMNGByYe2hpR4eTRDzVeFNYReiL99icEdQie/9/PIrR0/9vmu3FLMIZmQqJsICYaSnP4F93HE6 vmoVFvl/z3e5Tb2a32BIigUEL2vyfyA0g/fBn2Qoi3ANq4aQBXSm95Rt+Iv05qcppoC4EiJu0pyBO 3RT5S7BK1G1FwS6uYJNJFg==; In-Reply-To: (message from Heime on Sat, 11 May 2024 07:28:33 +0000) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146677 Archived-At: > Date: Sat, 11 May 2024 07:28:33 +0000 > From: Heime > Cc: help-gnu-emacs@gnu.org > > Sent with Proton Mail secure email. > > On Saturday, May 11th, 2024 at 6:54 PM, Eli Zaretskii wrote: > > > > Date: Sat, 11 May 2024 00:12:11 +0000 > > > From: Heime heimeborgia@protonmail.com > > > Cc: Po Lu luangruo@yahoo.com, > > > Heime via Users list for the GNU Emacs text editor help-gnu-emacs@gnu.org > > > > > > I have seen that applying vertical and horizontal scroll bars with > > > > > > (set-window-scroll-bars (selected-window) nil 'right nil 'bottom nil) > > > > > > will not let the following to take complete effect an all windows in frame > > > > > > (scroll-bar-mode 1) > > > (horizontal-scroll-bar-mode 0) > > > > > > The ELisp manual clearly says that set-window-scroll-bars overrides > > the frame-specific settings of scroll bars. > > This is a problem because if one forgets changing some window with > set-window-scroll-bars, and the modes do not work, it is a problem. > > If one wants to remove horizontal scroll in all windows in frame, > the command should be expected to do so, nothwithstanding any > previous changes with a different command (e.g. set-window-scroll-bars). You are mixing two different levels of functions. scroll-bar-mode and horizontal-scroll-bar-mode are user commands, whereas set-window-scroll-bars is a Lisp function. If there is a contradiction between them, it is a problem for the user-level functionality which mixes them, and it is up to that user-level functionality (presumably, some code you have written) to fix the problem, whatever it is. Since scroll-bar-mode and horizontal-scroll-bar-mode are minor modes, they each one have a hook, which could be used to turn off window-specific scroll bars. However, I don't recommend that because that would prevent users from having window-specific scroll bars that do not heed to frame-global settings. IOW, you will be coding a feature that works against documented Emacs behavior.