From: Wei Tang <hi@that.world>
To: emacs-orgmode@gnu.org
Subject: [PATCH] org-babel-execute-buffer "No surrounding element" error
Date: Thu, 31 Aug 2017 03:02:44 +0800 [thread overview]
Message-ID: <e2f39124-07d5-aceb-b944-f64f997e81b8@that.world> (raw)
[-- Attachment #1.1.1: Type: text/plain, Size: 363 bytes --]
I was trying to use org-babel-execute-buffer to update all org-babel
code block results for a org document. It works fine when the code block
is visible, but when it's hidden, I got the "user-error: No surrounding
element" error and nothing was executed.
Adding `(outline-show-all)` fixed this issue for me. Does this look like
a good solution?
-- Wei
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0001-ob-core.el-Fix-No-surrounding-element-error.patch --]
[-- Type: text/x-patch; name="0001-ob-core.el-Fix-No-surrounding-element-error.patch", Size: 929 bytes --]
From 3b535fa389518b7d7c280952990bc56ddbe01206 Mon Sep 17 00:00:00 2001
From: Wei Tang <hi@that.world>
Date: Thu, 31 Aug 2017 02:39:54 +0800
Subject: [PATCH] ob-core.el: Fix "No surrounding element" error
* ob-core.el (org-babel-execute-buffer): Show all outlines before
execution.
Without this, when outlines are hidden,
executing (org-babel-execute-buffer) gives "No surrounding element"
error.
TINYCHANGE
---
lisp/ob-core.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index d25908d41..a69d4a66b 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -1197,6 +1197,7 @@ the current buffer."
(interactive "P")
(org-babel-eval-wipe-error-buffer)
(org-save-outline-visibility t
+ (outline-show-all)
(org-babel-map-executables nil
(if (memq (org-element-type (org-element-context))
'(babel-call inline-babel-call))
--
2.14.1
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next reply other threads:[~2017-08-30 19:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-30 19:02 Wei Tang [this message]
2017-08-31 7:03 ` [PATCH] org-babel-execute-buffer "No surrounding element" error Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e2f39124-07d5-aceb-b944-f64f997e81b8@that.world \
--to=hi@that.world \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.