From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: R code block produces only partial output Date: Wed, 6 Aug 2014 08:59:51 -0700 Message-ID: References: <87iom8zd24.fsf@gmail.com> <877g2oz9gv.fsf@gmail.com> <87tx5qwbai.fsf@gmail.com> Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-540623069-1407340791=:354" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF3dA-0005W9-7A for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 12:00:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF3d4-0000HW-90 for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 12:00:00 -0400 Received: from iport-acv2-out.ucsd.edu ([132.239.0.174]:62222) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF3d3-0000HM-Rb for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 11:59:54 -0400 In-Reply-To: <87tx5qwbai.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: Aaron Ecay Cc: Andreas Kiermeier , emacs-orgmode@gnu.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-540623069-1407340791=:354 Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Tue, 5 Aug 2014, Aaron Ecay wrote: > Hi Chuck, > > 2014ko abuztuak 5an, "Charles C. Berry"-ek idatzi zuen: > > [...] > >> >> >> Here is the docstring from ESS's inferior-S-prompt: >> >> inferior-S-prompt is a variable defined in `ess-custom.el'. >> Its value is "[]a-zA-Z0-9.[]*\\([>+.] \\)*> " [snip] >> >> ---- >> >> Note that there is a space *required* after the [>+.], but the hard coded >> regex in `org-babel-R-evaluate-session' lets the space be optional. >> >> I am guessing the a-zA-Z stuff is there to strip 'Browse[1]> ' prompts and >> such, which probably isn't an issue for babel. > > Why doesn’t org just use the value of inferior-S-prompt? (which would > then need to have the bit concatenated to the end that matches > e.g. [1]). Another way of putting this might be “does the space that > ESS requires ever turn up missing?” I don't really know why. Re the space, do the characters preceeding the [>+.] ever show up in Babel output? > >> >> Just before the defcustom for inferior-S-prompt, I see this comment >> in ess-custom.el: >> >> ;; need to recognise + + + > > > >> ;; and "+ . + " in tracebug prompt >> >> Ha! The '.' seems to be for ess-tracebug. I am guessing that nobody will >> need to output tracebug sessions from babel. So maybe it is safe to delete >> the "." after all - or at least require the space after it. > > Tracebug is on by default in ESS – C-h v ess-use-tracebug. Tracebug > even has babel support: see e.g. line 148 in ess.tracebug.el > . > When I said 'output tracebug sessions' I meant in the sense of using `:results output' to save the part of the session pertaining to tracebug in the *.org buffer, which seemed like an unusual use case. >> >> Maybe the regex should be put in a defcustom. > > Why? options(prompt="$ ") # for example Plus, if anything like the case that started this thread ever happens again it might be easier to figure out and offer workarounds for special cases that would be hazardous as a default setting. > The current mismatch between babel and ESS seems like a bug, but > once that’s fixed I don’t see the use case for configurability here. > (But maybe you have something in mind...) It looks like the babel regex was copied and intentionally modified for some reason --- suggesting the author knows something we do not, e.g. a case that would be broken by using `inferior-S-prompt'. I don't have a handle on all the issues in `comint-use-prompt-regexp' and all the `inferior-*-prompt' variables, but those are customizable. If the mismatch is a bug, why not use 'inferior-S-prompt' as the default and allow customization or at least use `(defvar org-babel-R-prompt inferior-S-prompt)'? HTH, Chuck --0-540623069-1407340791=:354--