emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Ken Williams <Ken.Williams@windlogics.com>
Cc: Rafael <rvf0068@gmail.com>,
	nicholas.dokos@hp.com,
	"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Hang on incomplete input
Date: Thu, 01 Dec 2011 13:18:53 -0500	[thread overview]
Message-ID: <6231.1322763533@alphaville.americas.hpqcorp.net> (raw)
In-Reply-To: Message from Ken Williams <Ken.Williams@windlogics.com> of "Thu, 01 Dec 2011 11:22:21 CST." <21A5E1E970CD46459ECBE86D6CC4B28C52E23C26@spexch01.WindLogics.local>

Ken Williams <Ken.Williams@windlogics.com> wrote:

> 
> 
> > -----Original Message-----
> > From: nick@dokosmarshall.org [mailto:nick@dokosmarshall.org] On Behalf
> > Of Nick Dokos
> > Sent: Thursday, December 01, 2011 9:21 AM
> >
> > Forgive my ignorance: how do I check the ESS version? And what does ESS
> > have to do with R? I thought this was an R code block, but as you can
> > probably tell, I'm an ignoRamus.
> 
> ESS is the mechanism by which org-mode interfaces with a running R process.
> 

Ok, thanks! I must have set it up at some point, but I had completely forgotten
about it. The README says it's 5.11.

