help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Open frame with two windows and specific buffers/modes on each side.


From: Allan Felipe
Subject: Open frame with two windows and specific buffers/modes on each side.
Date: Sat, 10 Dec 2016 01:49:02 +0000 (UTC)

 When I open a file foo.py, I want the buffer foo.py to be displayed on the 
right side and a shell on the left side. Since I'm not being able to deal with 
the order that things are happening when emacs starts, the buffers are not 
being displayed where I want them to be and the major modes are getting 
scrambled.That's the relevant part of the code, which shows clearly what I want 
to be done (with python.el):
(defun my-eval-after-load-python()
    (split-window-horizontally (floor (* 0.49 (window-width))))
    (other-window 1)
    (run-python (python-shell-parse-command))
    (python-shell-switch-to-shell)
    (other-window 1)
)(eval-after-load "python" '(my-eval-after-load-python))
The introduction of a (other-window 1) messes up the position of buffers and 
modes just as the (python-shell-switch-to-shell). I tried to use 
(switch-to-buffer (inferior-python-mode)) and (save-current-buffer), but I am 
still unable to understand what is happening. I´m not an advanced user, it must 
be a simple solution.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]