summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien <bzg@gnu.org>2020-02-21 08:26:37 +0100
committerBastien <bzg@gnu.org>2020-02-21 08:26:37 +0100
commit0c02928eb25c3ec867e01adb05b481cddb3992a6 (patch)
treef7b20ec0884b1b82a55f5d272f93f98e66cc8828
parent97d0514b0b8db1a1338bd589acddefeacc9134bc (diff)
downloadorg-mode-0c02928eb25c3ec867e01adb05b481cddb3992a6.tar.gz
ob-shell.el: Rename `ob-shell-return-value-is-exit-status'
* lisp/ob-shell.el (org-babel-shell-return-value-is-exit-status): Rename from `ob-shell-return-value-is-exit-status'. (org-babel-execute:shell, org-babel-sh-evaluate): Use new name. (org-babel--variable-assignments:bash_assoc): Fix indentation.
-rw-r--r--etc/ORG-NEWS2
-rw-r--r--lisp/ob-shell.el24
2 files changed, 13 insertions, 13 deletions
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 4e5aa85..3287fb1 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -238,7 +238,7 @@ and headings will be visually numeroted.
You can turn this on/off on a per-file basis with =#+startup: num= or
=#+startup: nonum=.
-*** New option ~ob-shell-return-value-is-exit-status~
+*** New option ~org-babel-shell-return-value-is-exit-status~
When set to =t=, consider the return value of a shell source code
block is the exit status of its last command.
diff --git a/lisp/ob-shell.el b/lisp/ob-shell.el
index 6c8ca96..c666b43 100644
--- a/lisp/ob-shell.el
+++ b/lisp/ob-shell.el
@@ -71,7 +71,7 @@ outside the Customize interface."
(set-default symbol value)
(org-babel-shell-initialize)))
-(defcustom ob-shell-return-value-is-exit-status nil
+(defcustom org-babel-shell-return-value-is-exit-status nil
"Should we consider the shell exit status as the return value?
When this is set to nil (the default), consider that the return
value of a shell source block is the output of the commands.
@@ -90,7 +90,7 @@ This function is called by `org-babel-execute-src-block'."
(when stdin (org-babel-sh-var-to-string
(org-babel-ref-resolve stdin)))))
(value-is-exit-status (or (cdr (assq :value-is-exit-status params))
- ob-shell-return-value-is-exit-status))
+ org-babel-shell-return-value-is-exit-status))
(cmdline (cdr (assq :cmdline params)))
(full-body (concat
(org-babel-expand-body:generic
@@ -144,15 +144,15 @@ This function is called by `org-babel-execute-src-block'."
(varname values &optional sep hline)
"Return a list of statements declaring the values as bash associative array."
(format "unset %s\ndeclare -A %s\n%s"
- varname varname
- (mapconcat
- (lambda (items)
- (format "%s[%s]=%s"
- varname
- (org-babel-sh-var-to-sh (car items) sep hline)
- (org-babel-sh-var-to-sh (cdr items) sep hline)))
- values
- "\n")))
+ varname varname
+ (mapconcat
+ (lambda (items)
+ (format "%s[%s]=%s"
+ varname
+ (org-babel-sh-var-to-sh (car items) sep hline)
+ (org-babel-sh-var-to-sh (cdr items) sep hline)))
+ values
+ "\n")))
(defun org-babel--variable-assignments:bash (varname values &optional sep hline)
"Represent the parameters as useful Bash shell variables."
@@ -224,7 +224,7 @@ of the statements in BODY, if RESULT-TYPE equals `value' then
return the value of the last statement in BODY."
(let* ((shebang (cdr (assq :shebang params)))
(value-is-exit-status (or (cdr (assq :value-is-exit-status params))
- ob-shell-return-value-is-exit-status))
+ org-babel-shell-return-value-is-exit-status))
(results
(cond
((or stdin cmdline) ; external shell script w/STDIN