From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Hannon Subject: Re: Missing newline in R code causes Org-Mode eval to hang Date: Tue, 18 Oct 2011 09:03:01 -0700 (PDT) Message-ID: <1318953781.31433.YahooMailNeo@web161916.mail.bf1.yahoo.com> References: <1318881451.32666.YahooMailNeo@web161920.mail.bf1.yahoo.com> <87pqhv2wfh.fsf@gmail.com> Reply-To: Michael Hannon Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:34922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGC8B-0001k9-GY for emacs-orgmode@gnu.org; Tue, 18 Oct 2011 12:03:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGC86-0007pr-Aw for emacs-orgmode@gnu.org; Tue, 18 Oct 2011 12:03:07 -0400 Received: from nm27-vm0.bullet.mail.bf1.yahoo.com ([98.139.213.139]:44411) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RGC85-0007pU-UY for emacs-orgmode@gnu.org; Tue, 18 Oct 2011 12:03:02 -0400 In-Reply-To: <87pqhv2wfh.fsf@gmail.com> 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: Eric Schulte Cc: Org-Mode List Thanks, Eric (and Seb and Nick). =A0FYI, I've passed this issue to the ESS = help list.=0A=0A-- Mike=0A=0A=0A----- Original Message -----=0A> From: Eric= Schulte =0A> To: Michael Hannon =0A> Cc: Org-Mode List =0A> Sent: Monday, October= 17, 2011 1:30 PM=0A> Subject: Re: [O] Missing newline in R code causes Org= -Mode eval to hang=0A> =0A> Hi Michael,=0A> =0A> I can confirm this problem= occurs on my machine locally.=A0 I believe the=0A> issue has something to = do with how ESS sends inputs to R and waits for=0A> command prompts from R.= =A0 When the lines are pasted into an ESS buffer=0A> one at a time the prob= lem does not occur, however when the lines are=0A> pasted into ESS all at o= nce (without pressing enter between lines) the=0A> ESS comint buffer hangs.= =0A> =0A> One option could be to explicitly call `inferior-ess-send-input' = between=0A> every line of R code, but I'm loath to touch the comint interfa= ce as=0A> small changes like this can sometimes have unpredictable effects.= =0A> =0A> Perhaps this could be fixed on the ESS side?=0A> =0A> Best -- Eri= c=0A> =0A> Michael Hannon writes:=0A> =0A>> Greeting= s. =A0The appended R code fragment executes without problem in=0A>> an ESS= buffer, but it hangs indefinitely when I try to execute it=0A>> directly = from the Org buffer via C-c C-c.=0A>> =0A>> The solution is to add the tra= iling newline in the "noteToSelf"=0A>> variable:=0A>> =0A>> =A0 =A0 noteT= oSelf <- "Buy low.\nSell high.\n"=0A>> =0A>> Obviously this isn't a big de= al from my perspective, but it did=0A>> surprise me, and it does seem inco= nsistent.=0A>> =0A>> BTW, I've appended also the details of my own (linux)= configuration,=0A>> but I tried the same thing on a different OS (Mac OS = 10.6.8) and got=0A>> the same results.=0A>> =0A>> -- Mike=0A>> =0A>> ###= ### Org code that exhibits error=0A>> =0A>> #+BABEL: :session *R* :cache y= es :results output verbatim :exports both =0A> :tangle yes=0A>> =0A>> * Th= is is a test=0A>> =0A>> #+begin_src R=0A>> =0A>> =A0 x <- 42=0A>> =A0 note= ToSelf <- "Buy low.\nSell high."=0A>> =A0 cat(noteToSelf)=0A>> =A0 print("A= ll done now")=0A>> =0A>> #+end_src=0A>> =0A>> =0A>> ###### My set-up=0A>>= =0A>> Emacs =A0: GNU Emacs 23.2.1 (x86_64-redhat-linux-gnu, GTK+ Version = 2.24.4)=0A>> =A0of 2011-05-23 on x86-12.phx2.fedoraproject.org=0A>> Packa= ge: Org-mode version 7.7 (release_7.7.328.g1a97)=0A>> =0A>> current state:= =0A>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A>> (setq=0A>> =A0org-= export-latex-after-initial-vars-hook =0A> '(org-beamer-after-initial-vars)= =0A>> =A0org-structure-template-alist '(("r" "#+begin_src =0A> R\n\n#+end_= src" " lang=3D\"R\">\n\n")=0A>> ("S" "#+BEGIN_SRC ?\n\n#+EN= D_SRC" " lang=3D\"?\">\n\n")=0A>> ("s" "#+begin_src ?\n\n#+= end_src" " lang=3D\"?\">\n\n")=0A>> ("e" "#+begin_example\n= ?\n#+end_example" =0A> "\n?\n")=0A>> ("q" "#+begin_quot= e\n?\n#+end_quote" =0A> "\n?\n")=0A>> ("v" "#+begin_verse\n= ?\n#+end_verse" =0A> "\n?\n/verse>")=0A>> ("c" "#+begin_center\n?\n= #+end_center" =0A> "
\n?\n/center>")=0A>> ("l" "#+begin_latex\n?\n#= +end_latex" =0A> " style=3D\"latex\">\n?\n")=0A>> (= "L" "#+latex: " " style=3D\"latex\">?")=0A>> ("h" "= #+begin_html\n?\n#+end_html" =0A> " style=3D\"html\">\n?\n")=0A>> ("H" "#+html: " " style=3D\"html\">?"= ) ("a" =0A> "#+begin_ascii\n?\n#+end_ascii")=0A>> ("A" "#+ascii: ") ("i" "= #+index: ?" =0A> "#+index: ?")=0A>> ("I" "#+include %file ?" " markup=3D\"?\">"))=0A>> =A0org-speed-command-hook '(org-spe= ed-command-default-hook =0A> org-babel-speed-command-hook)=0A>> =A0org-age= nda-files '("~/Documents/scratch.org")=0A>> =A0org-babel-load-languages '(= (emacs-lisp . t) (R . t) (python . t) (sh . =0A> t) (latex . t) (C . t) (oc= tave \.t))=0A>> =A0org-metaup-hook '(org-babel-load-in-session-maybe)=0A>>= =A0org-after-todo-state-change-hook '(org-clock-out-if-current)=0A>> =A0= org-babel-tangle-lang-exts '(("C++" . "cpp") =0A> ("latex" . "tex") ("pytho= n" . "py") =0A> ("emacs-lisp" . "el"))=0A>> =A0org-export-blocks-postblock= -hook '(org-exp-res/src-name-cleanup)=0A>> =A0org-export-latex-format-toc-= function =0A> 'org-export-latex-format-toc-default=0A>> =A0org-tab-first-h= ook '(org-hide-block-toggle-maybe =0A> org-src-native-tab-command-maybe org= -babel-hide-result-toggle-maybe)=0A>> =A0org-src-mode-hook '(org-src-babel= -configure-edit-buffer =0A> org-src-mode-configure-edit-buffer)=0A>> =A0or= g-confirm-shell-link-function 'yes-or-no-p=0A>> =A0org-export-first-hook '= (org-beamer-initialize-open-trackers)=0A>> =A0org-agenda-before-write-hook= '(org-agenda-add-entry-text)=0A>> =A0org-blank-before-new-entry nil=0A>> = =A0org-babel-pre-tangle-hook '(save-buffer)=0A>> =A0org-cycle-hook '(org-= cycle-hide-archived-subtrees =0A> org-cycle-hide-drawers org-cycle-show-emp= ty-lines=0A>> =A0org-optimize-window-after-visibility-change)=0A>> =A0org= -export-preprocess-before-normalizing-links-hook =0A> '(org-remove-file-lin= k-modifiers)=0A>> =A0org-mode-hook '(#[nil =0A> "\300\301\302\303\304$\207= " [org-add-hook =0A> change-major-mode-hook org-show-block-all append local= ] 5]=0A>> #[nil "\300\301\302\303\304$\207" =0A> [org-add-hook change-majo= r-mode-hook org-babel-show-result-all append local] 5]=0A>> org-babel-resu= lt-hide-spec org-babel-hide-all-hashes)=0A>> =A0org-ctrl-c-ctrl-c-hook '(o= rg-babel-hash-at-point =0A> org-babel-execute-safely-maybe)=0A>> =A0org-co= nfirm-elisp-link-function 'yes-or-no-p=0A>> =A0org-export-interblocks '((l= ob org-babel-exp-lob-one-liners) (src =0A> org-babel-exp-inline-src-blocks)= )=0A>> =A0org-clock-out-hook '(org-clock-remove-empty-clock-drawer)=0A>> = =A0org-occur-hook '(org-first-headline-recenter)=0A>> =A0org-from-is-user-= regexp "\\ Hannon\\>"=0A>> =A0org-export-preprocess-before-se= lecting-backend-code-hook =0A> '(org-beamer-select-beamer-code)=0A>> =A0or= g-confirm-babel-evaluate 'my-org-confirm-babel-evaluate=0A>> =A0org-export= -latex-final-hook '(org-beamer-amend-header =0A> org-beamer-fix-toc org-bea= mer-auto-fragile-frames=0A>> =A0 =A0 =A0 org-beamer-place-default-actions-= for-lists)=0A>> =A0org-metadown-hook '(org-babel-pop-to-session-maybe)=0A>= > =A0org-export-blocks '((src org-babel-exp-src-block nil) (comment =0A> o= rg-export-blocks-format-comment t)=0A>> =A0 =A0 (ditaa org-export-blocks-f= ormat-ditaa nil) (dot =0A> org-export-blocks-format-dot nil))=0A>> =A0)=0A= >> =0A> =0A> -- =0A> Eric Schulte=0A> http://cs.unm.edu/~eschulte/=0A>