emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 9987451252: org-babel-execute-src-block: Do not err


From: ELPA Syncer
Subject: [elpa] externals/org 9987451252: org-babel-execute-src-block: Do not err on virtual src blocks
Date: Mon, 31 Oct 2022 22:57:54 -0400 (EDT)

branch: externals/org
commit 9987451252fa64af65d0a0a014f41812f4402c02
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    org-babel-execute-src-block: Do not err on virtual src blocks
    
    * lisp/ob-core.el (org-babel-execute-src-block): Handle no block at
    point.  Do not err when block info does not have position data.
    
    Reported-by: Alan Schmitt <alan.schmitt@polytechnique.org>
    Link: https://orgmode.org/list/87r0yol8kp.fsf@m4x.org
---
 lisp/ob-core.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index e7e5f82d1f..a1c11e6ca1 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -744,7 +744,11 @@ guess will be made."
           (or executor-type
               ;; If `executor-type' is unset, then we will make an
               ;; informed guess.
-              (pcase (char-after org-babel-current-src-block-location)
+              (pcase (and
+                      ;; When executing virtual src block, no location
+                      ;; is known.
+                      org-babel-current-src-block-location
+                      (char-after org-babel-current-src-block-location))
                 (?s 'inline-src-block)
                 (?c 'inline-babel-call)
                 (?# (pcase (char-after (+ 2 
org-babel-current-src-block-location))
@@ -803,7 +807,7 @@ guess will be made."
                     (let ((name (nth 4 info)))
                       (if name
                            (format "(%s)" name)
-                         (format "at position %d" (nth 5 info)))))
+                         (format "at position %S" (nth 5 info)))))
            (setq exec-start-time (current-time)
                   result
                  (let ((r (save-current-buffer (funcall cmd body params))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]