> And I think I left out a crucial piece of information in my first message: =
> I run R in a session buffer, my full .org file looks like this:
> 
> ###################################
> #+TITLE: Test doc
> #+AUTHOR: Ken Williams
> #+BABEL: :session *Rt*
> 
> * My Header
> 
> Some code:
> 
> #+begin_src R
> ddply(x,
> #+end_src
> ###################################
> 
> With that change, is the hang reproducible?
> 

Yup - I did it twice and got the backtrace at the bottom of this mail
both times.  One funky thing is that it only happens every second C-c C-c
for me.

Note also that #+BABEL: is obsolete for versions of org more recent than
Oct. 20 or so. You seem to still be running 7.7 from late July or early
August, so you should still be OK, but when you next upgrade, you will
need to make changes to your files. I had to change it to #+PROPERTIES:
...  for my org version.

A good starting point on this change  is Eric Schulte's message entitled

  "Standardized code block syntax and Property Accumulation merged into Master"

Nick


> 
> > If that does not bear fruit, you can M-x toggle-debug-on-quit, run the co=
> de
> > block and press C-g to get a backtrace. Rinse, repeat to see whether you
> > always stop at the same point. It's somewhat hit-or-miss but it can be
> > effective sometimes.
> 
> I could *SWEAR* I had tried C-g to abort the running R command (and C-c C-c=
> , and C-c C-g, and about a dozen other things), but couldn't get it to reac=
> t.  Now it aborts as desired.  I must have not actually tried a simple C-g.=
>   I can never remember which keys abort which aspect of operation.
> 
> When I'm armed with that C-g, the hang is a much smaller issue!
> 
>  -Ken
> 
> 
> CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the inte=
> nded recipient(s) and may contain confidential and privileged information. =
> Any unauthorized review, use, disclosure or distribution of any kind is str=
> ictly prohibited. If you are not the intended recipient, please contact the=
>  sender via reply e-mail and destroy all copies of the original message. Th=
> ank you.
> 

Backtrace:

Debugger entered--Lisp error: (quit)
  file-exists-p("/tmp/babel-5986bN8/R-5986N_O")
  (not (file-exists-p file))
  (while (not (file-exists-p file)) (sit-for (or period 0.25)))
  org-babel-comint-eval-invisibly-and-wait-for-file("*Rt*" "/tmp/babel-5986bN8/R-5986N_O" "{function(object,transfer.file){object;invisible(if(inherits(try({tfile<-tempfile();write.table(object,file=tfile,sep=\"\\t\",na=\"nil\",row.names=FALSE,col.names=FALSE,quote=FALSE);file.rename(tfile,transfer.file)},silent=TRUE),\"try-error\")){if(!file.exists(transfer.file))file.create(transfer.file)})}}(object=.Last.value,transfer.file=\"/tmp/babel-5986bN8/R-5986N_O\")")
  (let ((tmp-file (org-babel-temp-file "R-"))) (org-babel-comint-eval-invisibly-and-wait-for-file session tmp-file (format org-babel-R-write-object-command (if row-names-p "TRUE" "FALSE") (if column-names-p (if row-names-p "NA" "TRUE") "FALSE") ".Last.value" (org-babel-process-file-name tmp-file (quote noquote)))) (org-babel-R-process-value-result (org-babel-import-elisp-from-file tmp-file (quote (16))) column-names-p))
  (cond ((eql result-type (quote value)) (with-temp-buffer (insert (org-babel-chomp body)) (let ((ess-local-process-name (process-name (get-buffer-process session)))) (ess-eval-buffer nil))) (let ((tmp-file (org-babel-temp-file "R-"))) (org-babel-comint-eval-invisibly-and-wait-for-file session tmp-file (format org-babel-R-write-object-command (if row-names-p "TRUE" "FALSE") (if column-names-p (if row-names-p "NA" "TRUE") "FALSE") ".Last.value" (org-babel-process-file-name tmp-file (quote noquote)))) (org-babel-R-process-value-result (org-babel-import-elisp-from-file tmp-file (quote (16))) column-names-p))) ((eql result-type (quote output)) (mapconcat (function org-babel-chomp) (butlast (delq nil (mapcar (lambda (line) (when ... line)) (mapcar (lambda ... ...) (org-babel-comint-with-output 
 ... ... ...))))) "\n")))
  (case result-type (value (with-temp-buffer (insert (org-babel-chomp body)) (let ((ess-local-process-name (process-name (get-buffer-process session)))) (ess-eval-buffer nil))) (let ((tmp-file (org-babel-temp-file "R-"))) (org-babel-comint-eval-invisibly-and-wait-for-file session tmp-file (format org-babel-R-write-object-command (if row-names-p "TRUE" "FALSE") (if column-names-p (if row-names-p "NA" "TRUE") "FALSE") ".Last.value" (org-babel-process-file-name tmp-file (quote noquote)))) (org-babel-R-process-value-result (org-babel-import-elisp-from-file tmp-file (quote (16))) column-names-p))) (output (mapconcat (function org-babel-chomp) (butlast (delq nil (mapcar (lambda (line) (when ... line)) (mapcar (lambda ... ...) (org-babel-comint-with-output ... ... ...))))) "\n")))
  org-babel-R-evaluate-session("*Rt*" "ddply(x," value nil nil)
  (if session (org-babel-R-evaluate-session session body result-type column-names-p row-names-p) (org-babel-R-evaluate-external-process body result-type column-names-p row-names-p))
  org-babel-R-evaluate("*Rt*" "ddply(x," value nil nil)
  (let* ((result-type (cdr (assoc :result-type params))) (session (org-babel-R-initiate-session (cdr (assoc :session params)) params)) (colnames-p (cdr (assoc :colnames params))) (rownames-p (cdr (assoc :rownames params))) (graphics-file (org-babel-R-graphical-output-file params)) (full-body (org-babel-expand-body:R body params graphics-file)) (result (org-babel-R-evaluate session full-body result-type (or (equal "yes" colnames-p) (org-babel-pick-name (cdr (assoc :colname-names params)) colnames-p)) (or (equal "yes" rownames-p) (org-babel-pick-name (cdr (assoc :rowname-names params)) rownames-p))))) (if graphics-file nil result))
  (save-excursion (let* ((result-type (cdr (assoc :result-type params))) (session (org-babel-R-initiate-session (cdr (assoc :session params)) params)) (colnames-p (cdr (assoc :colnames params))) (rownames-p (cdr (assoc :rownames params))) (graphics-file (org-babel-R-graphical-output-file params)) (full-body (org-babel-expand-body:R body params graphics-file)) (result (org-babel-R-evaluate session full-body result-type (or (equal "yes" colnames-p) (org-babel-pick-name (cdr ...) colnames-p)) (or (equal "yes" rownames-p) (org-babel-pick-name (cdr ...) rownames-p))))) (if graphics-file nil result)))
  org-babel-execute:R("ddply(x," ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "") (:exports . "code") (:results . "replace") (:session . "*Rt*") (:padnewline . "yes") (:hlines . "no")))
  funcall(org-babel-execute:R "ddply(x," ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "") (:exports . "code") (:results . "replace") (:session . "*Rt*") (:padnewline . "yes") (:hlines . "no")))
  ((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 (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)) "")) (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))) (when (cdr (assoc :file params)) (when result (with-temp-file (cdr (assoc :file params)) (insert (org-babel-format-result result (cdr (assoc :sep ...)))))) (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)
  (progn (fset (quote call-process-region) (function* (lambda (&rest args) (block call-process-region (apply (quote org-babel-tramp-handle-call-process-region) args))))) (flet ((lang-check (f) (let ((f (intern ...))) (when (fboundp f) f)))) (setq cmd (or (lang-check lang) (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)) "")) (setq result ((lambd
 a (result) (if (and (eq ... ...) (or ... ...) (not ...)) (list (list result)) result)) (funcall cmd body params))) (when (cdr (assoc :file params)) (when result (with-temp-file (cdr (assoc :
 file params)) (insert (org-babel-format-result result (cdr ...))))) (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 (progn (fset (quote call-process-region) (function* (lambda (&rest args) (block call-process-region (apply (quote org-babel-tramp-handle-call-process-region) args))))) (flet ((lang-check (f) (let ((f ...)) (when (fboundp f) f)))) (setq cmd (or (lang-check lang) (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)) "")) (setq result ((lambda (result) (if (and .
 .. ... ...) (list ...) result)) (funcall cmd body params))) (when (cdr (assoc :file params)) (when result (with-temp-file (cdr (assoc :file params)) (insert (org-babel-format-result result .
 ..)))) (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 --cl-letf-bound-- (fset (quote call-process-region) --cl-letf-save--) (fmakunbound (quote call-process-region))))
  (let* ((--cl-letf-bound-- (fboundp (quote call-process-region))) (--cl-letf-save-- (and --cl-letf-bound-- (symbol-function (quote call-process-region))))) (unwind-protect (progn (fset (quote call-process-region) (function* (lambda (&rest args) (block call-process-region (apply ... args))))) (flet ((lang-check (f) (let (...) (when ... f)))) (setq cmd (or (lang-check lang) (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)) "")) (setq result ((lambda (result) (if ... ... result)) (funcall cmd body params))) (when (cdr (assoc :file params)) (when result (with-temp-file
  (cdr ...) (insert ...))) (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 --cl-letf-bound-- (fset (quote call-process-region) --cl-letf-save--) (fmakunbound (quote call-process-region)))))
  (letf (((symbol-function (quote call-process-region)) (function* (lambda (&rest args) (block call-process-region (apply (quote org-babel-tramp-handle-call-process-region) args)))))) (flet ((lang-check (f) (let ((f (intern ...))) (when (fboundp f) f)))) (setq cmd (or (lang-check lang) (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)) "")) (setq 
 result ((lambda (result) (if (and (eq ... ...) (or ... ...) (not ...)) (list (list result)) result)) (funcall cmd body params))) (when (cdr (assoc :file params)) (when result (with-temp-file
  (cdr (assoc :file params)) (insert (org-babel-format-result result (cdr ...))))) (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))
  (letf* (((symbol-function (quote call-process-region)) (function* (lambda (&rest args) (block call-process-region (apply (quote org-babel-tramp-handle-call-process-region) args)))))) (flet ((lang-check (f) (let ((f (intern ...))) (when (fboundp f) f)))) (setq cmd (or (lang-check lang) (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)) "")) (setq
  result ((lambda (result) (if (and (eq ... ...) (or ... ...) (not ...)) (list (list result)) result)) (funcall cmd body params))) (when (cdr (assoc :file params)) (when result (with-temp-fil
 e (cdr (assoc :file params)) (insert (org-babel-format-result result (cdr ...))))) (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))
  (flet ((call-process-region (&rest args) (apply (quote org-babel-tramp-handle-call-process-region) args))) (flet ((lang-check (f) (let ((f (intern ...))) (when (fboundp f) f)))) (setq cmd (or (lang-check lang) (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)) "")) (setq result ((lambda (result) (if (and (eq ... ...) (or ... ...) (not ...)) (lis
 t (list result)) result)) (funcall cmd body params))) (when (cdr (assoc :file params)) (when result (with-temp-file (cdr (assoc :file params)) (insert (org-babel-format-result result (cdr ..
 .))))) (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 (flet ((call-process-region (&rest args) (apply (quote org-babel-tramp-handle-call-process-region) args))) (flet ((lang-check (f) (let ((f ...)) (when (fboundp f) f)))) (setq cmd (or (lang-check lang) (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)) "")) (setq result ((lambda (result) (if (and ... ... ...) (list ...) result)) (funcall cmd body params))) (
 when (cdr (assoc :file params)) (when result (with-temp-file (cdr (assoc :file params)) (insert (org-babel-format-result result ...)))) (setq result (cdr (assoc :file params)))) (org-babel-i
 nsert-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 (when cache\? (org-babel-sha1-hash info))) (old-hash (when cache\? (org-babel-current-result-hash))) (body (setf (nth 1 info) (let ((noweb (cdr ...))) (if (and noweb (or ... ...)) (org-babel-expand-noweb-references info) (nth 1 info))))) (dir (cdr (assoc :dir params))) (default-directory (or (and dir (file-name-as-directory 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-functi
 on (quote call-process-region)))) (indent (car (last info))) result cmd) (unwind-protect (flet ((call-process-region (&rest args) (apply (quote org-babel-tramp-handle-call-process-region) ar
 gs))) (flet ((lang-check (f) (let (...) (when ... f)))) (setq cmd (or (lang-check lang) (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)) "")) (setq result ((lambda (result) (if ... ... result)) (funcall cmd body params))) (when (cdr (assoc :file params)) (when result (with-temp-file (cdr ...) (insert ...))) (setq result (cdr (assoc :file params)))) (org-babel-insert-result resu
 lt 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 (when cache\? (org-babel-sha1-hash info))) (old-hash (when cache\? (org-babel-current-result-hash))) (body (setf (nth 1 info) (let ((noweb ...)) (if (and noweb ...) (org-babel-expand-noweb-references info) (nth 1 info))))) (dir (cdr (assoc :dir params))) (default-directory (or (and dir (file-name-as-directory 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 (quot
 e call-process-region)))) (indent (car (last info))) result cmd) (unwind-protect (flet ((call-process-region (&rest args) (apply (quote org-babel-tramp-handle-call-process-region) args))) (f
 let ((lang-check (f) (let ... ...))) (setq cmd (or (lang-check lang) (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)" ...) "")) (setq result ((lambda ... ...) (funcall cmd body params))) (when (cdr (assoc :file params)) (when result (with-temp-file ... ...)) (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)))))
  (if (org-babel-confirm-evaluate info) (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 (when cache\? (org-babel-sha1-hash info))) (old-hash (when cache\? (org-babel-current-result-hash))) (body (setf (nth 1 info) (let (...) (if ... ... ...)))) (dir (cdr (assoc :dir params))) (default-directory (or (and dir (file-name-as-directory 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))) re
 sult cmd) (unwind-protect (flet ((call-process-region (&rest args) (apply ... args))) (flet ((lang-check ... ...)) (setq cmd (or ... ... ...))) (if (and (not arg) new-hash (equal new-hash ol
 d-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 ... ... "")) (setq result (... ...)) (when (cdr ...) (when 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))))))
  (when (org-babel-confirm-evaluate info) (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 (when cache\? (org-babel-sha1-hash info))) (old-hash (when cache\? (org-babel-current-result-hash))) (body (setf (nth 1 info) (let ((noweb ...)) (if (and noweb ...) (org-babel-expand-noweb-references info) (nth 1 info))))) (dir (cdr (assoc :dir params))) (default-directory (or (and dir (file-name-as-directory dir)) default-directory)) (org-babel-call-process-region-original (if (boundp (quote org-babel-call-process-region-original)) org-babel-call-process-regio
 n-original (symbol-function (quote call-process-region)))) (indent (car (last info))) result cmd) (unwind-protect (flet ((call-process-region (&rest args) (apply (quote org-babel-tramp-handl
 e-call-process-region) args))) (flet ((lang-check (f) (let ... ...))) (setq cmd (or (lang-check lang) (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)" ...) "")) (setq result ((lambda ... ...) (funcall cmd body params))) (when (cdr (assoc :file params)) (when result (with-temp-file ... ...)) (setq result (cdr ...))) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks (quote org-babel-after-e
 xecute-hook)) result)) (setq call-process-region (quote org-babel-call-process-region-original)))))
  (let ((info (or info (org-babel-get-src-block-info)))) (when (org-babel-confirm-evaluate info) (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 (when cache\? (org-babel-sha1-hash info))) (old-hash (when cache\? (org-babel-current-result-hash))) (body (setf (nth 1 info) (let (...) (if ... ... ...)))) (dir (cdr (assoc :dir params))) (default-directory (or (and dir (file-name-as-directory 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 cal
 l-process-region)))) (indent (car (last info))) result cmd) (unwind-protect (flet ((call-process-region (&rest args) (apply ... args))) (flet ((lang-check ... ...)) (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 ... ... "")) (setq result (... ...)) (when (cdr ...) (when 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))))))
  org-babel-execute-src-block(nil ("R" "ddply(x," ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "") (:exports . "code") (:results . "replace") (:session . "*Rt*") (:padnewline . "yes") (:hlines . "no")) "" 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))
  (unless org-babel-no-eval-on-ctrl-c-ctrl-c (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))) ((or (looking-at org-property-start-re) (org-at-property-p)) (call-interactively (quote org-property-action))) ((org-on-target-p) (call-interactively (quote org-update-radio-target-regexp))) ((and (org-in-regexp "\\[\\([0-9]*%\\|[0-9]*/[0-9]*\\)\\]") (or (
 org-on-heading-p) (org-at-item-p))) (call-interactively (quote org-update-statistics-cookies))) ((org-on-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)) (prevs (org-list-prevs-alist struct)) (orderedp (org-entry-get nil "ORDERED")) (firstp (= (org-list-get-top-point struct) (point-at-bol))) block-item) (org-list-set-checkbox (point-at-bol) struct (cond ((equal arg (quote ...)) "[-]") ((equal arg (quote ...)) nil
 ) ((equal "[X]" cbox) "[ ]") (t "[X]"))) (org-list-struct-fix-ind struct parents) (org-list-struct-fix-bul struct prevs) (setq block-item (org-list-struct-fix-box struct parents prevs ordere
 dp)) (when block-item (message "Checkboxes were removed due to unchecked box at line %d" (org-current-line block-item))) (org-list-struct-apply-struct struct old-struct) (org-update-checkbox-count-maybe) (when firstp (org-list-send-list (quote maybe))))) ((org-at-item-p) (let* ((struct (org-list-struct)) (old-struct (copy-tree struct)) (parents (org-list-parents-alist struct)) (prevs (org-list-prevs-alist struct)) (firstp (= (org-list-get-top-point struct) (point-at-bol)))) (org-list-struct-fix-ind struct parents) (org-list-struct-fix-bul struct prevs) (when arg (org-list-set-checkbox (point-at-bol) struct "[ ]") (org-list-struct-fix-box struct parents prevs)) (org-list-struct-apply-struct struct old-struct) (when arg (org-update-checkbox-count-maybe)) (when firstp (org-list-send-list (qu
 ote maybe))))) ((save-excursion (beginning-of-line 1) (looking-at org-dblock-start-re)) (beginning-of-line 1) (save-excursion (org-update-dblock))) ((save-excursion (beginning-of-line 1) (lo
 oking-at "[ 	]*#\\+\\([A-Z]+\\)")) (cond ((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)) (org-save-outline-visibility (quote use-markers) (org-mode-restart))) (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))) ((or (looking-at org-property-start-re) (org-at-property-p)) (call-interactively (quote org-property-action))) ((org-on-target-p) (call-interactively (quote org-update-radio-target-regexp))) ((and (org-in-regexp "\\[\\([0
 -9]*%\\|[0-9]*/[0-9]*\\)\\]") (or (org-on-heading-p) (org-at-item-p))) (call-interactively (quote org-update-statistics-cookies))) ((org-on-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)) (prevs (org-list-prevs-alist struct)) (orderedp (org-entry-get nil "ORDERED")) (firstp (= (org-list-get-top-point struct) (point-at-bol))) block-item) (org-list-set-checkbox (point-at-bol) struct (cond ((equal arg ...) "[-]") (
 (equal arg ...) nil) ((equal "[X]" cbox) "[ ]") (t "[X]"))) (org-list-struct-fix-ind struct parents) (org-list-struct-fix-bul struct prevs) (setq block-item (org-list-struct-fix-box struct p
 arents prevs orderedp)) (when block-item (message "Checkboxes were removed due to unchecked box at line %d" (org-current-line block-item))) (org-list-struct-apply-struct struct old-struct) (org-update-checkbox-count-maybe) (when firstp (org-list-send-list (quote maybe))))) ((org-at-item-p) (let* ((struct (org-list-struct)) (old-struct (copy-tree struct)) (parents (org-list-parents-alist struct)) (prevs (org-list-prevs-alist struct)) (firstp (= (org-list-get-top-point struct) (point-at-bol)))) (org-list-struct-fix-ind struct parents) (org-list-struct-fix-bul struct prevs) (when arg (org-list-set-checkbox (point-at-bol) struct "[ ]") (org-list-struct-fix-box struct parents prevs)) (org-list-struct-apply-struct struct old-struct) (when arg (org-update-checkbox-count-maybe)) (when firstp (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 (begin
 ning-of-line 1) (looking-at "[ 	]*#\\+\\([A-Z]+\\)")) (cond ((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)) (org-save-outline-visibility (quote use-markers) (org-mode-restart))) (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)

  reply	other threads:[~2011-12-01 18:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-30 22:41 Hang on incomplete input Ken Williams
2011-11-30 23:12 ` Rafael
2011-12-01 15:04   ` Ken Williams
2011-12-01 15:21     ` Nick Dokos
2011-12-01 17:22       ` Ken Williams
2011-12-01 18:18         ` Nick Dokos [this message]
2011-12-01 19:03           ` Ken Williams
2011-12-01 19:41             ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6231.1322763533@alphaville.americas.hpqcorp.net \
    --to=nicholas.dokos@hp.com \
    --cc=Ken.Williams@windlogics.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rvf0068@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).