all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Shynur Xie <one.last.kiss@outlook.com>
Cc: 62676@debbugs.gnu.org
Subject: bug#62676: Setting `scroll-bar-width` Doesn't Take Effect Immediately
Date: Wed, 05 Apr 2023 12:02:25 +0300	[thread overview]
Message-ID: <83pm8isnvi.fsf@gnu.org> (raw)
In-Reply-To: <SA0PR04MB7433D646C0FC3D8C85B5C3C6D7909@SA0PR04MB7433.namprd04.prod.outlook.com> (message from Shynur Xie on Wed, 5 Apr 2023 08:18:00 +0000)

tags 62676 notabug
thank

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





  reply	other threads:[~2023-04-05  9:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05  8:18 bug#62676: Setting `scroll-bar-width` Doesn't Take Effect Immediately Shynur Xie
2023-04-05  9:02 ` Eli Zaretskii [this message]
     [not found]   ` <SA0PR04MB74332C1E5B0C1C8BC6FBC379D7909@SA0PR04MB7433.namprd04.prod.outlook.com>
2023-04-05  9:55     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83pm8isnvi.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=62676@debbugs.gnu.org \
    --cc=one.last.kiss@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.