I've fixed an issue in my previous patch with the write-back buffer not getting killed. Quick recap of the issue for anyone who might be interested: When ~org-src-tab-acts-natively~ is t (which is now the default) functions such as ~indent-region~ and ~comment-region~ acting on a src block will call  ~org-edit-src~ and indent/comment from there. The ~org-edit-src~ machinery replaces the original buffer with the src-edit buffer contents, and in doing so screws up the ~save-excursion~ calls from ~indent-region~ and ~comment-region~. Because of this, calling ~indent-region~ or ~comment-region~ inside a src-block  sends the cursor to the beginning of the block. The attached patch uses the ~replace-buffer-contents~ function when available in emacs >= 26.1 to fix this issue. There's also a remaining issue with the ~undo-boundary~ call in ~org-edit-src-exit~. Calling ~undo~ after ~indent-region~ or ~comment-region~ will send the cursor to the beginning of the src block > Hi, > > The attached patch fixes this issue for emacs >= 26.1. > > It also fixes a similar issue where comment-line moves the cursor to > the beginning of the block aswell. > > Can this patch be applied ? Sébastien