GNU bug report logs - #62676
Setting `scroll-bar-width` Doesn't Take Effect Immediately

Previous Next

Package: emacs;

Reported by: Shynur Xie <one.last.kiss <at> outlook.com>

Date: Wed, 5 Apr 2023 08:24:01 UTC

Severity: normal

Tags: notabug

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #10 received at control <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Shynur Xie <one.last.kiss <at> outlook.com>
Cc: 62676 <at> debbugs.gnu.org
Subject: Re: bug#62676: Setting `scroll-bar-width` Doesn't Take Effect
 Immediately
Date: Wed, 05 Apr 2023 12:02:25 +0300
tags 62676 notabug
thank

> From: Shynur Xie <one.last.kiss <at> outlook.com>
> 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.




This bug report was last modified 2 years and 46 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.