diff options
author | Dan Davison <davison@stats.ox.ac.uk> | 2010-09-04 13:36:48 -0400 |
---|---|---|
committer | Dan Davison <davison@stats.ox.ac.uk> | 2010-09-04 13:36:48 -0400 |
commit | 798a78fe06daf75bdbc2031a8f49edadd30612e1 (patch) | |
tree | cf701fd40578990ed59c0d1655497cde4209292e | |
parent | c881fa076060e647fc9f24ce68bd1aea5853016d (diff) | |
download | org-mode-798a78fe06daf75bdbc2031a8f49edadd30612e1.tar.gz |
Protect against errors when operating in temporary code edit buffer
* ob.el (org-babel-do-in-edit-buffer): Use unwind-protect to
ensure that edit buffer is exited
-rw-r--r-- | lisp/ob.el | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -511,9 +511,9 @@ with a prefix argument then this is passed on to Return t if a code block was found at point, nil otherwise." `(let ((org-src-window-setup 'switch-invisibly)) (when (org-edit-src-code nil nil nil 'quietly) - ,@body - (if (org-bound-and-true-p org-edit-src-from-org-mode) - (org-edit-src-exit)) + (unwind-protect (progn ,@body) + (if (org-bound-and-true-p org-edit-src-from-org-mode) + (org-edit-src-exit))) t))) (defun org-babel-do-key-sequence-in-edit-buffer (key) |