[ESS] Suggestion: ess-eval-chunk-and-step

Warnes, Gregory gregory.warnes at novartis.com
Fri Oct 12 19:31:20 CEST 2012


Very nice!  I wasn't aware of save-excursion.  Something new to add that
to my bag of tricks!

BTW, why (funcall 'ess-eval-chunk vis)  instead of (ess-eval-chunk vis) ?

-Greg

-- 
Gregory Warnes, Ph.D.
Sr. Expert Modeler
Modeling and Simulation
CA Phone: +1 617 871-8498
gregory.warnes at novartis.com







On 10/12/12 12:09 PM, "Vitalie Spinu" <spinuvit at gmail.com> wrote:

>
>
>This is a better way to do it:
>
>(defun ess-eval-chunk-and-step (&optional vis)
>  "Tangle the current chunk and send it to the inferior ESS process and
>step to the next chunk"
>  (interactive)
>  (save-excursion
>    (funcall 'ess-eval-chunk vis))
>  (funcall 'ess-noweb-next-code-chunk 1))
>
>
>
>I have just pushed a version of this into trunk.
>
>ess-eval-chunk-and-step is now bound to M-n C-c
>ess-eval-chunk          is now bound to M-n C-M-x
>
>Corresponding to C-c C-c and C-M-x ess map.
>
>    Vitalie.
>
>
>  >> "Warnes, Gregory" <gregory.warnes at novartis.com>
>  >> on Fri, 12 Oct 2012 15:30:17 +0000 wrote:
>
>  > Here is another function, which displays the R buffer and scrolls it
>  > appropriately.  Oddly, for some reason, this generates an error in the
>  > current SVN version (replacing 'noweb-next-code-chunk with
>  > 'ess-noweb-code-chunk), but is happy under 12.4	
>
>  > (defun ess-eval-chunk-show-and-step ()
>  >   "Tangle the current chunk and send it to the inferior ESS process
>and
>  > step to the next chunk"
>  >   (interactive)
>  >   ;; ess-eval-chunk forgets the current buffer, so store and restore
>it
>  >   (let ( 
>  > 	(cbuf (current-buffer) )
>  > 	)
>  >     (command-execute 'ess-eval-chunk-and-go)
>  >     (switch-to-buffer-other-window cbuf)
>  >     )
>
>  >   (command-execute 'noweb-next-code-chunk)
>  >   )
>
>  > -Greg



More information about the ESS-help mailing list