2

By default, sr-speedbar seems to always want to take 50% of available window space.

I'm trying to change it's default size to something smaller (like 40 px), but I can't seem to figure out how as the option sr-speedbar-width-x doesn't seem to do anything.

Here's a snippet from my init.el. All the other options are working just fine

(setq 
    sr-speedbar-width-x 40
    speedbar-use-images nil
    speedbar-show-unknown-files t
    sr-speedbar-right-side nil
    )

(when window-system
    (sr-speedbar-open))
2

Either you have a typo in your width setup or that variable existed in an older version of sr-speedbar.

The variable to configure width in the current version is sr-speedbar-width (without the '-x').

Here is how to configure the width:

  • First and foremost, close the speedbar if open. This is a crucial step because sr-speedbar "remembers" the speedbar width when closing. So if you change the value of sr-speedbar-width and then close the speedbar ( sr-speedbar-close ), that variable will be overwritten with the current width of speedbar.
  • Then, do (setq sr-speedbar-width 40).

I have tested this to work with version 20140914.2339 of sr-speedbar on emacs 24.4.

  • "sr-speedbar-width-x" was the problem as it should have been "sr-speedbar-width". – Zamicol Feb 11 '15 at 16:45
  • I have similar problems to Zamicol, and the tip does not work. This is what I have. (use-package speedbar :config (setq speedbar-use-images nil speedbar-show-unknown-files t) (use-package sr-speedbar :ensure t :config (setq sr-speedbar-right-side nil sr-speedbar-max-width 40 sr-speedbar-width 30 sr-speedbar-default-width 30 sr-speedbar-skip-other-window-p t))) – Swarnendu Biswas May 15 '15 at 18:07
  • @SwarnenduBiswas I eval'd your use-package snippet and it works fine. I then closed sr-speedbar first, then changed the sr-speedbar-width, re-eval'd the use-package snippet and reopened sr-speedbar and the width change was effective. – Kaushal Modi May 15 '15 at 18:26

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.