فهرست منبع

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.
Bastien 5 سال پیش
والد
کامیت
0c02928eb2
2فایلهای تغییر یافته به همراه13 افزوده شده و 13 حذف شده
  1. 1 1
      etc/ORG-NEWS
  2. 12 12
      lisp/ob-shell.el

+ 1 - 1
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
 You can turn this on/off on a per-file basis with =#+startup: num= or
 =#+startup: nonum=.
 =#+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
 When set to =t=, consider the return value of a shell source code
 block is the exit status of its last command.  
 block is the exit status of its last command.  

+ 12 - 12
lisp/ob-shell.el

@@ -71,7 +71,7 @@ outside the Customize interface."
 	 (set-default symbol value)
 	 (set-default symbol value)
 	 (org-babel-shell-initialize)))
 	 (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?
   "Should we consider the shell exit status as the return value?
 When this is set to nil (the default), consider that the return
 When this is set to nil (the default), consider that the return
 value of a shell source block is the output of the commands.
 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
                   (when stdin (org-babel-sh-var-to-string
                                (org-babel-ref-resolve stdin)))))
                                (org-babel-ref-resolve stdin)))))
 	 (value-is-exit-status (or (cdr (assq :value-is-exit-status 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))
 	 (cmdline (cdr (assq :cmdline params)))
 	 (cmdline (cdr (assq :cmdline params)))
          (full-body (concat
          (full-body (concat
 		     (org-babel-expand-body:generic
 		     (org-babel-expand-body:generic
@@ -144,15 +144,15 @@ This function is called by `org-babel-execute-src-block'."
     (varname values &optional sep hline)
     (varname values &optional sep hline)
   "Return a list of statements declaring the values as bash associative array."
   "Return a list of statements declaring the values as bash associative array."
   (format "unset %s\ndeclare -A %s\n%s"
   (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)
 (defun org-babel--variable-assignments:bash (varname values &optional sep hline)
   "Represent the parameters as useful Bash shell variables."
   "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."
 return the value of the last statement in BODY."
   (let* ((shebang (cdr (assq :shebang params)))
   (let* ((shebang (cdr (assq :shebang params)))
 	 (value-is-exit-status (or (cdr (assq :value-is-exit-status 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
 	 (results
 	  (cond
 	  (cond
 	   ((or stdin cmdline)	       ; external shell script w/STDIN
 	   ((or stdin cmdline)	       ; external shell script w/STDIN