astahlman / ob-async

Asynchronous src_block execution for org-babel
343 stars 32 forks source link

Named source block with ob-async caused error #46

Closed stardiviner closed 5 years ago

stardiviner commented 5 years ago

Checklist

Expected Behavior

Here is my source block with named.

#+NAME: clone source code
#+begin_src sh :mkdirp yes :results file link :dir "data/code" :file "code-maat/README.md" :async
if [ -d code-maat ]; then
  cd code-maat ; git pull
else
  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat
fi
#+end_src

Actual Behavior

When I toggle debug-on-error, I got stacktrace:

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  goto-char(nil)
  (if existing-result (goto-char existing-result) (goto-char (org-element-property :end inline)) (skip-chars-backward " \011"))
  (progn (if outside-scope (progn (widen))) (if existing-result (goto-char existing-result) (goto-char (org-element-property :end inline)) (skip-chars-backward " \011")) (if inline nil (setq indent (current-indentation)) (forward-line 1)) (setq beg (point)) (cond (inline (if existing-result nil (insert " ") (setq beg (point)))) ((member "replace" result-params) (delete-region (point) (org-babel-result-end))) ((member "append" result-params) (goto-char (org-babel-result-end)) (setq beg (point-marker))) ((member "prepend" result-params))) (setq results-switches (if results-switches (concat " " results-switches) "")) (let ((wrap (function (lambda (start finish &optional no-escape no-newlines inline-start inline-finish) (if inline (progn (setq start inline-start) (setq finish inline-finish) (setq no-newlines t))) (let ((before-finish (marker-position end))) (goto-char end) (insert (concat finish (if no-newlines nil "\n"))) (goto-char beg) (insert (concat start (if no-newlines nil "\n"))) (if no-escape nil (org-escape-code-in-region (min (point) before-finish) before-finish)) (goto-char end))))) (tabulablep (function (lambda (r) (and (proper-list-p r) (cl-every (function (lambda (e) (or (atom e) (proper-list-p e)))) result)))))) (cond ((null result)) ((member "list" result-params) (insert (org-trim (org-list-to-generic (cons 'unordered (mapcar (function (lambda (e) (list (if (stringp e) e (format "%S" e))))) (if (listp result) result (split-string result "\n" t)))) '(:splicep nil :istart "- " :iend "\n"))) "\n")) ((funcall tabulablep result) (goto-char beg) (insert (concat (orgtbl-to-orgtbl (if (cl-every (function (lambda (e) (or (eq e 'hline) (listp e)))) result) result (list result)) nil) "\n")) (goto-char beg) (if (org-at-table-p) (progn (org-table-align))) (goto-char (org-table-end))) ((listp result) (insert (format "%s\n" result))) ((member "file" result-params) (if inline (progn (setq result (org-macro-escape-arguments result)))) (insert result)) ((and inline (not (member "raw" result-params))) (insert (org-macro-escape-arguments (org-babel-chomp result "\n")))) (t (goto-char beg) (insert result))) (setq end (copy-marker (point) t)) (cond ((assq :wrap (nth 2 info)) (let ((name (or (cdr (assq :wrap (nth 2 info))) "results"))) (funcall wrap (concat "#+begin_" name) (concat "#+end_" (car (split-string name))) nil nil (concat "{{{results(@@" name ":") "@@)}}}"))) ((member "html" result-params) (funcall wrap "#+begin_export html" "#+end_export" nil nil "{{{results(@@html:" "@@)}}}")) ((member "latex" result-params) (funcall wrap "#+begin_export latex" "#+end_export" nil nil "{{{results(@@latex:" "@@)}}}")) ((member "org" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap "#+begin_src org" "#+end_src" nil nil "{{{results(src_org{" "})}}}")) ((member "code" result-params) (let ((lang (or lang "none"))) (funcall wrap (format "#+begin_src %s%s" lang results-switches) "#+end_src" nil nil (format "{{{results(src_%s[%s]{" lang results-switches) "})}}}"))) ((member "raw" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle)))) ((or (member "drawer" result-params) (member "wrap" result-params)) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap ":results:" ":end:" 'no-escape nil "{{{results(" ")}}}")) ((and inline (member "file" result-params)) (funcall wrap nil nil nil nil "{{{results(" ")}}}")) ((and (not (funcall tabulablep result)) (not (member "file" result-params))) (let ((org-babel-inline-result-wrap (format "{{{results(%s)}}}" org-babel-inline-result-wrap))) (org-babel-examplify-region beg end results-switches inline))))) (if (and (not inline) (numberp indent) (> indent 0) (not (and (listp result) (member "append" result-params)))) (progn (indent-rigidly beg end indent))) (if (null result) (if (member "value" result-params) (message "Code block returned no value.") (message "Code block produced no output.")) (message "Code block evaluation complete.")))
  (unwind-protect (progn (if outside-scope (progn (widen))) (if existing-result (goto-char existing-result) (goto-char (org-element-property :end inline)) (skip-chars-backward " \011")) (if inline nil (setq indent (current-indentation)) (forward-line 1)) (setq beg (point)) (cond (inline (if existing-result nil (insert " ") (setq beg (point)))) ((member "replace" result-params) (delete-region (point) (org-babel-result-end))) ((member "append" result-params) (goto-char (org-babel-result-end)) (setq beg (point-marker))) ((member "prepend" result-params))) (setq results-switches (if results-switches (concat " " results-switches) "")) (let ((wrap (function (lambda (start finish &optional no-escape no-newlines inline-start inline-finish) (if inline (progn (setq start inline-start) (setq finish inline-finish) (setq no-newlines t))) (let ((before-finish (marker-position end))) (goto-char end) (insert (concat finish (if no-newlines nil "\n"))) (goto-char beg) (insert (concat start (if no-newlines nil "\n"))) (if no-escape nil (org-escape-code-in-region (min (point) before-finish) before-finish)) (goto-char end))))) (tabulablep (function (lambda (r) (and (proper-list-p r) (cl-every (function (lambda (e) (or (atom e) (proper-list-p e)))) result)))))) (cond ((null result)) ((member "list" result-params) (insert (org-trim (org-list-to-generic (cons 'unordered (mapcar (function (lambda (e) (list (if (stringp e) e (format "%S" e))))) (if (listp result) result (split-string result "\n" t)))) '(:splicep nil :istart "- " :iend "\n"))) "\n")) ((funcall tabulablep result) (goto-char beg) (insert (concat (orgtbl-to-orgtbl (if (cl-every (function (lambda (e) (or (eq e 'hline) (listp e)))) result) result (list result)) nil) "\n")) (goto-char beg) (if (org-at-table-p) (progn (org-table-align))) (goto-char (org-table-end))) ((listp result) (insert (format "%s\n" result))) ((member "file" result-params) (if inline (progn (setq result (org-macro-escape-arguments result)))) (insert result)) ((and inline (not (member "raw" result-params))) (insert (org-macro-escape-arguments (org-babel-chomp result "\n")))) (t (goto-char beg) (insert result))) (setq end (copy-marker (point) t)) (cond ((assq :wrap (nth 2 info)) (let ((name (or (cdr (assq :wrap (nth 2 info))) "results"))) (funcall wrap (concat "#+begin_" name) (concat "#+end_" (car (split-string name))) nil nil (concat "{{{results(@@" name ":") "@@)}}}"))) ((member "html" result-params) (funcall wrap "#+begin_export html" "#+end_export" nil nil "{{{results(@@html:" "@@)}}}")) ((member "latex" result-params) (funcall wrap "#+begin_export latex" "#+end_export" nil nil "{{{results(@@latex:" "@@)}}}")) ((member "org" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap "#+begin_src org" "#+end_src" nil nil "{{{results(src_org{" "})}}}")) ((member "code" result-params) (let ((lang (or lang "none"))) (funcall wrap (format "#+begin_src %s%s" lang results-switches) "#+end_src" nil nil (format "{{{results(src_%s[%s]{" lang results-switches) "})}}}"))) ((member "raw" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle)))) ((or (member "drawer" result-params) (member "wrap" result-params)) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap ":results:" ":end:" 'no-escape nil "{{{results(" ")}}}")) ((and inline (member "file" result-params)) (funcall wrap nil nil nil nil "{{{results(" ")}}}")) ((and (not (funcall tabulablep result)) (not (member "file" result-params))) (let ((org-babel-inline-result-wrap (format "{{{results(%s)}}}" org-babel-inline-result-wrap))) (org-babel-examplify-region beg end results-switches inline))))) (if (and (not inline) (numberp indent) (> indent 0) (not (and (listp result) (member "append" result-params)))) (progn (indent-rigidly beg end indent))) (if (null result) (if (member "value" result-params) (message "Code block returned no value.") (message "Code block produced no output.")) (message "Code block evaluation complete."))) (set-marker end nil) (if outside-scope (progn (narrow-to-region visible-beg visible-end))) (set-marker visible-beg nil) (set-marker visible-end nil))
  (let* ((visible-beg (point-min-marker)) (visible-end (copy-marker (point-max) t)) (inline (let ((context (org-element-context))) (and (memq (org-element-type context) '(inline-babel-call inline-src-block)) context))) (existing-result (org-babel-where-is-src-block-result t nil hash)) (results-switches (cdr (assq :results_switches (nth 2 info)))) (outside-scope (and existing-result (buffer-narrowed-p) (or (> visible-beg existing-result) (<= visible-end existing-result)))) beg end indent) (if (and (org-string-nw-p result) (not inline) (not (string-equal (substring result -1) "\n"))) (progn (setq result (concat result "\n")))) (unwind-protect (progn (if outside-scope (progn (widen))) (if existing-result (goto-char existing-result) (goto-char (org-element-property :end inline)) (skip-chars-backward " \011")) (if inline nil (setq indent (current-indentation)) (forward-line 1)) (setq beg (point)) (cond (inline (if existing-result nil (insert " ") (setq beg (point)))) ((member "replace" result-params) (delete-region (point) (org-babel-result-end))) ((member "append" result-params) (goto-char (org-babel-result-end)) (setq beg (point-marker))) ((member "prepend" result-params))) (setq results-switches (if results-switches (concat " " results-switches) "")) (let ((wrap (function (lambda (start finish &optional no-escape no-newlines inline-start inline-finish) (if inline (progn (setq start inline-start) (setq finish inline-finish) (setq no-newlines t))) (let ((before-finish (marker-position end))) (goto-char end) (insert (concat finish (if no-newlines nil "\n"))) (goto-char beg) (insert (concat start (if no-newlines nil "\n"))) (if no-escape nil (org-escape-code-in-region (min (point) before-finish) before-finish)) (goto-char end))))) (tabulablep (function (lambda (r) (and (proper-list-p r) (cl-every (function (lambda (e) (or (atom e) (proper-list-p e)))) result)))))) (cond ((null result)) ((member "list" result-params) (insert (org-trim (org-list-to-generic (cons 'unordered (mapcar (function (lambda (e) (list (if (stringp e) e (format "%S" e))))) (if (listp result) result (split-string result "\n" t)))) '(:splicep nil :istart "- " :iend "\n"))) "\n")) ((funcall tabulablep result) (goto-char beg) (insert (concat (orgtbl-to-orgtbl (if (cl-every (function (lambda (e) (or (eq e 'hline) (listp e)))) result) result (list result)) nil) "\n")) (goto-char beg) (if (org-at-table-p) (progn (org-table-align))) (goto-char (org-table-end))) ((listp result) (insert (format "%s\n" result))) ((member "file" result-params) (if inline (progn (setq result (org-macro-escape-arguments result)))) (insert result)) ((and inline (not (member "raw" result-params))) (insert (org-macro-escape-arguments (org-babel-chomp result "\n")))) (t (goto-char beg) (insert result))) (setq end (copy-marker (point) t)) (cond ((assq :wrap (nth 2 info)) (let ((name (or (cdr (assq :wrap (nth 2 info))) "results"))) (funcall wrap (concat "#+begin_" name) (concat "#+end_" (car (split-string name))) nil nil (concat "{{{results(@@" name ":") "@@)}}}"))) ((member "html" result-params) (funcall wrap "#+begin_export html" "#+end_export" nil nil "{{{results(@@html:" "@@)}}}")) ((member "latex" result-params) (funcall wrap "#+begin_export latex" "#+end_export" nil nil "{{{results(@@latex:" "@@)}}}")) ((member "org" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap "#+begin_src org" "#+end_src" nil nil "{{{results(src_org{" "})}}}")) ((member "code" result-params) (let ((lang (or lang "none"))) (funcall wrap (format "#+begin_src %s%s" lang results-switches) "#+end_src" nil nil (format "{{{results(src_%s[%s]{" lang results-switches) "})}}}"))) ((member "raw" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle)))) ((or (member "drawer" result-params) (member "wrap" result-params)) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap ":results:" ":end:" 'no-escape nil "{{{results(" ")}}}")) ((and inline (member "file" result-params)) (funcall wrap nil nil nil nil "{{{results(" ")}}}")) ((and (not (funcall tabulablep result)) (not (member "file" result-params))) (let ((org-babel-inline-result-wrap (format "{{{results(%s)}}}" org-babel-inline-result-wrap))) (org-babel-examplify-region beg end results-switches inline))))) (if (and (not inline) (numberp indent) (> indent 0) (not (and (listp result) (member "append" result-params)))) (progn (indent-rigidly beg end indent))) (if (null result) (if (member "value" result-params) (message "Code block returned no value.") (message "Code block produced no output.")) (message "Code block evaluation complete."))) (set-marker end nil) (if outside-scope (progn (narrow-to-region visible-beg visible-end))) (set-marker visible-beg nil) (set-marker visible-end nil)))
  (save-excursion (let* ((visible-beg (point-min-marker)) (visible-end (copy-marker (point-max) t)) (inline (let ((context (org-element-context))) (and (memq (org-element-type context) '(inline-babel-call inline-src-block)) context))) (existing-result (org-babel-where-is-src-block-result t nil hash)) (results-switches (cdr (assq :results_switches (nth 2 info)))) (outside-scope (and existing-result (buffer-narrowed-p) (or (> visible-beg existing-result) (<= visible-end existing-result)))) beg end indent) (if (and (org-string-nw-p result) (not inline) (not (string-equal (substring result -1) "\n"))) (progn (setq result (concat result "\n")))) (unwind-protect (progn (if outside-scope (progn (widen))) (if existing-result (goto-char existing-result) (goto-char (org-element-property :end inline)) (skip-chars-backward " \011")) (if inline nil (setq indent (current-indentation)) (forward-line 1)) (setq beg (point)) (cond (inline (if existing-result nil (insert " ") (setq beg (point)))) ((member "replace" result-params) (delete-region (point) (org-babel-result-end))) ((member "append" result-params) (goto-char (org-babel-result-end)) (setq beg (point-marker))) ((member "prepend" result-params))) (setq results-switches (if results-switches (concat " " results-switches) "")) (let ((wrap (function (lambda (start finish &optional no-escape no-newlines inline-start inline-finish) (if inline (progn (setq start inline-start) (setq finish inline-finish) (setq no-newlines t))) (let ((before-finish (marker-position end))) (goto-char end) (insert (concat finish (if no-newlines nil "\n"))) (goto-char beg) (insert (concat start (if no-newlines nil "\n"))) (if no-escape nil (org-escape-code-in-region (min (point) before-finish) before-finish)) (goto-char end))))) (tabulablep (function (lambda (r) (and (proper-list-p r) (cl-every (function (lambda (e) (or (atom e) (proper-list-p e)))) result)))))) (cond ((null result)) ((member "list" result-params) (insert (org-trim (org-list-to-generic (cons 'unordered (mapcar (function (lambda (e) (list (if (stringp e) e (format "%S" e))))) (if (listp result) result (split-string result "\n" t)))) '(:splicep nil :istart "- " :iend "\n"))) "\n")) ((funcall tabulablep result) (goto-char beg) (insert (concat (orgtbl-to-orgtbl (if (cl-every (function (lambda (e) (or (eq e 'hline) (listp e)))) result) result (list result)) nil) "\n")) (goto-char beg) (if (org-at-table-p) (progn (org-table-align))) (goto-char (org-table-end))) ((listp result) (insert (format "%s\n" result))) ((member "file" result-params) (if inline (progn (setq result (org-macro-escape-arguments result)))) (insert result)) ((and inline (not (member "raw" result-params))) (insert (org-macro-escape-arguments (org-babel-chomp result "\n")))) (t (goto-char beg) (insert result))) (setq end (copy-marker (point) t)) (cond ((assq :wrap (nth 2 info)) (let ((name (or (cdr (assq :wrap (nth 2 info))) "results"))) (funcall wrap (concat "#+begin_" name) (concat "#+end_" (car (split-string name))) nil nil (concat "{{{results(@@" name ":") "@@)}}}"))) ((member "html" result-params) (funcall wrap "#+begin_export html" "#+end_export" nil nil "{{{results(@@html:" "@@)}}}")) ((member "latex" result-params) (funcall wrap "#+begin_export latex" "#+end_export" nil nil "{{{results(@@latex:" "@@)}}}")) ((member "org" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap "#+begin_src org" "#+end_src" nil nil "{{{results(src_org{" "})}}}")) ((member "code" result-params) (let ((lang (or lang "none"))) (funcall wrap (format "#+begin_src %s%s" lang results-switches) "#+end_src" nil nil (format "{{{results(src_%s[%s]{" lang results-switches) "})}}}"))) ((member "raw" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle)))) ((or (member "drawer" result-params) (member "wrap" result-params)) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap ":results:" ":end:" 'no-escape nil "{{{results(" ")}}}")) ((and inline (member "file" result-params)) (funcall wrap nil nil nil nil "{{{results(" ")}}}")) ((and (not (funcall tabulablep result)) (not (member "file" result-params))) (let ((org-babel-inline-result-wrap (format "{{{results(%s)}}}" org-babel-inline-result-wrap))) (org-babel-examplify-region beg end results-switches inline))))) (if (and (not inline) (numberp indent) (> indent 0) (not (and (listp result) (member "append" result-params)))) (progn (indent-rigidly beg end indent))) (if (null result) (if (member "value" result-params) (message "Code block returned no value.") (message "Code block produced no output.")) (message "Code block evaluation complete."))) (set-marker end nil) (if outside-scope (progn (narrow-to-region visible-beg visible-end))) (set-marker visible-beg nil) (set-marker visible-end nil))))
  (let ((inline (let ((context (org-element-context))) (and (memq (org-element-type context) '(inline-babel-call inline-src-block)) context)))) (if inline (progn (let ((warning (or (and (member "table" result-params) "`:results table'") (and (listp result) "list result") (and (string-match-p "\n." result) "multiline result") (and (member "list" result-params) "`:results list'")))) (if warning (progn (user-error "Inline error: %s cannot be used" warning)))))) (save-excursion (let* ((visible-beg (point-min-marker)) (visible-end (copy-marker (point-max) t)) (inline (let ((context (org-element-context))) (and (memq (org-element-type context) '(inline-babel-call inline-src-block)) context))) (existing-result (org-babel-where-is-src-block-result t nil hash)) (results-switches (cdr (assq :results_switches (nth 2 info)))) (outside-scope (and existing-result (buffer-narrowed-p) (or (> visible-beg existing-result) (<= visible-end existing-result)))) beg end indent) (if (and (org-string-nw-p result) (not inline) (not (string-equal (substring result -1) "\n"))) (progn (setq result (concat result "\n")))) (unwind-protect (progn (if outside-scope (progn (widen))) (if existing-result (goto-char existing-result) (goto-char (org-element-property :end inline)) (skip-chars-backward " \011")) (if inline nil (setq indent (current-indentation)) (forward-line 1)) (setq beg (point)) (cond (inline (if existing-result nil (insert " ") (setq beg (point)))) ((member "replace" result-params) (delete-region (point) (org-babel-result-end))) ((member "append" result-params) (goto-char (org-babel-result-end)) (setq beg (point-marker))) ((member "prepend" result-params))) (setq results-switches (if results-switches (concat " " results-switches) "")) (let ((wrap (function (lambda (start finish &optional no-escape no-newlines inline-start inline-finish) (if inline (progn (setq start inline-start) (setq finish inline-finish) (setq no-newlines t))) (let ((before-finish (marker-position end))) (goto-char end) (insert (concat finish (if no-newlines nil "\n"))) (goto-char beg) (insert (concat start (if no-newlines nil "\n"))) (if no-escape nil (org-escape-code-in-region (min (point) before-finish) before-finish)) (goto-char end))))) (tabulablep (function (lambda (r) (and (proper-list-p r) (cl-every (function (lambda (e) (or (atom e) (proper-list-p e)))) result)))))) (cond ((null result)) ((member "list" result-params) (insert (org-trim (org-list-to-generic (cons 'unordered (mapcar (function (lambda (e) (list (if (stringp e) e (format "%S" e))))) (if (listp result) result (split-string result "\n" t)))) '(:splicep nil :istart "- " :iend "\n"))) "\n")) ((funcall tabulablep result) (goto-char beg) (insert (concat (orgtbl-to-orgtbl (if (cl-every (function (lambda (e) (or (eq e 'hline) (listp e)))) result) result (list result)) nil) "\n")) (goto-char beg) (if (org-at-table-p) (progn (org-table-align))) (goto-char (org-table-end))) ((listp result) (insert (format "%s\n" result))) ((member "file" result-params) (if inline (progn (setq result (org-macro-escape-arguments result)))) (insert result)) ((and inline (not (member "raw" result-params))) (insert (org-macro-escape-arguments (org-babel-chomp result "\n")))) (t (goto-char beg) (insert result))) (setq end (copy-marker (point) t)) (cond ((assq :wrap (nth 2 info)) (let ((name (or (cdr (assq :wrap (nth 2 info))) "results"))) (funcall wrap (concat "#+begin_" name) (concat "#+end_" (car (split-string name))) nil nil (concat "{{{results(@@" name ":") "@@)}}}"))) ((member "html" result-params) (funcall wrap "#+begin_export html" "#+end_export" nil nil "{{{results(@@html:" "@@)}}}")) ((member "latex" result-params) (funcall wrap "#+begin_export latex" "#+end_export" nil nil "{{{results(@@latex:" "@@)}}}")) ((member "org" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap "#+begin_src org" "#+end_src" nil nil "{{{results(src_org{" "})}}}")) ((member "code" result-params) (let ((lang (or lang "none"))) (funcall wrap (format "#+begin_src %s%s" lang results-switches) "#+end_src" nil nil (format "{{{results(src_%s[%s]{" lang results-switches) "})}}}"))) ((member "raw" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle)))) ((or (member "drawer" result-params) (member "wrap" result-params)) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap ":results:" ":end:" 'no-escape nil "{{{results(" ")}}}")) ((and inline (member "file" result-params)) (funcall wrap nil nil nil nil "{{{results(" ")}}}")) ((and (not (funcall tabulablep result)) (not (member "file" result-params))) (let ((org-babel-inline-result-wrap (format "{{{results(%s)}}}" org-babel-inline-result-wrap))) (org-babel-examplify-region beg end results-switches inline))))) (if (and (not inline) (numberp indent) (> indent 0) (not (and (listp result) (member "append" result-params)))) (progn (indent-rigidly beg end indent))) (if (null result) (if (member "value" result-params) (message "Code block returned no value.") (message "Code block produced no output.")) (message "Code block evaluation complete."))) (set-marker end nil) (if outside-scope (progn (narrow-to-region visible-beg visible-end))) (set-marker visible-beg nil) (set-marker visible-end nil)))))
  (if (and result-params (member "silent" result-params)) (progn (message (replace-regexp-in-string "%" "%%" (format "%S" result))) result) (let ((inline (let ((context (org-element-context))) (and (memq (org-element-type context) '(inline-babel-call inline-src-block)) context)))) (if inline (progn (let ((warning (or (and (member "table" result-params) "`:results table'") (and (listp result) "list result") (and (string-match-p "\n." result) "multiline result") (and (member "list" result-params) "`:results list'")))) (if warning (progn (user-error "Inline error: %s cannot be used" warning)))))) (save-excursion (let* ((visible-beg (point-min-marker)) (visible-end (copy-marker (point-max) t)) (inline (let ((context (org-element-context))) (and (memq (org-element-type context) '(inline-babel-call inline-src-block)) context))) (existing-result (org-babel-where-is-src-block-result t nil hash)) (results-switches (cdr (assq :results_switches (nth 2 info)))) (outside-scope (and existing-result (buffer-narrowed-p) (or (> visible-beg existing-result) (<= visible-end existing-result)))) beg end indent) (if (and (org-string-nw-p result) (not inline) (not (string-equal (substring result -1) "\n"))) (progn (setq result (concat result "\n")))) (unwind-protect (progn (if outside-scope (progn (widen))) (if existing-result (goto-char existing-result) (goto-char (org-element-property :end inline)) (skip-chars-backward " \011")) (if inline nil (setq indent (current-indentation)) (forward-line 1)) (setq beg (point)) (cond (inline (if existing-result nil (insert " ") (setq beg (point)))) ((member "replace" result-params) (delete-region (point) (org-babel-result-end))) ((member "append" result-params) (goto-char (org-babel-result-end)) (setq beg (point-marker))) ((member "prepend" result-params))) (setq results-switches (if results-switches (concat " " results-switches) "")) (let ((wrap (function (lambda (start finish &optional no-escape no-newlines inline-start inline-finish) (if inline (progn (setq start inline-start) (setq finish inline-finish) (setq no-newlines t))) (let ((before-finish (marker-position end))) (goto-char end) (insert (concat finish (if no-newlines nil "\n"))) (goto-char beg) (insert (concat start (if no-newlines nil "\n"))) (if no-escape nil (org-escape-code-in-region (min (point) before-finish) before-finish)) (goto-char end))))) (tabulablep (function (lambda (r) (and (proper-list-p r) (cl-every (function (lambda (e) (or (atom e) (proper-list-p e)))) result)))))) (cond ((null result)) ((member "list" result-params) (insert (org-trim (org-list-to-generic (cons 'unordered (mapcar (function (lambda (e) (list (if (stringp e) e (format "%S" e))))) (if (listp result) result (split-string result "\n" t)))) '(:splicep nil :istart "- " :iend "\n"))) "\n")) ((funcall tabulablep result) (goto-char beg) (insert (concat (orgtbl-to-orgtbl (if (cl-every (function (lambda (e) (or (eq e 'hline) (listp e)))) result) result (list result)) nil) "\n")) (goto-char beg) (if (org-at-table-p) (progn (org-table-align))) (goto-char (org-table-end))) ((listp result) (insert (format "%s\n" result))) ((member "file" result-params) (if inline (progn (setq result (org-macro-escape-arguments result)))) (insert result)) ((and inline (not (member "raw" result-params))) (insert (org-macro-escape-arguments (org-babel-chomp result "\n")))) (t (goto-char beg) (insert result))) (setq end (copy-marker (point) t)) (cond ((assq :wrap (nth 2 info)) (let ((name (or (cdr (assq :wrap (nth 2 info))) "results"))) (funcall wrap (concat "#+begin_" name) (concat "#+end_" (car (split-string name))) nil nil (concat "{{{results(@@" name ":") "@@)}}}"))) ((member "html" result-params) (funcall wrap "#+begin_export html" "#+end_export" nil nil "{{{results(@@html:" "@@)}}}")) ((member "latex" result-params) (funcall wrap "#+begin_export latex" "#+end_export" nil nil "{{{results(@@latex:" "@@)}}}")) ((member "org" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap "#+begin_src org" "#+end_src" nil nil "{{{results(src_org{" "})}}}")) ((member "code" result-params) (let ((lang (or lang "none"))) (funcall wrap (format "#+begin_src %s%s" lang results-switches) "#+end_src" nil nil (format "{{{results(src_%s[%s]{" lang results-switches) "})}}}"))) ((member "raw" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle)))) ((or (member "drawer" result-params) (member "wrap" result-params)) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap ":results:" ":end:" 'no-escape nil "{{{results(" ")}}}")) ((and inline (member "file" result-params)) (funcall wrap nil nil nil nil "{{{results(" ")}}}")) ((and (not (funcall tabulablep result)) (not (member "file" result-params))) (let ((org-babel-inline-result-wrap (format "{{{results(%s)}}}" org-babel-inline-result-wrap))) (org-babel-examplify-region beg end results-switches inline))))) (if (and (not inline) (numberp indent) (> indent 0) (not (and (listp result) (member "append" result-params)))) (progn (indent-rigidly beg end indent))) (if (null result) (if (member "value" result-params) (message "Code block returned no value.") (message "Code block produced no output.")) (message "Code block evaluation complete."))) (set-marker end nil) (if outside-scope (progn (narrow-to-region visible-beg visible-end))) (set-marker visible-beg nil) (set-marker visible-end nil))))))
  org-babel-insert-result("code-maat/README.md" ("output" "replace" "file" "link") ("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") nil "sh")
  (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook))
  (save-excursion (goto-char (point-min)) (re-search-forward "72afb2aa9264f9caf40d2beeb8818943") (org-backward-element) (let ((result-block (split-string (thing-at-point 'line t)))) (-if-let (block-name (nth 1 result-block)) (org-babel-goto-named-src-block block-name) (org-backward-element))) (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook)))
  (let ((default-directory "/home/stardiviner/Org/Wiki/Computer Technology/Softwares/data/code/")) (save-excursion (goto-char (point-min)) (re-search-forward "72afb2aa9264f9caf40d2beeb8818943") (org-backward-element) (let ((result-block (split-string (thing-at-point 'line t)))) (-if-let (block-name (nth 1 result-block)) (org-babel-goto-named-src-block block-name) (org-backward-element))) (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook))))
  (save-current-buffer (set-buffer #<buffer Code Maat.org>) (let ((default-directory "/home/stardiviner/Org/Wiki/Computer Technology/Softwares/data/code/")) (save-excursion (goto-char (point-min)) (re-search-forward "72afb2aa9264f9caf40d2beeb8818943") (org-backward-element) (let ((result-block (split-string (thing-at-point 'line t)))) (-if-let (block-name (nth 1 result-block)) (org-babel-goto-named-src-block block-name) (org-backward-element))) (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook)))))
  (with-current-buffer #<buffer Code Maat.org> (let ((default-directory "/home/stardiviner/Org/Wiki/Computer Technology/Softwares/data/code/")) (save-excursion (goto-char (point-min)) (re-search-forward "72afb2aa9264f9caf40d2beeb8818943") (org-backward-element) (let ((result-block (split-string (thing-at-point 'line t)))) (-if-let (block-name (nth 1 result-block)) (org-babel-goto-named-src-block block-name) (org-backward-element))) (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook)))))
  (lambda (result) (with-current-buffer #<buffer Code Maat.org> (let ((default-directory "/home/stardiviner/Org/Wiki/Computer Technology/Softwares/data/code/")) (save-excursion (goto-char (point-min)) (re-search-forward "72afb2aa9264f9caf40d2beeb8818943") (org-backward-element) (let ((result-block (split-string (thing-at-point 'line t)))) (-if-let (block-name (nth 1 result-block)) (org-babel-goto-named-src-block block-name) (org-backward-element))) (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook))))))("Already up to date.\n")
  async-handle-result((lambda (result) (with-current-buffer #<buffer Code Maat.org> (let ((default-directory "/home/stardiviner/Org/Wiki/Computer Technology/Softwares/data/code/")) (save-excursion (goto-char (point-min)) (re-search-forward "72afb2aa9264f9caf40d2beeb8818943") (org-backward-element) (let ((result-block (split-string (thing-at-point 'line t)))) (-if-let (block-name (nth 1 result-block)) (org-babel-goto-named-src-block block-name) (org-backward-element))) (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook)))))) "Already up to date.\n" #<buffer *emacs*>)
  async-when-done(#<process emacs> "finished\n")

And

Debugger entered--Lisp error: (wrong-type-argument markerp nil)
  set-marker(nil nil)
  (unwind-protect (progn (if outside-scope (progn (widen))) (if existing-result (goto-char existing-result) (goto-char (org-element-property :end inline)) (skip-chars-backward " \011")) (if inline nil (setq indent (current-indentation)) (forward-line 1)) (setq beg (point)) (cond (inline (if existing-result nil (insert " ") (setq beg (point)))) ((member "replace" result-params) (delete-region (point) (org-babel-result-end))) ((member "append" result-params) (goto-char (org-babel-result-end)) (setq beg (point-marker))) ((member "prepend" result-params))) (setq results-switches (if results-switches (concat " " results-switches) "")) (let ((wrap (function (lambda (start finish &optional no-escape no-newlines inline-start inline-finish) (if inline (progn (setq start inline-start) (setq finish inline-finish) (setq no-newlines t))) (let ((before-finish (marker-position end))) (goto-char end) (insert (concat finish (if no-newlines nil "\n"))) (goto-char beg) (insert (concat start (if no-newlines nil "\n"))) (if no-escape nil (org-escape-code-in-region (min (point) before-finish) before-finish)) (goto-char end))))) (tabulablep (function (lambda (r) (and (proper-list-p r) (cl-every (function (lambda (e) (or (atom e) (proper-list-p e)))) result)))))) (cond ((null result)) ((member "list" result-params) (insert (org-trim (org-list-to-generic (cons 'unordered (mapcar (function (lambda (e) (list (if (stringp e) e (format "%S" e))))) (if (listp result) result (split-string result "\n" t)))) '(:splicep nil :istart "- " :iend "\n"))) "\n")) ((funcall tabulablep result) (goto-char beg) (insert (concat (orgtbl-to-orgtbl (if (cl-every (function (lambda (e) (or (eq e 'hline) (listp e)))) result) result (list result)) nil) "\n")) (goto-char beg) (if (org-at-table-p) (progn (org-table-align))) (goto-char (org-table-end))) ((listp result) (insert (format "%s\n" result))) ((member "file" result-params) (if inline (progn (setq result (org-macro-escape-arguments result)))) (insert result)) ((and inline (not (member "raw" result-params))) (insert (org-macro-escape-arguments (org-babel-chomp result "\n")))) (t (goto-char beg) (insert result))) (setq end (copy-marker (point) t)) (cond ((assq :wrap (nth 2 info)) (let ((name (or (cdr (assq :wrap (nth 2 info))) "results"))) (funcall wrap (concat "#+begin_" name) (concat "#+end_" (car (split-string name))) nil nil (concat "{{{results(@@" name ":") "@@)}}}"))) ((member "html" result-params) (funcall wrap "#+begin_export html" "#+end_export" nil nil "{{{results(@@html:" "@@)}}}")) ((member "latex" result-params) (funcall wrap "#+begin_export latex" "#+end_export" nil nil "{{{results(@@latex:" "@@)}}}")) ((member "org" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap "#+begin_src org" "#+end_src" nil nil "{{{results(src_org{" "})}}}")) ((member "code" result-params) (let ((lang (or lang "none"))) (funcall wrap (format "#+begin_src %s%s" lang results-switches) "#+end_src" nil nil (format "{{{results(src_%s[%s]{" lang results-switches) "})}}}"))) ((member "raw" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle)))) ((or (member "drawer" result-params) (member "wrap" result-params)) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap ":results:" ":end:" 'no-escape nil "{{{results(" ")}}}")) ((and inline (member "file" result-params)) (funcall wrap nil nil nil nil "{{{results(" ")}}}")) ((and (not (funcall tabulablep result)) (not (member "file" result-params))) (let ((org-babel-inline-result-wrap (format "{{{results(%s)}}}" org-babel-inline-result-wrap))) (org-babel-examplify-region beg end results-switches inline))))) (if (and (not inline) (numberp indent) (> indent 0) (not (and (listp result) (member "append" result-params)))) (progn (indent-rigidly beg end indent))) (if (null result) (if (member "value" result-params) (message "Code block returned no value.") (message "Code block produced no output.")) (message "Code block evaluation complete."))) (set-marker end nil) (if outside-scope (progn (narrow-to-region visible-beg visible-end))) (set-marker visible-beg nil) (set-marker visible-end nil))
  (let* ((visible-beg (point-min-marker)) (visible-end (copy-marker (point-max) t)) (inline (let ((context (org-element-context))) (and (memq (org-element-type context) '(inline-babel-call inline-src-block)) context))) (existing-result (org-babel-where-is-src-block-result t nil hash)) (results-switches (cdr (assq :results_switches (nth 2 info)))) (outside-scope (and existing-result (buffer-narrowed-p) (or (> visible-beg existing-result) (<= visible-end existing-result)))) beg end indent) (if (and (org-string-nw-p result) (not inline) (not (string-equal (substring result -1) "\n"))) (progn (setq result (concat result "\n")))) (unwind-protect (progn (if outside-scope (progn (widen))) (if existing-result (goto-char existing-result) (goto-char (org-element-property :end inline)) (skip-chars-backward " \011")) (if inline nil (setq indent (current-indentation)) (forward-line 1)) (setq beg (point)) (cond (inline (if existing-result nil (insert " ") (setq beg (point)))) ((member "replace" result-params) (delete-region (point) (org-babel-result-end))) ((member "append" result-params) (goto-char (org-babel-result-end)) (setq beg (point-marker))) ((member "prepend" result-params))) (setq results-switches (if results-switches (concat " " results-switches) "")) (let ((wrap (function (lambda (start finish &optional no-escape no-newlines inline-start inline-finish) (if inline (progn (setq start inline-start) (setq finish inline-finish) (setq no-newlines t))) (let ((before-finish (marker-position end))) (goto-char end) (insert (concat finish (if no-newlines nil "\n"))) (goto-char beg) (insert (concat start (if no-newlines nil "\n"))) (if no-escape nil (org-escape-code-in-region (min (point) before-finish) before-finish)) (goto-char end))))) (tabulablep (function (lambda (r) (and (proper-list-p r) (cl-every (function (lambda (e) (or (atom e) (proper-list-p e)))) result)))))) (cond ((null result)) ((member "list" result-params) (insert (org-trim (org-list-to-generic (cons 'unordered (mapcar (function (lambda (e) (list (if (stringp e) e (format "%S" e))))) (if (listp result) result (split-string result "\n" t)))) '(:splicep nil :istart "- " :iend "\n"))) "\n")) ((funcall tabulablep result) (goto-char beg) (insert (concat (orgtbl-to-orgtbl (if (cl-every (function (lambda (e) (or (eq e 'hline) (listp e)))) result) result (list result)) nil) "\n")) (goto-char beg) (if (org-at-table-p) (progn (org-table-align))) (goto-char (org-table-end))) ((listp result) (insert (format "%s\n" result))) ((member "file" result-params) (if inline (progn (setq result (org-macro-escape-arguments result)))) (insert result)) ((and inline (not (member "raw" result-params))) (insert (org-macro-escape-arguments (org-babel-chomp result "\n")))) (t (goto-char beg) (insert result))) (setq end (copy-marker (point) t)) (cond ((assq :wrap (nth 2 info)) (let ((name (or (cdr (assq :wrap (nth 2 info))) "results"))) (funcall wrap (concat "#+begin_" name) (concat "#+end_" (car (split-string name))) nil nil (concat "{{{results(@@" name ":") "@@)}}}"))) ((member "html" result-params) (funcall wrap "#+begin_export html" "#+end_export" nil nil "{{{results(@@html:" "@@)}}}")) ((member "latex" result-params) (funcall wrap "#+begin_export latex" "#+end_export" nil nil "{{{results(@@latex:" "@@)}}}")) ((member "org" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap "#+begin_src org" "#+end_src" nil nil "{{{results(src_org{" "})}}}")) ((member "code" result-params) (let ((lang (or lang "none"))) (funcall wrap (format "#+begin_src %s%s" lang results-switches) "#+end_src" nil nil (format "{{{results(src_%s[%s]{" lang results-switches) "})}}}"))) ((member "raw" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle)))) ((or (member "drawer" result-params) (member "wrap" result-params)) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap ":results:" ":end:" 'no-escape nil "{{{results(" ")}}}")) ((and inline (member "file" result-params)) (funcall wrap nil nil nil nil "{{{results(" ")}}}")) ((and (not (funcall tabulablep result)) (not (member "file" result-params))) (let ((org-babel-inline-result-wrap (format "{{{results(%s)}}}" org-babel-inline-result-wrap))) (org-babel-examplify-region beg end results-switches inline))))) (if (and (not inline) (numberp indent) (> indent 0) (not (and (listp result) (member "append" result-params)))) (progn (indent-rigidly beg end indent))) (if (null result) (if (member "value" result-params) (message "Code block returned no value.") (message "Code block produced no output.")) (message "Code block evaluation complete."))) (set-marker end nil) (if outside-scope (progn (narrow-to-region visible-beg visible-end))) (set-marker visible-beg nil) (set-marker visible-end nil)))
  (save-excursion (let* ((visible-beg (point-min-marker)) (visible-end (copy-marker (point-max) t)) (inline (let ((context (org-element-context))) (and (memq (org-element-type context) '(inline-babel-call inline-src-block)) context))) (existing-result (org-babel-where-is-src-block-result t nil hash)) (results-switches (cdr (assq :results_switches (nth 2 info)))) (outside-scope (and existing-result (buffer-narrowed-p) (or (> visible-beg existing-result) (<= visible-end existing-result)))) beg end indent) (if (and (org-string-nw-p result) (not inline) (not (string-equal (substring result -1) "\n"))) (progn (setq result (concat result "\n")))) (unwind-protect (progn (if outside-scope (progn (widen))) (if existing-result (goto-char existing-result) (goto-char (org-element-property :end inline)) (skip-chars-backward " \011")) (if inline nil (setq indent (current-indentation)) (forward-line 1)) (setq beg (point)) (cond (inline (if existing-result nil (insert " ") (setq beg (point)))) ((member "replace" result-params) (delete-region (point) (org-babel-result-end))) ((member "append" result-params) (goto-char (org-babel-result-end)) (setq beg (point-marker))) ((member "prepend" result-params))) (setq results-switches (if results-switches (concat " " results-switches) "")) (let ((wrap (function (lambda (start finish &optional no-escape no-newlines inline-start inline-finish) (if inline (progn (setq start inline-start) (setq finish inline-finish) (setq no-newlines t))) (let ((before-finish (marker-position end))) (goto-char end) (insert (concat finish (if no-newlines nil "\n"))) (goto-char beg) (insert (concat start (if no-newlines nil "\n"))) (if no-escape nil (org-escape-code-in-region (min (point) before-finish) before-finish)) (goto-char end))))) (tabulablep (function (lambda (r) (and (proper-list-p r) (cl-every (function (lambda (e) (or (atom e) (proper-list-p e)))) result)))))) (cond ((null result)) ((member "list" result-params) (insert (org-trim (org-list-to-generic (cons 'unordered (mapcar (function (lambda (e) (list (if (stringp e) e (format "%S" e))))) (if (listp result) result (split-string result "\n" t)))) '(:splicep nil :istart "- " :iend "\n"))) "\n")) ((funcall tabulablep result) (goto-char beg) (insert (concat (orgtbl-to-orgtbl (if (cl-every (function (lambda (e) (or (eq e 'hline) (listp e)))) result) result (list result)) nil) "\n")) (goto-char beg) (if (org-at-table-p) (progn (org-table-align))) (goto-char (org-table-end))) ((listp result) (insert (format "%s\n" result))) ((member "file" result-params) (if inline (progn (setq result (org-macro-escape-arguments result)))) (insert result)) ((and inline (not (member "raw" result-params))) (insert (org-macro-escape-arguments (org-babel-chomp result "\n")))) (t (goto-char beg) (insert result))) (setq end (copy-marker (point) t)) (cond ((assq :wrap (nth 2 info)) (let ((name (or (cdr (assq :wrap (nth 2 info))) "results"))) (funcall wrap (concat "#+begin_" name) (concat "#+end_" (car (split-string name))) nil nil (concat "{{{results(@@" name ":") "@@)}}}"))) ((member "html" result-params) (funcall wrap "#+begin_export html" "#+end_export" nil nil "{{{results(@@html:" "@@)}}}")) ((member "latex" result-params) (funcall wrap "#+begin_export latex" "#+end_export" nil nil "{{{results(@@latex:" "@@)}}}")) ((member "org" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap "#+begin_src org" "#+end_src" nil nil "{{{results(src_org{" "})}}}")) ((member "code" result-params) (let ((lang (or lang "none"))) (funcall wrap (format "#+begin_src %s%s" lang results-switches) "#+end_src" nil nil (format "{{{results(src_%s[%s]{" lang results-switches) "})}}}"))) ((member "raw" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle)))) ((or (member "drawer" result-params) (member "wrap" result-params)) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap ":results:" ":end:" 'no-escape nil "{{{results(" ")}}}")) ((and inline (member "file" result-params)) (funcall wrap nil nil nil nil "{{{results(" ")}}}")) ((and (not (funcall tabulablep result)) (not (member "file" result-params))) (let ((org-babel-inline-result-wrap (format "{{{results(%s)}}}" org-babel-inline-result-wrap))) (org-babel-examplify-region beg end results-switches inline))))) (if (and (not inline) (numberp indent) (> indent 0) (not (and (listp result) (member "append" result-params)))) (progn (indent-rigidly beg end indent))) (if (null result) (if (member "value" result-params) (message "Code block returned no value.") (message "Code block produced no output.")) (message "Code block evaluation complete."))) (set-marker end nil) (if outside-scope (progn (narrow-to-region visible-beg visible-end))) (set-marker visible-beg nil) (set-marker visible-end nil))))
  (let ((inline (let ((context (org-element-context))) (and (memq (org-element-type context) '(inline-babel-call inline-src-block)) context)))) (if inline (progn (let ((warning (or (and (member "table" result-params) "`:results table'") (and (listp result) "list result") (and (string-match-p "\n." result) "multiline result") (and (member "list" result-params) "`:results list'")))) (if warning (progn (user-error "Inline error: %s cannot be used" warning)))))) (save-excursion (let* ((visible-beg (point-min-marker)) (visible-end (copy-marker (point-max) t)) (inline (let ((context (org-element-context))) (and (memq (org-element-type context) '(inline-babel-call inline-src-block)) context))) (existing-result (org-babel-where-is-src-block-result t nil hash)) (results-switches (cdr (assq :results_switches (nth 2 info)))) (outside-scope (and existing-result (buffer-narrowed-p) (or (> visible-beg existing-result) (<= visible-end existing-result)))) beg end indent) (if (and (org-string-nw-p result) (not inline) (not (string-equal (substring result -1) "\n"))) (progn (setq result (concat result "\n")))) (unwind-protect (progn (if outside-scope (progn (widen))) (if existing-result (goto-char existing-result) (goto-char (org-element-property :end inline)) (skip-chars-backward " \011")) (if inline nil (setq indent (current-indentation)) (forward-line 1)) (setq beg (point)) (cond (inline (if existing-result nil (insert " ") (setq beg (point)))) ((member "replace" result-params) (delete-region (point) (org-babel-result-end))) ((member "append" result-params) (goto-char (org-babel-result-end)) (setq beg (point-marker))) ((member "prepend" result-params))) (setq results-switches (if results-switches (concat " " results-switches) "")) (let ((wrap (function (lambda (start finish &optional no-escape no-newlines inline-start inline-finish) (if inline (progn (setq start inline-start) (setq finish inline-finish) (setq no-newlines t))) (let ((before-finish (marker-position end))) (goto-char end) (insert (concat finish (if no-newlines nil "\n"))) (goto-char beg) (insert (concat start (if no-newlines nil "\n"))) (if no-escape nil (org-escape-code-in-region (min (point) before-finish) before-finish)) (goto-char end))))) (tabulablep (function (lambda (r) (and (proper-list-p r) (cl-every (function (lambda (e) (or (atom e) (proper-list-p e)))) result)))))) (cond ((null result)) ((member "list" result-params) (insert (org-trim (org-list-to-generic (cons 'unordered (mapcar (function (lambda (e) (list (if (stringp e) e (format "%S" e))))) (if (listp result) result (split-string result "\n" t)))) '(:splicep nil :istart "- " :iend "\n"))) "\n")) ((funcall tabulablep result) (goto-char beg) (insert (concat (orgtbl-to-orgtbl (if (cl-every (function (lambda (e) (or (eq e 'hline) (listp e)))) result) result (list result)) nil) "\n")) (goto-char beg) (if (org-at-table-p) (progn (org-table-align))) (goto-char (org-table-end))) ((listp result) (insert (format "%s\n" result))) ((member "file" result-params) (if inline (progn (setq result (org-macro-escape-arguments result)))) (insert result)) ((and inline (not (member "raw" result-params))) (insert (org-macro-escape-arguments (org-babel-chomp result "\n")))) (t (goto-char beg) (insert result))) (setq end (copy-marker (point) t)) (cond ((assq :wrap (nth 2 info)) (let ((name (or (cdr (assq :wrap (nth 2 info))) "results"))) (funcall wrap (concat "#+begin_" name) (concat "#+end_" (car (split-string name))) nil nil (concat "{{{results(@@" name ":") "@@)}}}"))) ((member "html" result-params) (funcall wrap "#+begin_export html" "#+end_export" nil nil "{{{results(@@html:" "@@)}}}")) ((member "latex" result-params) (funcall wrap "#+begin_export latex" "#+end_export" nil nil "{{{results(@@latex:" "@@)}}}")) ((member "org" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap "#+begin_src org" "#+end_src" nil nil "{{{results(src_org{" "})}}}")) ((member "code" result-params) (let ((lang (or lang "none"))) (funcall wrap (format "#+begin_src %s%s" lang results-switches) "#+end_src" nil nil (format "{{{results(src_%s[%s]{" lang results-switches) "})}}}"))) ((member "raw" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle)))) ((or (member "drawer" result-params) (member "wrap" result-params)) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap ":results:" ":end:" 'no-escape nil "{{{results(" ")}}}")) ((and inline (member "file" result-params)) (funcall wrap nil nil nil nil "{{{results(" ")}}}")) ((and (not (funcall tabulablep result)) (not (member "file" result-params))) (let ((org-babel-inline-result-wrap (format "{{{results(%s)}}}" org-babel-inline-result-wrap))) (org-babel-examplify-region beg end results-switches inline))))) (if (and (not inline) (numberp indent) (> indent 0) (not (and (listp result) (member "append" result-params)))) (progn (indent-rigidly beg end indent))) (if (null result) (if (member "value" result-params) (message "Code block returned no value.") (message "Code block produced no output.")) (message "Code block evaluation complete."))) (set-marker end nil) (if outside-scope (progn (narrow-to-region visible-beg visible-end))) (set-marker visible-beg nil) (set-marker visible-end nil)))))
  (if (and result-params (member "silent" result-params)) (progn (message (replace-regexp-in-string "%" "%%" (format "%S" result))) result) (let ((inline (let ((context (org-element-context))) (and (memq (org-element-type context) '(inline-babel-call inline-src-block)) context)))) (if inline (progn (let ((warning (or (and (member "table" result-params) "`:results table'") (and (listp result) "list result") (and (string-match-p "\n." result) "multiline result") (and (member "list" result-params) "`:results list'")))) (if warning (progn (user-error "Inline error: %s cannot be used" warning)))))) (save-excursion (let* ((visible-beg (point-min-marker)) (visible-end (copy-marker (point-max) t)) (inline (let ((context (org-element-context))) (and (memq (org-element-type context) '(inline-babel-call inline-src-block)) context))) (existing-result (org-babel-where-is-src-block-result t nil hash)) (results-switches (cdr (assq :results_switches (nth 2 info)))) (outside-scope (and existing-result (buffer-narrowed-p) (or (> visible-beg existing-result) (<= visible-end existing-result)))) beg end indent) (if (and (org-string-nw-p result) (not inline) (not (string-equal (substring result -1) "\n"))) (progn (setq result (concat result "\n")))) (unwind-protect (progn (if outside-scope (progn (widen))) (if existing-result (goto-char existing-result) (goto-char (org-element-property :end inline)) (skip-chars-backward " \011")) (if inline nil (setq indent (current-indentation)) (forward-line 1)) (setq beg (point)) (cond (inline (if existing-result nil (insert " ") (setq beg (point)))) ((member "replace" result-params) (delete-region (point) (org-babel-result-end))) ((member "append" result-params) (goto-char (org-babel-result-end)) (setq beg (point-marker))) ((member "prepend" result-params))) (setq results-switches (if results-switches (concat " " results-switches) "")) (let ((wrap (function (lambda (start finish &optional no-escape no-newlines inline-start inline-finish) (if inline (progn (setq start inline-start) (setq finish inline-finish) (setq no-newlines t))) (let ((before-finish (marker-position end))) (goto-char end) (insert (concat finish (if no-newlines nil "\n"))) (goto-char beg) (insert (concat start (if no-newlines nil "\n"))) (if no-escape nil (org-escape-code-in-region (min (point) before-finish) before-finish)) (goto-char end))))) (tabulablep (function (lambda (r) (and (proper-list-p r) (cl-every (function (lambda (e) (or (atom e) (proper-list-p e)))) result)))))) (cond ((null result)) ((member "list" result-params) (insert (org-trim (org-list-to-generic (cons 'unordered (mapcar (function (lambda (e) (list (if (stringp e) e (format "%S" e))))) (if (listp result) result (split-string result "\n" t)))) '(:splicep nil :istart "- " :iend "\n"))) "\n")) ((funcall tabulablep result) (goto-char beg) (insert (concat (orgtbl-to-orgtbl (if (cl-every (function (lambda (e) (or (eq e 'hline) (listp e)))) result) result (list result)) nil) "\n")) (goto-char beg) (if (org-at-table-p) (progn (org-table-align))) (goto-char (org-table-end))) ((listp result) (insert (format "%s\n" result))) ((member "file" result-params) (if inline (progn (setq result (org-macro-escape-arguments result)))) (insert result)) ((and inline (not (member "raw" result-params))) (insert (org-macro-escape-arguments (org-babel-chomp result "\n")))) (t (goto-char beg) (insert result))) (setq end (copy-marker (point) t)) (cond ((assq :wrap (nth 2 info)) (let ((name (or (cdr (assq :wrap (nth 2 info))) "results"))) (funcall wrap (concat "#+begin_" name) (concat "#+end_" (car (split-string name))) nil nil (concat "{{{results(@@" name ":") "@@)}}}"))) ((member "html" result-params) (funcall wrap "#+begin_export html" "#+end_export" nil nil "{{{results(@@html:" "@@)}}}")) ((member "latex" result-params) (funcall wrap "#+begin_export latex" "#+end_export" nil nil "{{{results(@@latex:" "@@)}}}")) ((member "org" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap "#+begin_src org" "#+end_src" nil nil "{{{results(src_org{" "})}}}")) ((member "code" result-params) (let ((lang (or lang "none"))) (funcall wrap (format "#+begin_src %s%s" lang results-switches) "#+end_src" nil nil (format "{{{results(src_%s[%s]{" lang results-switches) "})}}}"))) ((member "raw" result-params) (goto-char beg) (if (org-at-table-p) (progn (org-cycle)))) ((or (member "drawer" result-params) (member "wrap" result-params)) (goto-char beg) (if (org-at-table-p) (progn (org-cycle))) (funcall wrap ":results:" ":end:" 'no-escape nil "{{{results(" ")}}}")) ((and inline (member "file" result-params)) (funcall wrap nil nil nil nil "{{{results(" ")}}}")) ((and (not (funcall tabulablep result)) (not (member "file" result-params))) (let ((org-babel-inline-result-wrap (format "{{{results(%s)}}}" org-babel-inline-result-wrap))) (org-babel-examplify-region beg end results-switches inline))))) (if (and (not inline) (numberp indent) (> indent 0) (not (and (listp result) (member "append" result-params)))) (progn (indent-rigidly beg end indent))) (if (null result) (if (member "value" result-params) (message "Code block returned no value.") (message "Code block produced no output.")) (message "Code block evaluation complete."))) (set-marker end nil) (if outside-scope (progn (narrow-to-region visible-beg visible-end))) (set-marker visible-beg nil) (set-marker visible-end nil))))))
  org-babel-insert-result("code-maat/README.md" ("output" "replace" "file" "link") ("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") nil "sh")
  (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook))
  (save-excursion (goto-char (point-min)) (re-search-forward "72afb2aa9264f9caf40d2beeb8818943") (org-backward-element) (let ((result-block (split-string (thing-at-point 'line t)))) (-if-let (block-name (nth 1 result-block)) (org-babel-goto-named-src-block block-name) (org-backward-element))) (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook)))
  (let ((default-directory "/home/stardiviner/Org/Wiki/Computer Technology/Softwares/data/code/")) (save-excursion (goto-char (point-min)) (re-search-forward "72afb2aa9264f9caf40d2beeb8818943") (org-backward-element) (let ((result-block (split-string (thing-at-point 'line t)))) (-if-let (block-name (nth 1 result-block)) (org-babel-goto-named-src-block block-name) (org-backward-element))) (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook))))
  (save-current-buffer (set-buffer #<buffer Code Maat.org>) (let ((default-directory "/home/stardiviner/Org/Wiki/Computer Technology/Softwares/data/code/")) (save-excursion (goto-char (point-min)) (re-search-forward "72afb2aa9264f9caf40d2beeb8818943") (org-backward-element) (let ((result-block (split-string (thing-at-point 'line t)))) (-if-let (block-name (nth 1 result-block)) (org-babel-goto-named-src-block block-name) (org-backward-element))) (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook)))))
  (with-current-buffer #<buffer Code Maat.org> (let ((default-directory "/home/stardiviner/Org/Wiki/Computer Technology/Softwares/data/code/")) (save-excursion (goto-char (point-min)) (re-search-forward "72afb2aa9264f9caf40d2beeb8818943") (org-backward-element) (let ((result-block (split-string (thing-at-point 'line t)))) (-if-let (block-name (nth 1 result-block)) (org-babel-goto-named-src-block block-name) (org-backward-element))) (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook)))))
  (lambda (result) (with-current-buffer #<buffer Code Maat.org> (let ((default-directory "/home/stardiviner/Org/Wiki/Computer Technology/Softwares/data/code/")) (save-excursion (goto-char (point-min)) (re-search-forward "72afb2aa9264f9caf40d2beeb8818943") (org-backward-element) (let ((result-block (split-string (thing-at-point 'line t)))) (-if-let (block-name (nth 1 result-block)) (org-babel-goto-named-src-block block-name) (org-backward-element))) (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook))))))("Already up to date.\n")
  async-handle-result((lambda (result) (with-current-buffer #<buffer Code Maat.org> (let ((default-directory "/home/stardiviner/Org/Wiki/Computer Technology/Softwares/data/code/")) (save-excursion (goto-char (point-min)) (re-search-forward "72afb2aa9264f9caf40d2beeb8818943") (org-backward-element) (let ((result-block (split-string (thing-at-point 'line t)))) (-if-let (block-name (nth 1 result-block)) (org-babel-goto-named-src-block block-name) (org-backward-element))) (let ((file (cdr (assq :file '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when file (when result (with-temp-file file (insert (org-babel-format-result result (cdr (assq :sep '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))))) (setq result file)) (let ((post (cdr (assq :post '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)))))) (when post (let ((*this* (if (not file) result (org-babel-result-to-file file (let ((desc (assq :file-desc '((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async))))) (and desc (or (cdr desc) result))))))) (setq result (org-babel-ref-resolve post)) (when file (setq result-params (remove "file" '("output" "replace" "file" "link"))))))) (org-babel-insert-result result '("output" "replace" "file" "link") '("sh" "if [ -d code-maat ]; then\n  cd code-maat ; git pull\nelse\n  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat\nfi" ((:colname-names) (:rowname-names) (:result-params "output" "replace" "file" "link") (:result-type . output) (:results . "output replace file link") (:exports . "") (:session . "none") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:cache . "yes") (:eval . "never-export") (:mkdirp . "yes") (:dir . "data/code") (:file . "code-maat/README.md") (:async)) "" "clone source code" 2073 "# (ref:%s)") 'nil '"sh") (run-hooks 'org-babel-after-execute-hook)))))) "Already up to date.\n" #<buffer *emacs*>)
  async-when-done(#<process emacs> "finished\n")

Steps to Reproduce

#+NAME: clone source code
#+begin_src sh :mkdirp yes :results file link :dir "data/code" :file "code-maat/README.md" :async
if [ -d code-maat ]; then
  cd code-maat ; git pull
else
  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat
fi
#+end_src

Troubleshooting Artifacts

(Copy-paste the contents of your troubleshooting.org buffer into a gist and add the link here)

stardiviner commented 5 years ago

There is another case, I hope ob-async can support it too. When use put the results name at other place (not just bellow the source block). Like:

#+NAMED: clone source code
#+begin_src sh :mkdirp yes :results file link :dir "data/code" :file "code-maat/README.md" :async
if [ -d code-maat ]; then
  cd code-maat ; git pull
else
  git clone --recursive https://github.com/adamtornhill/code-maat.git code-maat
fi
#+end_src

* another headline

You can check out the README file at here:

#+RESULTS: clone source code
astahlman commented 5 years ago

Just confirming that I can reproduce - will try to find some time to look into it this weekend

astahlman commented 5 years ago

@stardiviner I believe https://github.com/astahlman/ob-async/pull/48 addresses both of these issues - can you test it out and confirm?

stardiviner commented 5 years ago

Confirm fixed. Thanks for awesome quick fix. :+1: