From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Missing newline in R code causes Org-Mode eval to hang Date: Mon, 17 Oct 2011 14:30:10 -0600 Message-ID: <87pqhv2wfh.fsf@gmail.com> References: <1318881451.32666.YahooMailNeo@web161920.mail.bf1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:40465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFtpA-0002I6-2u for emacs-orgmode@gnu.org; Mon, 17 Oct 2011 16:30:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFtp7-0005Yo-VP for emacs-orgmode@gnu.org; Mon, 17 Oct 2011 16:30:15 -0400 Received: from mail-gx0-f169.google.com ([209.85.161.169]:41588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFtp7-0005Ye-OZ for emacs-orgmode@gnu.org; Mon, 17 Oct 2011 16:30:13 -0400 Received: by ggdk5 with SMTP id k5so4018308ggd.0 for ; Mon, 17 Oct 2011 13:30:13 -0700 (PDT) In-Reply-To: <1318881451.32666.YahooMailNeo@web161920.mail.bf1.yahoo.com> (Michael Hannon's message of "Mon, 17 Oct 2011 12:57:31 -0700 (PDT)") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Michael Hannon Cc: Org-Mode List Hi Michael, I can confirm this problem occurs on my machine locally. I believe the issue has something to do with how ESS sends inputs to R and waits for command prompts from R. When the lines are pasted into an ESS buffer one at a time the problem does not occur, however when the lines are pasted into ESS all at once (without pressing enter between lines) the ESS comint buffer hangs. One option could be to explicitly call `inferior-ess-send-input' between every line of R code, but I'm loath to touch the comint interface as small changes like this can sometimes have unpredictable effects. Perhaps this could be fixed on the ESS side? Best -- Eric Michael Hannon writes: > Greetings. =C2=A0The appended R code fragment executes without problem in > an ESS buffer, but it hangs indefinitely when I try to execute it > directly from the Org buffer via C-c C-c. > > The solution is to add the trailing newline in the "noteToSelf" > variable: > > =C2=A0 =C2=A0 noteToSelf <- "Buy low.\nSell high.\n" > > Obviously this isn't a big deal from my perspective, but it did > surprise me, and it does seem inconsistent. > > BTW, I've appended also the details of my own (linux) configuration, > but I tried the same thing on a different OS (Mac OS 10.6.8) and got > the same results. > > -- Mike > > ###### Org code that exhibits error > > #+BABEL: :session *R* :cache yes :results output verbatim :exports both := tangle yes > > * This is a test > > #+begin_src R > > x <- 42 > noteToSelf <- "Buy low.\nSell high." > cat(noteToSelf) > print("All done now") > > #+end_src > > > ###### My set-up > > Emacs =C2=A0: GNU Emacs 23.2.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.2= 4.4) > =C2=A0of 2011-05-23 on x86-12.phx2.fedoraproject.org > Package: Org-mode version 7.7 (release_7.7.328.g1a97) > > current state: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > (setq > =C2=A0org-export-latex-after-initial-vars-hook '(org-beamer-after-initial= -vars) > =C2=A0org-structure-template-alist '(("r" "#+begin_src R\n\n#+end_src" "<= src lang=3D\"R\">\n\n") > ("S" "#+BEGIN_SRC ?\n\n#+END_SRC" "\n\n") > ("s" "#+begin_src ?\n\n#+end_src" "\n\n") > ("e" "#+begin_example\n?\n#+end_example" "\n?\n") > ("q" "#+begin_quote\n?\n#+end_quote" "\n?\n") > ("v" "#+begin_verse\n?\n#+end_verse" "\n?\n/verse>") > ("c" "#+begin_center\n?\n#+end_center" "
\n?\n/center>") > ("l" "#+begin_latex\n?\n#+end_latex" "\n?\n") > ("L" "#+latex: " "?") > ("h" "#+begin_html\n?\n#+end_html" "\n?\n") > ("H" "#+html: " "?") ("a" "#+begin_as= cii\n?\n#+end_ascii") > ("A" "#+ascii: ") ("i" "#+index: ?" "#+index: ?") > ("I" "#+include %file ?" "")) > =C2=A0org-speed-command-hook '(org-speed-command-default-hook org-babel-s= peed-command-hook) > =C2=A0org-agenda-files '("~/Documents/scratch.org") > =C2=A0org-babel-load-languages '((emacs-lisp . t) (R . t) (python . t) (s= h . t) (latex . t) (C . t) (octave \.t)) > =C2=A0org-metaup-hook '(org-babel-load-in-session-maybe) > =C2=A0org-after-todo-state-change-hook '(org-clock-out-if-current) > =C2=A0org-babel-tangle-lang-exts '(("C++" . "cpp") ("latex" . "tex") ("py= thon" . "py") ("emacs-lisp" . "el")) > =C2=A0org-export-blocks-postblock-hook '(org-exp-res/src-name-cleanup) > =C2=A0org-export-latex-format-toc-function 'org-export-latex-format-toc-d= efault > =C2=A0org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab= -command-maybe org-babel-hide-result-toggle-maybe) > =C2=A0org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mod= e-configure-edit-buffer) > =C2=A0org-confirm-shell-link-function 'yes-or-no-p > =C2=A0org-export-first-hook '(org-beamer-initialize-open-trackers) > =C2=A0org-agenda-before-write-hook '(org-agenda-add-entry-text) > =C2=A0org-blank-before-new-entry nil > =C2=A0org-babel-pre-tangle-hook '(save-buffer) > =C2=A0org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-dr= awers org-cycle-show-empty-lines > =C2=A0org-optimize-window-after-visibility-change) > =C2=A0org-export-preprocess-before-normalizing-links-hook '(org-remove-fi= le-link-modifiers) > =C2=A0org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook cha= nge-major-mode-hook org-show-block-all append local] 5] > #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook or= g-babel-show-result-all append local] 5] > org-babel-result-hide-spec org-babel-hide-all-hashes) > =C2=A0org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-= safely-maybe) > =C2=A0org-confirm-elisp-link-function 'yes-or-no-p > =C2=A0org-export-interblocks '((lob org-babel-exp-lob-one-liners) (src or= g-babel-exp-inline-src-blocks)) > =C2=A0org-clock-out-hook '(org-clock-remove-empty-clock-drawer) > =C2=A0org-occur-hook '(org-first-headline-recenter) > =C2=A0org-from-is-user-regexp "\\" > =C2=A0org-export-preprocess-before-selecting-backend-code-hook '(org-beam= er-select-beamer-code) > =C2=A0org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate > =C2=A0org-export-latex-final-hook '(org-beamer-amend-header org-beamer-fi= x-toc org-beamer-auto-fragile-frames > =C2=A0 =C2=A0 =C2=A0 org-beamer-place-default-actions-for-lists) > =C2=A0org-metadown-hook '(org-babel-pop-to-session-maybe) > =C2=A0org-export-blocks '((src org-babel-exp-src-block nil) (comment org-= export-blocks-format-comment t) > =C2=A0 =C2=A0 (ditaa org-export-blocks-format-ditaa nil) (dot org-export-= blocks-format-dot nil)) > =C2=A0) > --=20 Eric Schulte http://cs.unm.edu/~eschulte/