reddit / emacs

Open things automatically on start-up

kaerfkeerg · 2022-12-13 10:04
What I need to achieve is the following series of commands I do on every start-up ``` spit-window-below other-window (Change to the new window) ansi-term /bin/bash other-window (Change back to main-buffer) ``` I almost got the first 2 but there is something I'm clearly misunderstanding. I got this script ``` (add-hook 'emacs-startup-hook (lambda () (kill-buffer "*scratch*") (split-window-below) (other-window) (ansi-term "/bin/bash") (other-window) )) ``` Which splits the window in half and nothing more. I'm guessing there is something I'm missing about the `other-window` because if I comment these 2 out, my final output is emacs opening with `ansi-term` at the top and main window at the `bottom`. TLDR: How do I configure emacs to have the main-window at the top and `ansi-term "/bin/bash"` at the bottom on start-up Edit: I'm getting this error in debug: `Wrong number of arguments: (1 . 2), 0` Fixed. Apparently `other-window` requires an argument. ``` (add-hook 'emacs-startup-hook (lambda () (kill-buffer "*scratch*") (split-window-below) (other-window 1) ; Go to the new window (ansi-term "/bin/bash") (other-window 0) ; Back to main window )) ```
akirakom · 2022-12-13 12:27
`other-window` requires an argument.
kaerfkeerg · 2022-12-13 13:32
Aight. Mini buffer didn't ask for an argument and I thought it just goes sequencially. I was able to fix it. Thanks I updated my post with the solution!