[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] 27bcf9a70b Backport revno 111277 from Emacs trunk.
From: |
Nick Dokos |
Subject: |
Re: [O] 27bcf9a70b Backport revno 111277 from Emacs trunk. |
Date: |
Thu, 20 Dec 2012 17:36:14 -0500 |
Achim Gratz <address@hidden> wrote:
> This commit breaks essentially all Babel tests, like this:
>
> Test ob-C/simple-program condition:
> (file-already-exists "File already exists"
> "/tmp/tmp-orgtest/scor-22752K82")
> FAILED 4/378 ob-C/simple-program
>
>
We basically have the inverse of Loris Bennett's problem now: the remote case
works,
but the local case is broken. Presumably, process-file should not be used in
the local
case, but Michael will know better.
Try C-c C-c on the following two code blocks (``lefou'' is a remote machine in
my case: replace
with one appropriate to your environment):
--8<---------------cut here---------------start------------->8---
* foo
#+BEGIN_SRC python :dir /lefou:~/tmp :results output verbatim
import socket
print socket.gethostname()
#+END_SRC
#+RESULTS:
: lefou
#+BEGIN_SRC python :dir ~/tmp :results output verbatim
import socket
print socket.gethostname()
#+END_SRC
--8<---------------cut here---------------end--------------->8---
The first (remote case) works for me. The second (local case) gives the
appended backtrace.
Thanks,
Nick
Debugger entered--Lisp error: (file-already-exists "File already exists"
"/tmp/babel-6934SF5/scor-69342uv")
copy-file("/tmp/emacs6934D51" "/tmp/babel-6934SF5/scor-69342uv")
process-file("/bin/bash" "/tmp/babel-6934SF5/input-6934pkp" (t
"/tmp/babel-6934SF5/scor-69342uv") nil "-c" "python")
(setq exit-status (process-file shell-file-name input-file (if error-file
(list output-buffer error-file) t) nil shell-command-switch command))
(let ((swap (and replace (< start end)))) (goto-char start) (and replace
(push-mark (point) (quote nomsg))) (write-region start end input-file)
(delete-region start end) (setq exit-status (process-file shell-file-name
input-file (if error-file (list output-buffer error-file) t) nil
shell-command-switch command)) (and replace swap (exchange-point-and-mark)))
(if (or replace (and output-buffer (not (or (bufferp output-buffer) (stringp
output-buffer))))) (let ((swap (and replace (< start end)))) (goto-char start)
(and replace (push-mark (point) (quote nomsg))) (write-region start end
input-file) (delete-region start end) (setq exit-status (process-file
shell-file-name input-file (if error-file (list output-buffer error-file) t)
nil shell-command-switch command)) (and replace swap
(exchange-point-and-mark))) (let ((buffer (get-buffer-create (or output-buffer
"*Shell Command Output*")))) (unwind-protect (if (eq buffer (current-buffer))
(progn (setq buffer-read-only nil) (delete-region (max start end) (point-max))
(delete-region (point-min) (min start end)) (write-region (point-min)
(point-max) input-file) (delete-region (point-min) (point-max)) (setq
exit-status (process-file shell-file-name input-file (if error-file ... t) nil
shell-command-switch command))) (let ((directory default-directory))
(save-current-buffer (set-buffer buf
fer) (setq buffer-read-only nil) (if (not output-buffer) (setq
default-directory directory)) (erase-buffer))) (setq exit-status (process-file
shell-file-name nil (if error-file (list buffer error-file) buffer) nil
shell-command-switch command))) (save-current-buffer (set-buffer buffer) (setq
mode-line-process (cond ((null exit-status) " - Error") ((stringp exit-status)
(format " - Signal [%s]" exit-status)) ((not ...) (format " - Exit [%d]"
exit-status))))) (if (save-current-buffer (set-buffer buffer) (> (point-max)
(point-min))) (display-message-or-buffer buffer) (let ((output (if ... "some
error output" "no output"))) (cond ((null exit-status) (message "(Shell command
failed with error)")) ((equal 0 exit-status) (message "(Shell command succeeded
with %s)" output)) ((stringp exit-status) (message "(Shell command killed by
signal %s)" exit-status)) (t (message "(Shell command failed with code %d and
%s)" exit-status output))))))))
(let ((input-file (org-babel-temp-file "input-")) (error-file (if
error-buffer (org-babel-temp-file "scor-") nil)) (shell-file-name (if
(file-executable-p (concat (file-remote-p default-directory) shell-file-name))
shell-file-name "/bin/sh")) exit-status) (if (or replace (and output-buffer
(not (or (bufferp output-buffer) (stringp output-buffer))))) (let ((swap (and
replace (< start end)))) (goto-char start) (and replace (push-mark (point)
(quote nomsg))) (write-region start end input-file) (delete-region start end)
(setq exit-status (process-file shell-file-name input-file (if error-file (list
output-buffer error-file) t) nil shell-command-switch command)) (and replace
swap (exchange-point-and-mark))) (let ((buffer (get-buffer-create (or
output-buffer "*Shell Command Output*")))) (unwind-protect (if (eq buffer
(current-buffer)) (progn (setq buffer-read-only nil) (delete-region (max start
end) (point-max)) (delete-region (point-min) (min start end)) (write-region
(point-min
) (point-max) input-file) (delete-region (point-min) (point-max)) (setq
exit-status (process-file shell-file-name input-file ... nil
shell-command-switch command))) (let ((directory default-directory))
(save-current-buffer (set-buffer buffer) (setq buffer-read-only nil) (if ...
...) (erase-buffer))) (setq exit-status (process-file shell-file-name nil (if
error-file ... buffer) nil shell-command-switch command))) (save-current-buffer
(set-buffer buffer) (setq mode-line-process (cond (... " - Error") (... ...)
(... ...)))) (if (save-current-buffer (set-buffer buffer) (> (point-max)
(point-min))) (display-message-or-buffer buffer) (let ((output ...)) (cond (...
...) (... ...) (... ...) (t ...))))))) (if (and input-file (file-exists-p
input-file)) (progn (delete-file input-file))) (if (and error-file
(file-exists-p error-file)) (progn (if (< 0 (nth 7 (file-attributes
error-file))) (save-current-buffer (set-buffer (get-buffer-create
error-buffer)) (let ((pos-from-end ...)) (or (b
obp) (insert "\f\n")) (format-insert-file error-file nil) (goto-char (- ...
pos-from-end))) (and display-error-buffer (display-buffer (current-buffer)))))
(delete-file error-file))) exit-status)
org-babel-shell-command-on-region(1 42 "python" t replace #<buffer
*Org-Babel Error*>)
(setq exit-code (org-babel-shell-command-on-region (point-min) (point-max)
cmd t (quote replace) err-buff))
(progn (insert body) (setq exit-code (org-babel-shell-command-on-region
(point-min) (point-max) cmd t (quote replace) err-buff)) (if (or (not (numberp
exit-code)) (> exit-code 0)) (progn (save-current-buffer (set-buffer err-buff)
(org-babel-eval-error-notify exit-code (buffer-string))) nil) (buffer-string)))
(unwind-protect (progn (insert body) (setq exit-code
(org-babel-shell-command-on-region (point-min) (point-max) cmd t (quote
replace) err-buff)) (if (or (not (numberp exit-code)) (> exit-code 0)) (progn
(save-current-buffer (set-buffer err-buff) (org-babel-eval-error-notify
exit-code (buffer-string))) nil) (buffer-string))) (and (buffer-name
temp-buffer) (kill-buffer temp-buffer)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert
body) (setq exit-code (org-babel-shell-command-on-region (point-min)
(point-max) cmd t (quote replace) err-buff)) (if (or (not (numberp exit-code))
(> exit-code 0)) (progn (save-current-buffer (set-buffer err-buff)
(org-babel-eval-error-notify exit-code (buffer-string))) nil) (buffer-string)))
(and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
(let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer
(set-buffer temp-buffer) (unwind-protect (progn (insert body) (setq exit-code
(org-babel-shell-command-on-region (point-min) (point-max) cmd t (quote
replace) err-buff)) (if (or (not (numberp exit-code)) (> exit-code 0)) (progn
(save-current-buffer (set-buffer err-buff) (org-babel-eval-error-notify
exit-code ...)) nil) (buffer-string))) (and (buffer-name temp-buffer)
(kill-buffer temp-buffer)))))
(let ((err-buff (get-buffer-create " *Org-Babel Error*")) exit-code)
(save-current-buffer (set-buffer err-buff) (erase-buffer)) (let ((temp-buffer
(generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer)
(unwind-protect (progn (insert body) (setq exit-code
(org-babel-shell-command-on-region (point-min) (point-max) cmd t (quote
replace) err-buff)) (if (or (not ...) (> exit-code 0)) (progn
(save-current-buffer ... ...) nil) (buffer-string))) (and (buffer-name
temp-buffer) (kill-buffer temp-buffer))))))
org-babel-eval("python" "import socket\n\nprint socket.gethostname()")
(cond ((eql result-type (quote output)) (org-babel-eval
org-babel-python-command (concat (if preamble (concat preamble "\n") "")
body))) ((eql result-type (quote value)) (let ((tmp-file (org-babel-temp-file
"python-"))) (org-babel-eval org-babel-python-command (concat (if preamble
(concat preamble "\n") "") (format (if (member "pp" result-params)
org-babel-python-pp-wrapper-method org-babel-python-wrapper-method) (mapconcat
(function ...) (split-string ... "[
\n]") "\n") (org-babel-process-file-name tmp-file (quote noquote)))))
(org-babel-eval-read-file tmp-file))))
((lambda (raw) (if (member "none" result-params) nil (if (or (member "scalar"
result-params) (member "verbatim" result-params) (member "html" result-params)
(member "code" result-params) (member "pp" result-params) (and (member "output"
result-params) (not (member "table" result-params)))) raw
(org-babel-python-table-or-string (org-babel-trim raw))))) (cond ((eql
result-type (quote output)) (org-babel-eval org-babel-python-command (concat
(if preamble (concat preamble "\n") "") body))) ((eql result-type (quote
value)) (let ((tmp-file (org-babel-temp-file "python-"))) (org-babel-eval
org-babel-python-command (concat (if preamble (concat preamble "\n") "")
(format (if ... org-babel-python-pp-wrapper-method
org-babel-python-wrapper-method) (mapconcat ... ... "\n")
(org-babel-process-file-name tmp-file ...)))) (org-babel-eval-read-file
tmp-file)))))
org-babel-python-evaluate-external-process("import socket\n\nprint
socket.gethostname()" output ("verbatim" "output" "replace") nil)
(if session (org-babel-python-evaluate-session session body result-type
result-params) (org-babel-python-evaluate-external-process body result-type
result-params preamble))
org-babel-python-evaluate(nil "import socket\n\nprint socket.gethostname()"
output ("verbatim" "output" "replace") nil)
(let* ((session (org-babel-python-initiate-session (cdr (assoc :session
params)))) (result-params (cdr (assoc :result-params params))) (result-type
(cdr (assoc :result-type params))) (return-val (if (and (eq result-type (quote
value)) (not session)) (progn (cdr (assoc :return params))))) (preamble (cdr
(assoc :preamble params))) (full-body (org-babel-expand-body:generic (concat
body (if return-val (format "\nreturn %s" return-val) "")) params
(org-babel-variable-assignments:python params))) (result
(org-babel-python-evaluate session full-body result-type result-params
preamble))) (org-babel-reassemble-table result (org-babel-pick-name (cdr (assoc
:colname-names params)) (cdr (assoc :colnames params))) (org-babel-pick-name
(cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))
org-babel-execute:python("import socket\n\nprint socket.gethostname()"
((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb .
"no") (:tangle . "no") (:exports . "code") (:results . "replace output
verbatim") (:session . "none") (:hlines . "no") (:padnewline . "yes") (:dir .
"~/tmp") (:result-type . output) (:result-params "verbatim" "output" "replace")
(:rowname-names) (:colname-names)))
funcall(org-babel-execute:python "import socket\n\nprint
socket.gethostname()" ((:comments . "") (:shebang . "") (:cache . "no")
(:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "code") (:results
. "replace output verbatim") (:session . "none") (:hlines . "no") (:padnewline
. "yes") (:dir . "~/tmp") (:result-type . output) (:result-params "verbatim"
"output" "replace") (:rowname-names) (:colname-names)))
((lambda (result) (if (and (eq (cdr (assoc :result-type params)) (quote
value)) (or (member "vector" result-params) (member "table" result-params))
(not (listp result))) (list (list result)) result)) (funcall cmd body params))
(setq result ((lambda (result) (if (and (eq (cdr (assoc :result-type params))
(quote value)) (or (member "vector" result-params) (member "table"
result-params)) (not (listp result))) (list (list result)) result)) (funcall
cmd body params)))
(if (member "none" result-params) (progn (funcall cmd body params) (message
"result silenced")) (setq result ((lambda (result) (if (and (eq (cdr ...)
(quote value)) (or (member "vector" result-params) (member "table"
result-params)) (not (listp result))) (list (list result)) result)) (funcall
cmd body params))) (if (cdr (assoc :file params)) (progn (if result (progn (let
((temp-file ...) (temp-buffer ...)) (unwind-protect (prog1 ... ...) (and ...
...))))) (setq result (cdr (assoc :file params))))) (org-babel-insert-result
result result-params info new-hash indent lang) (run-hooks (quote
org-babel-after-execute-hook)) result)
(if (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion
(goto-char (org-babel-where-is-src-block-result nil info)) (end-of-line 1)
(forward-char 1) (setq result (org-babel-read-result)) (message
(replace-regexp-in-string "%" "%%" (format "%S" result))) result) (message
"executing %s code block%s..." (capitalize lang) (if (nth 4 info) (format "
(%s)" (nth 4 info)) "")) (if (member "none" result-params) (progn (funcall cmd
body params) (message "result silenced")) (setq result ((lambda (result) (if
(and (eq ... ...) (or ... ...) (not ...)) (list (list result)) result))
(funcall cmd body params))) (if (cdr (assoc :file params)) (progn (if result
(progn (let (... ...) (unwind-protect ... ...)))) (setq result (cdr (assoc
:file params))))) (org-babel-insert-result result result-params info new-hash
indent lang) (run-hooks (quote org-babel-after-execute-hook)) result))
(let ((call-process-region (function (lambda (&rest args) (apply (quote
org-babel-tramp-handle-call-process-region) args))))) (let ((lang-check
(function (lambda (f) (let (...) (if ... ...)))))) (setq cmd (or (funcall
lang-check lang) (funcall lang-check (symbol-name (cdr (assoc lang
org-src-lang-modes)))) (error "No org-babel-execute function for %s!" lang))))
(if (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion
(goto-char (org-babel-where-is-src-block-result nil info)) (end-of-line 1)
(forward-char 1) (setq result (org-babel-read-result)) (message
(replace-regexp-in-string "%" "%%" (format "%S" result))) result) (message
"executing %s code block%s..." (capitalize lang) (if (nth 4 info) (format "
(%s)" (nth 4 info)) "")) (if (member "none" result-params) (progn (funcall cmd
body params) (message "result silenced")) (setq result ((lambda (result) (if
(and ... ... ...) (list ...) result)) (funcall cmd body params))) (if (cdr
(assoc :file params)) (progn (if
result (progn (let ... ...))) (setq result (cdr (assoc :file params)))))
(org-babel-insert-result result result-params info new-hash indent lang)
(run-hooks (quote org-babel-after-execute-hook)) result)))
(unwind-protect (let ((call-process-region (function (lambda (&rest args)
(apply (quote org-babel-tramp-handle-call-process-region) args))))) (let
((lang-check (function (lambda (f) (let ... ...))))) (setq cmd (or (funcall
lang-check lang) (funcall lang-check (symbol-name (cdr ...))) (error "No
org-babel-execute function for %s!" lang)))) (if (and (not arg) new-hash (equal
new-hash old-hash)) (save-excursion (goto-char
(org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-char
1) (setq result (org-babel-read-result)) (message (replace-regexp-in-string "%"
"%%" (format "%S" result))) result) (message "executing %s code block%s..."
(capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 info)) "")) (if
(member "none" result-params) (progn (funcall cmd body params) (message "result
silenced")) (setq result ((lambda (result) (if ... ... result)) (funcall cmd
body params))) (if (cdr (assoc :file params)) (progn (if result (progn ...))
(setq result (cdr ...))
)) (org-babel-insert-result result result-params info new-hash indent lang)
(run-hooks (quote org-babel-after-execute-hook)) result))) (setq
call-process-region (quote org-babel-call-process-region-original)))
(let* ((lang (nth 0 info)) (params (if params (org-babel-process-params
(org-babel-merge-params (nth 2 info) params)) (nth 2 info))) (cache\? (and (not
arg) (cdr (assoc :cache params)) (string= "yes" (cdr (assoc :cache params)))))
(result-params (cdr (assoc :result-params params))) (new-hash (if cache\?
(progn (org-babel-sha1-hash info)))) (old-hash (if cache\? (progn
(org-babel-current-result-hash)))) (body (let* ((c (nthcdr 1 info))) (setcar c
(if (org-babel-noweb-p params :eval) (org-babel-expand-noweb-references info)
(nth 1 info))))) (dir (cdr (assoc :dir params))) (default-directory (or (and
dir (file-name-as-directory (expand-file-name dir))) default-directory))
(org-babel-call-process-region-original (if (boundp (quote
org-babel-call-process-region-original)) org-babel-call-process-region-original
(symbol-function (quote call-process-region)))) (indent (car (last info)))
result cmd) (unwind-protect (let ((call-process-region (function (lambda (&rest
args) (apply ...
args))))) (let ((lang-check (function (lambda ... ...)))) (setq cmd (or
(funcall lang-check lang) (funcall lang-check (symbol-name ...)) (error "No
org-babel-execute function for %s!" lang)))) (if (and (not arg) new-hash (equal
new-hash old-hash)) (save-excursion (goto-char
(org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-char
1) (setq result (org-babel-read-result)) (message (replace-regexp-in-string "%"
"%%" (format "%S" result))) result) (message "executing %s code block%s..."
(capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 info)) "")) (if
(member "none" result-params) (progn (funcall cmd body params) (message "result
silenced")) (setq result ((lambda ... ...) (funcall cmd body params))) (if (cdr
(assoc :file params)) (progn (if result ...) (setq result ...)))
(org-babel-insert-result result result-params info new-hash indent lang)
(run-hooks (quote org-babel-after-execute-hook)) result))) (setq
call-process-region (quote org-babel-call-
process-region-original))))
(progn (let* ((lang (nth 0 info)) (params (if params
(org-babel-process-params (org-babel-merge-params (nth 2 info) params)) (nth 2
info))) (cache\? (and (not arg) (cdr (assoc :cache params)) (string= "yes" (cdr
(assoc :cache params))))) (result-params (cdr (assoc :result-params params)))
(new-hash (if cache\? (progn (org-babel-sha1-hash info)))) (old-hash (if
cache\? (progn (org-babel-current-result-hash)))) (body (let* ((c (nthcdr 1
info))) (setcar c (if (org-babel-noweb-p params :eval)
(org-babel-expand-noweb-references info) (nth 1 info))))) (dir (cdr (assoc :dir
params))) (default-directory (or (and dir (file-name-as-directory
(expand-file-name dir))) default-directory))
(org-babel-call-process-region-original (if (boundp (quote
org-babel-call-process-region-original)) org-babel-call-process-region-original
(symbol-function (quote call-process-region)))) (indent (car (last info)))
result cmd) (unwind-protect (let ((call-process-region (function (lambda ...
...)))) (let
((lang-check (function ...))) (setq cmd (or (funcall lang-check lang)
(funcall lang-check ...) (error "No org-babel-execute function for %s!"
lang)))) (if (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion
(goto-char (org-babel-where-is-src-block-result nil info)) (end-of-line 1)
(forward-char 1) (setq result (org-babel-read-result)) (message
(replace-regexp-in-string "%" "%%" ...)) result) (message "executing %s code
block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" ...) "")) (if
(member "none" result-params) (progn (funcall cmd body params) (message "result
silenced")) (setq result (... ...)) (if (cdr ...) (progn ... ...))
(org-babel-insert-result result result-params info new-hash indent lang)
(run-hooks (quote org-babel-after-execute-hook)) result))) (setq
call-process-region (quote org-babel-call-process-region-original)))))
(if (org-babel-confirm-evaluate (let ((i info)) (let* ((c (nthcdr 2 i)))
(setcar c (org-babel-merge-params (nth 2 info) params))) i)) (progn (let*
((lang (nth 0 info)) (params (if params (org-babel-process-params
(org-babel-merge-params ... params)) (nth 2 info))) (cache\? (and (not arg)
(cdr (assoc :cache params)) (string= "yes" (cdr ...)))) (result-params (cdr
(assoc :result-params params))) (new-hash (if cache\? (progn
(org-babel-sha1-hash info)))) (old-hash (if cache\? (progn
(org-babel-current-result-hash)))) (body (let* ((c ...)) (setcar c (if ... ...
...)))) (dir (cdr (assoc :dir params))) (default-directory (or (and dir
(file-name-as-directory ...)) default-directory))
(org-babel-call-process-region-original (if (boundp (quote
org-babel-call-process-region-original)) org-babel-call-process-region-original
(symbol-function (quote call-process-region)))) (indent (car (last info)))
result cmd) (unwind-protect (let ((call-process-region (function ...))) (let
((lang-chec
k ...)) (setq cmd (or ... ... ...))) (if (and (not arg) new-hash (equal
new-hash old-hash)) (save-excursion (goto-char ...) (end-of-line 1)
(forward-char 1) (setq result ...) (message ...) result) (message "executing %s
code block%s..." (capitalize lang) (if ... ... "")) (if (member "none"
result-params) (progn ... ...) (setq result ...) (if ... ...)
(org-babel-insert-result result result-params info new-hash indent lang)
(run-hooks ...) result))) (setq call-process-region (quote
org-babel-call-process-region-original))))))
(let ((info (or info (org-babel-get-src-block-info)))) (if
(org-babel-confirm-evaluate (let ((i info)) (let* ((c (nthcdr 2 i))) (setcar c
(org-babel-merge-params (nth 2 info) params))) i)) (progn (let* ((lang (nth 0
info)) (params (if params (org-babel-process-params ...) (nth 2 info)))
(cache\? (and (not arg) (cdr ...) (string= "yes" ...))) (result-params (cdr
(assoc :result-params params))) (new-hash (if cache\? (progn ...))) (old-hash
(if cache\? (progn ...))) (body (let* (...) (setcar c ...))) (dir (cdr (assoc
:dir params))) (default-directory (or (and dir ...) default-directory))
(org-babel-call-process-region-original (if (boundp ...)
org-babel-call-process-region-original (symbol-function ...))) (indent (car
(last info))) result cmd) (unwind-protect (let ((call-process-region ...)) (let
(...) (setq cmd ...)) (if (and ... new-hash ...) (save-excursion ... ... ...
... ... result) (message "executing %s code block%s..." ... ...) (if ... ...
... ... ... ... result))) (se
tq call-process-region (quote org-babel-call-process-region-original)))))))
org-babel-execute-src-block(nil ("python" "import socket\n\nprint
socket.gethostname()" ((:comments . "") (:shebang . "") (:cache . "no")
(:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "code") (:results
. "replace output verbatim") (:session . "none") (:hlines . "no") (:padnewline
. "yes") (:dir . "~/tmp") (:result-type . output) (:result-params "verbatim"
"output" "replace") (:rowname-names) (:colname-names)) "" nil 0))
(progn (org-babel-eval-wipe-error-buffer) (org-babel-execute-src-block
current-prefix-arg info) t)
(if info (progn (org-babel-eval-wipe-error-buffer)
(org-babel-execute-src-block current-prefix-arg info) t) nil)
(let ((info (org-babel-get-src-block-info))) (if info (progn
(org-babel-eval-wipe-error-buffer) (org-babel-execute-src-block
current-prefix-arg info) t) nil))
org-babel-execute-src-block-maybe()
(or (org-babel-execute-src-block-maybe) (org-babel-lob-execute-maybe))
org-babel-execute-maybe()
(if org-babel-no-eval-on-ctrl-c-ctrl-c nil (org-babel-execute-maybe))
org-babel-execute-safely-maybe()
run-hook-with-args-until-success(org-babel-execute-safely-maybe)
(cond ((or (and (boundp (quote org-clock-overlays)) org-clock-overlays)
org-occur-highlights org-latex-fragment-image-overlays) (and (boundp (quote
org-clock-overlays)) (org-clock-remove-overlays)) (org-remove-occur-highlights)
(org-remove-latex-fragment-image-overlays) (message "Temporary
highlights/overlays removed from current buffer")) ((and (local-variable-p
(quote org-finish-function) (current-buffer)) (fboundp org-finish-function))
(funcall org-finish-function)) ((run-hook-with-args-until-success (quote
org-ctrl-c-ctrl-c-hook))) ((org-in-regexp org-ts-regexp-both)
(org-timestamp-change 0 (quote day))) ((or (looking-at org-property-start-re)
(org-at-property-p)) (call-interactively (quote org-property-action)))
((org-at-target-p) (call-interactively (quote org-update-radio-target-regexp)))
((and (org-in-regexp "\\[\\([0-9]*%\\|[0-9]*/[0-9]*\\)\\]") (or
(org-at-heading-p) (org-at-item-p))) (call-interactively (quote
org-update-statistics-cookies))) ((org-at-heading-p)
(call-interactively (quote org-set-tags))) ((org-at-table\.el-p) (message "Use
C-c ' to edit table.el tables")) ((org-at-table-p)
(org-table-maybe-eval-formula) (if arg (call-interactively (quote
org-table-recalculate)) (org-table-maybe-recalculate-line)) (call-interactively
(quote org-table-align)) (orgtbl-send-table (quote maybe))) ((or
(org-footnote-at-reference-p) (org-footnote-at-definition-p))
(call-interactively (quote org-footnote-action))) ((org-at-item-checkbox-p)
(let* ((cbox (match-string 1)) (struct (org-list-struct)) (old-struct
(copy-tree struct)) (parents (org-list-parents-alist struct)) (orderedp
(org-entry-get nil "ORDERED")) (firstp (= (org-list-get-top-point struct)
(point-at-bol))) block-item) (let ((new-box (cond (... "[-]") (... nil) (... "[
]") (t "[X]")))) (if (and firstp arg) (mapc (function (lambda ... ...))
(org-list-get-all-items (point-at-bol) struct (org-list-prevs-alist struct)))
(org-list-set-checkbox (point-at-bol) struct new-box))) (org-lis
t-struct-fix-ind struct parents 2) (org-list-struct-fix-item-end struct) (let
((prevs (org-list-prevs-alist struct))) (org-list-struct-fix-bul struct prevs)
(org-list-struct-fix-ind struct parents) (setq block-item
(org-list-struct-fix-box struct parents prevs orderedp)))
(org-list-struct-apply-struct struct old-struct)
(org-update-checkbox-count-maybe) (if block-item (progn (message "Checkboxes
were removed due to unchecked box at line %d" (org-current-line block-item))))
(if firstp (progn (org-list-send-list (quote maybe)))))) ((org-at-item-p) (let*
((struct (org-list-struct)) (firstp (= (org-list-get-top-point struct)
(point-at-bol))) old-struct) (if arg (progn (setq old-struct (copy-tree
struct)) (if firstp (mapc (function ...) (org-list-get-all-items ... struct
...)) (org-list-set-checkbox (point-at-bol) struct "[ ]"))))
(org-list-write-struct struct (org-list-parents-alist struct) old-struct) (if
arg (progn (org-update-checkbox-count-maybe))) (if firstp (progn (org-lis
t-send-list (quote maybe)))))) ((save-excursion (beginning-of-line 1)
(looking-at org-dblock-start-re)) (beginning-of-line 1) (save-excursion
(org-update-dblock))) ((save-excursion (let ((case-fold-search t))
(beginning-of-line 1) (looking-at "[ ]*#\\+\\([a-z]+\\)"))) (cond ((or (equal
(match-string 1) "TBLFM") (equal (match-string 1) "tblfm")) (save-excursion
(beginning-of-line 1) (skip-chars-backward "
\n ") (if (org-at-table-p) (org-call-with-arg (quote
org-table-recalculate) (or arg t))))) (t (let
((org-inhibit-startup-visibility-stuff t) (org-startup-align-all-tables nil))
(if (boundp (quote org-table-coordinate-overlays)) (progn (mapc ...
org-table-coordinate-overlays) (setq org-table-coordinate-overlays nil))) (let
((--data ...) --rtn) (unwind-protect (progn ... ...) (if ... ...)) --rtn))
(message "Local setup has been refreshed")))) ((org-clock-update-time-maybe))
(t (or (run-hook-with-args-until-success (quote org-ctrl-c-ctrl-c-final-hook))
(error "C-c C-c can do
nothing useful at this location"))))
(let ((org-enable-table-editor t)) (cond ((or (and (boundp (quote
org-clock-overlays)) org-clock-overlays) org-occur-highlights
org-latex-fragment-image-overlays) (and (boundp (quote org-clock-overlays))
(org-clock-remove-overlays)) (org-remove-occur-highlights)
(org-remove-latex-fragment-image-overlays) (message "Temporary
highlights/overlays removed from current buffer")) ((and (local-variable-p
(quote org-finish-function) (current-buffer)) (fboundp org-finish-function))
(funcall org-finish-function)) ((run-hook-with-args-until-success (quote
org-ctrl-c-ctrl-c-hook))) ((org-in-regexp org-ts-regexp-both)
(org-timestamp-change 0 (quote day))) ((or (looking-at org-property-start-re)
(org-at-property-p)) (call-interactively (quote org-property-action)))
((org-at-target-p) (call-interactively (quote org-update-radio-target-regexp)))
((and (org-in-regexp "\\[\\([0-9]*%\\|[0-9]*/[0-9]*\\)\\]") (or
(org-at-heading-p) (org-at-item-p))) (call-interactively (quote
org-update-statist
ics-cookies))) ((org-at-heading-p) (call-interactively (quote org-set-tags)))
((org-at-table\.el-p) (message "Use C-c ' to edit table.el tables"))
((org-at-table-p) (org-table-maybe-eval-formula) (if arg (call-interactively
(quote org-table-recalculate)) (org-table-maybe-recalculate-line))
(call-interactively (quote org-table-align)) (orgtbl-send-table (quote maybe)))
((or (org-footnote-at-reference-p) (org-footnote-at-definition-p))
(call-interactively (quote org-footnote-action))) ((org-at-item-checkbox-p)
(let* ((cbox (match-string 1)) (struct (org-list-struct)) (old-struct
(copy-tree struct)) (parents (org-list-parents-alist struct)) (orderedp
(org-entry-get nil "ORDERED")) (firstp (= (org-list-get-top-point struct)
(point-at-bol))) block-item) (let ((new-box (cond ... ... ... ...))) (if (and
firstp arg) (mapc (function ...) (org-list-get-all-items ... struct ...))
(org-list-set-checkbox (point-at-bol) struct new-box)))
(org-list-struct-fix-ind struct parents 2) (org-lis
t-struct-fix-item-end struct) (let ((prevs (org-list-prevs-alist struct)))
(org-list-struct-fix-bul struct prevs) (org-list-struct-fix-ind struct parents)
(setq block-item (org-list-struct-fix-box struct parents prevs orderedp)))
(org-list-struct-apply-struct struct old-struct)
(org-update-checkbox-count-maybe) (if block-item (progn (message "Checkboxes
were removed due to unchecked box at line %d" (org-current-line block-item))))
(if firstp (progn (org-list-send-list (quote maybe)))))) ((org-at-item-p) (let*
((struct (org-list-struct)) (firstp (= (org-list-get-top-point struct)
(point-at-bol))) old-struct) (if arg (progn (setq old-struct (copy-tree
struct)) (if firstp (mapc ... ...) (org-list-set-checkbox ... struct "[ ]"))))
(org-list-write-struct struct (org-list-parents-alist struct) old-struct) (if
arg (progn (org-update-checkbox-count-maybe))) (if firstp (progn
(org-list-send-list (quote maybe)))))) ((save-excursion (beginning-of-line 1)
(looking-at org-dblock-start-re
)) (beginning-of-line 1) (save-excursion (org-update-dblock)))
((save-excursion (let ((case-fold-search t)) (beginning-of-line 1) (looking-at
"[ ]*#\\+\\([a-z]+\\)"))) (cond ((or (equal (match-string 1) "TBLFM")
(equal (match-string 1) "tblfm")) (save-excursion (beginning-of-line 1)
(skip-chars-backward "
\n ") (if (org-at-table-p) (org-call-with-arg ... ...)))) (t (let
((org-inhibit-startup-visibility-stuff t) (org-startup-align-all-tables nil))
(if (boundp ...) (progn ... ...)) (let (... --rtn) (unwind-protect ... ...)
--rtn)) (message "Local setup has been refreshed"))))
((org-clock-update-time-maybe)) (t (or (run-hook-with-args-until-success (quote
org-ctrl-c-ctrl-c-final-hook)) (error "C-c C-c can do nothing useful at this
location")))))
org-ctrl-c-ctrl-c(nil)
call-interactively(org-ctrl-c-ctrl-c nil nil)