hiecaq <t...@hiecaq.org> writes: > 1. `emacs -Q temp.org`, with the following content: > --8<---------------cut here---------------start------------->8--- > #+begin_src emacs-lisp > #+end_src > --8<---------------cut here---------------end--------------->8--- > > 2. Put cursor on the block and `M-:`, in eval type > `(org-edit-src-code "'()")` and RET, the edit buffer shows up with > the content `'()`, but... > > Actual behavior: > 1. The edit buffer is read only > 2. `M-x org-edit-src-exit` close the edit buffer as intended, but > it does not insert `'()` back into the org mode buffer. > > Expect behavior: > 1. The edit buffer should not be read only > 2. Even if the edit buffer is not edited afterwards, `M-x > org-edit-src-exit` should insert its content back to the org mode > buffer.
What you observe is intentional. The commit that introduced this feature says the following: https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=d1b8b347f Allow org-src edit buffer to be used in read-only mode org-edit-src-code gains extra optional arguments `code' and `edit-buffer-name'. If `code' is supplied, then this code forms the contents of the edit buffer, which is made read-only. In this case, the mechanisms for writing back to the org buffer on save are disabled. Optional argument `edit-buffer-name' allows a name for the edit buffer to be supplied. The docstring is not accurate. To fix this, we can either: 1. Fix the docstring and call it done 2. Allow the buffer to be editable. Although, I do not fully understand why the read-only has been introduced to start with. (And I cannot find anything in the mailing list archives) -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>