When I call org-edit-src-code to edit a SRC code on a buffer with the proper major mode, I get a new window configuration.

For example, if I have windows 1|2, org-edit-src-code will delete window 2 and split window 1 horizontally.

How can I have org-edit-src-code reuse the window from the org file and leave all other windows alone? In other words, I'd like org-edit-src-code to work as a narrowing command.

1 Answer 1


You can use the variable org-src-window-setup.

It seems that adding the following code to your config file would do what you want:

(setq org-src-window-setup 'current-window)

There are other options available, which you can list with M-x describe-variable org-src-window-setup


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.