[ESS] ess eval invisibly only for large blocks

Thomas Alexander Gerds tag at biostat.ku.dk
Thu Mar 17 17:26:24 CET 2011


Dear Rodney and Vitalie

thanks for all your replies. I finally switched from Xemacs to emacs-23
after being addicted to Xemacs the last 15 years!!! but, there are
several things Xemacs cannot do properly today, bibsnarf.el,
mediawiki.el, utf-8, etc. and now also ess-tracebug ... I was most
afraid that my gnus mail/news reader would not like to move, but that
was no big deal.

so, today ess-tracebug has almost solved my problem. the thing is that
when evaluating a longer R-function which includes many of folds

,----
| ...
| # }}}
| # {{{  confidence intervals
| ...
`----

then R shows this:

,----
| + ... ++ ... ++ ... ++ ... ++ ... ++ ... ++ ... ++ ... ++ ... ++ ... ++ ... ++ ... ++ ... ++ ... ++ ... ++ ... ++ + + + + + + ... ++ + + + + + + + + + + + + + + + ... ++ + + + + + ... ++ + + + + + + + + + + + + + + + + + + + + + + + + + ... +> 
`----

is it possible to tell ess-tracebug to treat the whole function
(evaluated via ess-eval-function-and-go) as one block?

Best Thomas







Vitalie Spinu <spinuvit.list at gmail.com> writes:

> Rodney Sparapani <rsparapa at mcw.edu> writes:
>
>>> Hi Rodney,
>>>
>>> The replacement string is a user variable "ess-long+replace" which
> by
>>> default is "+ ... + ". Only long + + + prompts (more than 3 +s) are
> replaced.
>>>
>>> This behavior is controlled by inferior-ess-replace-long+ (by
> default
>>> t), so instead of a very long prompt you should see something like:
>>>
>>>> + ... +
>>>>> + ... +>
>>>> + ... +
>>>>> + ... +>
>>>> + ... +>
>>> unless you are using  an older version of ess-tracebug.
>>>
>>> Thanks for looking into it on XEmacs. I was planning to do it
> myself some
>>> day, but it was quite a low priority because of a feeling that
> there are not
>>> so many ESS users on XEmacs platform.
>>>
>>>> To make it work for XEmacs, you need the following at the top:
>>>> ;(require 'face-remap nil t) ;; desirable for scaling of the text
> in ...
>>>> ;(require 'ido nil t) ;; desirable for debug/undebug at point
> function
>>> Face-remap and ido are optional as the third argument t
> indicates. But it
>>> seems that XEmacs' 'require' does not have the third "no-error"
>>> argument.
>>>
>>> What would be an application independent way of dealing with the
> above
>>> 'requires'?
>>>
>> (if (featurep 'xemacs) nil (require 'face-remap nil t)
>>>> (require 'cl) ;; a couple of useful functions
>>>> (require 'overlay)
>>>>
>>> Thanks, added this to the code.
>>>
>>>> (if (boundp 'overlay-arrow-variable-list) nil
>>>>    (defvar overlay-arrow-variable-list nil))
>>>>
>>> This variable is not used anywhere and was a forgotten remnant from
>>> previous versions, now deleted; so the above is not needed anymore.
>>>
>>>> And, you need (if (featurep 'fringe) ) around calls to fringe-mode
>>>> features.
>>> I am unhappy to hear what fringe functionality is not available on
>>> XEmacs. It's a pity, since all the breakpoints and fringe arrows
> are using
>>> left fringe for position indication. Not having them is quite a
> sizable lack
>>> of functionality:(
>>>
>>> Vitalie.
>> That's a temporary workaround.  By the way, I forgot to mention that
>> you also need to replace (compilation-setup t) by
> (compilation-minor-mode t)
>> And, here's another...
>> (if (fboundp 'process-put) nil
>>   (defun process-put (process propname value)
>>   "Change PROCESS' PROPNAME property to VALUE.
>> It can be retrieved with `(process-get PROCESS PROPNAME)'."
>>   (set-process-plist process
>>              (plist-put (process-plist process) propname value))))
>>
>> But, here I'm stuck since we also need set-process-plist which is,
>> unfortunately, a C coded function.  XEmacs is in the process of
>> upgrading their packages to the latest Emacs versions.  Once that
>> happens, then I'll re-visit this.
>
> Oh I see now that XEmacs is lacking the fundamental 'process-plist'
> functionality. I am afraid we will have to wait for XEmacs to upgrade,
> there
> is no easy workaround for that functionality.
>
> For time being, here is the adapted excerpt from ess-tracebug which
> provides
> the + + + replacement:
>
> (defvar inferior-ess-replace-long+ t
>   "If non-nil, '+ + + + ' prompt containing more than 3 + is replaced
> by `ess-long+replace'"
>   )
>
> (defvar ess-long+replace "+ ... + \n"
>   "Replacement used for long + prompt."
>   )
>
> (defun inferior-ess-output-filter (proc string)
>   "Standard output filter for the inferior ESS process.
> Ring Emacs bell if process output starts with an ASCII bell, and pass
> the rest to `comint-output-filter'.
> Taken from octave-mod.el."
>   (if inferior-ess-replace-long+
>       (setq string (replace-regexp-in-string
>                     "\\(\\+ \\)\\{3\\}\\(\\+ \\)+"
>                     ess-long+replace string))
>     )
>   (comint-output-filter proc (inferior-ess-strip-ctrl-g string)))
>
> Vitalie.
>
>>
>> Rodney
>
> ______________________________________________
> ESS-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help


--
><(((*>



More information about the ESS-help mailing list