hi thorsten, i think there are several misunderstanding here.
first, i am not talking about outorg at all. i am talking about babel source code blocks. i have changed the subject header to make that more obvious. outorg is not relevant to this thread, as far as i can tell. second, emacs behavior is not built in. it depends on require-final-newline. if babel would respect require-final-newline, i would be happy. however, it does not. so it is not an emacs issue in this respect. third, before posting the original post, i fully tested both the variable that you suggested and require-final-newline. the value of the former determines which bug occurs. i hope that's enough to get us all on the same page. i have very severe rsi so i limit typing to less than 4 minutes at a time. i won't be able to reply for some time.