org-babel-do-in-edit-buffer: When editing fails, do not throw an error
* lisp/ob-core.el (org-babel-do-in-edit-buffer): Avoid throwing an error when something is not right with the code block. We already ignore errors when major mode fails to load and we generally don't want this macro to fail as it is used during indentation. Link: https://list.orgmode.org/orgmode/87wmqo3it5.fsf@localhost/
This commit is contained in:
parent
ac49228040
commit
a3ebd8c669
|
@ -1192,11 +1192,14 @@ Return t if a code block was found at point, nil otherwise."
|
|||
;; we want to restore this location after executing BODY.
|
||||
(outside-position
|
||||
(and (<= (line-beginning-position)
|
||||
(org-element-post-affiliated element))
|
||||
(org-element-post-affiliated element))
|
||||
(point-marker)))
|
||||
(org-src-window-setup 'switch-invisibly))
|
||||
(when (and (org-babel-where-is-src-block-head element)
|
||||
(org-edit-src-code))
|
||||
(condition-case nil
|
||||
(org-edit-src-code)
|
||||
(t (when outside-position (goto-char outside-position))
|
||||
nil)))
|
||||
(unwind-protect (progn ,@body)
|
||||
(org-edit-src-exit)
|
||||
(when outside-position (goto-char outside-position)))
|
||||
|
|
Loading…
Reference in New Issue