I have sr-sppedbar always turned on, but whenever I start, I have to manually click the code window to switch the cursor from speedbar to the codes. How do I start emacs with cursor in the main window instead of sr-speedbar?
Update: It works after adding (other-window 1) to start hook in init.el.
startup.el
which is hard-coded into the executable, and people often have desktop restore features, such asdesktop.el
activated. Selecting the right window/buffer at start-up is always a trick, and this is why I created my ownstartup.el
and build Emacs from source. The easiest thing to do will be to place a line of code at the bottom of your.emacs
file or add a function to theemacs-startup-hook
that runs last in time. Essentially, you want to use(select-window WINDOW)
or simply(other-window COUNT)
. – lawlist Sep 27 '16 at 15:19get-buffer-window
to help obtain the value for the first argument inselect-window
. Alternatively, you could modifyspeedbar.el
andsr-speedbar.el
. – lawlist Sep 27 '16 at 15:21