1

C-x 2 On Split-window-below,

1) i like the cursor/point to be in the other window (newly opened) and not in present window.

2) instead of loading in the current-buffer in the other window, i prefer it to be the previously visited file (or) my first entry in (switch-buffer) (or) C-x b list

3) Does elisp support hooks for methods (split-window-below hook)?

3

I have the similar need, but for C-x 3 (split-window-right):

(defun chunyang-split-window-right ()
  (interactive)
  (select-window (split-window-right))
  (switch-to-buffer (other-buffer)))
| improve this answer | |
  • 1
    Seems like you beat me to it :) Can I suggest a small change? Replace ``` (split-window-right) (other-window 1) ``` with ``` (select-window (split-window-right)) ``` – bmag Mar 15 '15 at 8:01
  • @bmag Thanks for suggestion. I didn't notice the return value of (split-window-right) and the (select-window) function. – xuchunyang Mar 15 '15 at 8:15

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.