4

It's not clear to me how to disable a window scroll bar.

I have frame scrollbars turned off:

(scroll-bar-mode -1)

I can enable a window scroll bar with

(set-window-scroll-bars (selected-window) nil 'right)

I expect the following to remove the scroll bar, but it doesn't. It only removes the fringe adjacent to the scroll bar.

(set-window-scroll-bars (selected-window) nil nil nil nil)

Checking (window-current-scroll-bars (selected-window)), it returns nil as expected. My understanding is that window-current-scroll-bars should tell me the dimensions of the window's scroll bar, returning nil if there is no scroll bar.

Maybe it's a frame scroll bar that somehow snuck in? Yet (frame-current-scroll-bars) returns nil as expected.

If I do something like C-h f or M-x after calling (set-window-scroll-bars (selected-window) nil nil nil nil), the scroll bar will disappear. Yet simply switching windows does nothing. The scroll bar remains.

I'm confused! Am I missing something?

I am using GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30.

  • 2
    I can't reproduce this. (set-window-scroll-bars (selected-window) nil nil nil nil) removes the scroll bar as expected, starting from emacs -Q, on Emacs 27.0.50 – Tyler Mar 19 at 18:43
4

This appears to be a bug in Emacs. Although the bug fix has been pushed to the Emacs-26 branch, these changes either don't solve the problem or are not reflected in the latest Emacs 26 build, which is the version I am using (i.e. GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30).

Trying the latest Emacs-27 development snapshot, the problem has been fixed, as indicated by @Tyler.

  • 1
    That fix will be available once emacs-26.2 is released. – rpluim Mar 21 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.