When `org-edit-src-code' fails to load the language mode, it leaves the
buffer(s) in an unusable state. For example, evaluate
M-: (add-hook 'emacs-lisp-mode-hook 'paredit-mode)
Then C-c ' in this block
#+begin_src emacs-lisp
(save-excursion
#+end_src
-> byte-code: Language mode `emacs-lisp-mode' fails with: "Unmatched
bracket or quote"
That's fine. But now C-c ' doesn't work and M-x org-edit-src-exit claims:
org-edit-src-exit: This is not a sub-editing buffer, something is wrong
Indeed.
I guess, the source buffer and the overlay should be cleaned up. But
since the worst that can happen is the language mode not loading
correctly, maybe just downgrade the error to a warning?
--
Florian Beck