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.bugs Subject: bug#62676: Setting `scroll-bar-width` Doesn't Take Effect Immediately Date: Wed, 05 Apr 2023 12:02:25 +0300 Message-ID: <83pm8isnvi.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36291"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62676@debbugs.gnu.org To: Shynur Xie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 05 11:03:16 2023 Return-path: Envelope-to: geb-bug-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 1pjz2y-0009H2-6e for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Apr 2023 11:03:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjz2m-0005jV-CJ; Wed, 05 Apr 2023 05:03:04 -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 1pjz2k-0005iz-Dx for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2023 05:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjz2k-0000VW-5Z for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2023 05:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pjz2k-0006xQ-0O for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2023 05:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Apr 2023 09:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62676 X-GNU-PR-Package: emacs Original-Received: via spool by 62676-submit@debbugs.gnu.org id=B62676.168068533226678 (code B ref 62676); Wed, 05 Apr 2023 09:03:01 +0000 Original-Received: (at 62676) by debbugs.gnu.org; 5 Apr 2023 09:02:12 +0000 Original-Received: from localhost ([127.0.0.1]:50881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjz1v-0006wE-V4 for submit@debbugs.gnu.org; Wed, 05 Apr 2023 05:02:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjz1u-0006vy-Lu; Wed, 05 Apr 2023 05:02:11 -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 1pjz1p-00072W-5K; Wed, 05 Apr 2023 05:02:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=wb7RVeib1q9lhWtka1zZsOo8nEqnt84TOTftlhdbqSg=; b=PeNL7e+5kZQXC7X3svCu imGexE4dNALUTg+WJWajxYK8idi3vCEFodmts5Rq1XMeljgvHcdy4tDjul6KFouSInx+IsvZvBdAD TvH/8Es+YTZfGtU0r53SYm/bA/vq5VNAHI6HmMUx8tAio956XLvehn6PHO3rBsCZ4s0m4h84oLARn 4MTdZIuFPbDIEiXsArwXSkK2tTyqW5ZpfyXzkTYcxYQ4Vfi+IBwT62RI1GkVD/MQm1yokSJXHTvh7 sNN36feLcSwLJhVPnIInL1ZOc9KBm+QD8CO05LsLJtIjnoMzENhZh/5t3vWw8bZpu6BVuVWBDhehT N1KKfee/1rsvkg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjz1j-0003t3-CW; Wed, 05 Apr 2023 05:02:02 -0400 In-Reply-To: (message from Shynur Xie on Wed, 5 Apr 2023 08:18:00 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259259 Archived-At: tags 62676 notabug thank > From: Shynur Xie > Date: Wed, 5 Apr 2023 08:18:00 +0000 > > Example: > > ``` > $ emacs -Q > ``` > > Now the current buffer is "*scratch*", evaluating: > > ``` > (setq scroll-bar-width 50) > ``` > > changes nothing. > > Instead, user need to switch to another buffer and then switch back: > > ``` > (progn > (setq scroll-bar-width 50) > (switch-to-buffer "*Messages*") > (switch-to-buffer "*scratch*")) > ``` This is the expected and documented behavior. From the ELisp Reference manual: If you do not specify a window’s scroll bar settings via ‘set-window-scroll-bars’, the buffer-local variables ‘vertical-scroll-bar’, ‘horizontal-scroll-bar’, ‘scroll-bar-width’ and ‘scroll-bar-height’ in the buffer being displayed control the window’s scroll bars. The function ‘set-window-buffer’ examines these variables. If you change them in a buffer that is already visible in a window, you can make the window take note of the new values by calling ‘set-window-buffer’ specifying the same buffer that is already displayed. Your last recipe calls set-window-buffer indirectly, so it succeeds where the original recipe failed.