[ESS] 2 things I wish ESS would do

A.J. Rossini blindglobe at gmail.com
Mon May 12 15:53:03 CEST 2008


The first mod is dangerous -- some of us (well, I can think of only
one person, but that's me) still run multiple things out of one emacs
session -- R, S4, S-PLUS, etc... and hence the first change (going
from buffer-local to global var) kills me.

This is part of what I've been trying to find time to do for about 5-6
years now, rewrite the internals to be sane.

A bit busy today, but will take a look at it soon (famous last words,
I said the same thing back then, as well).

If you can use git for version control, we can work out of the ESS
repo on repo.or.cz (I need to update it) and can then hash out the
changes safely.

On Mon, May 12, 2008 at 11:40 AM, tyler <tyler.smith at mail.mcgill.ca> wrote:
> "A.J. Rossini" <blindglobe at gmail.com> writes:
>
>  > On 5/6/08, tyler <tyler.smith at mail.mcgill.ca> wrote:
>  >
>
> >> Is there a good reason to keep the ess-transcript functions and
>  >> inferior-ess-prompt hidden from ESS[S] mode? Appropriate helper
>  >> functions would be easy to cook up if the these items were available. I
>  >> imagine a single command to collect the current region in the process
>  >> buffer, prompt for the destination buffer, possibly with a default, and
>  >> then paste and clean the kill-ring at point in the destination buffer.
>  >
>  >
>  > ... refactoring those functions into a general support location would
>
> > be a great idea, for reuse by the various modes.
>  >
>  > best,
>  > -tony
>  >
>
>  Ok, so how about something like this:
>
>  ess-cust.el, ca. line 1269, to make inferior-ess-prompt global:
>
>  ;; Tyler commented this out:
>  ;;(make-variable-buffer-local 'inferior-ess-prompt)
>
>  ess-trns.el, ca. line 35, to allow for require-ing a named feature:
>
>  (provide 'ess-trns) ;;Tyler added for require from ess-mode
>
>  and ess-mode.el, ca. line 36, to load ess-trns for ess-mode:
>
>  (require 'ess-trns); Tyler added to allow for easy cleaning of code
>                    ; copied from the process buffer
>
>
>  With that done, and taking advantage of iswitchb, I have the following
>  new functions for ess-inf.el:
>
>  ;; transfer commands to script buffer:
>  (defun ess-extract-commands-and-go (beg end)
>   "Paste the commands in the region to a script buffer and go there."
>   (interactive "r")
>   (kill-ring-save beg end)
>   (iswitchb-buffer)
>   (setf start (point))
>   (yank)
>   (setf end (point))
>   (ess-transcript-clean-region start end nil))
>
>  (defun ess-extract-commands (beg end)
>   "Paste the commands in the region to a script buffer."
>   (interactive "r")
>   (kill-ring-save beg end)
>   (set-buffer (iswitchb-read-buffer "select a buffer:"))
>   (setf start (point))
>   (yank)
>   (setf end (point))
>   (ess-transcript-clean-region start end nil))
>
>  If that looks sensible it could be further tweaked to provide sensible
>  defaults for the buffer selection step, which may or may not use the
>  iswitchb functions. In particular, we'd have to insure that the
>  destination buffer was in ESS[S] mode. Ideas?
>
>  Cheers,
>
>  Tyler
>
>  --
>  The purpose of models is not to fit the data but to sharpen the questions.
>                                        --Samuel Karlin
>
>
>
>  ______________________________________________
>  ESS-help at stat.math.ethz.ch mailing list
>  https://stat.ethz.ch/mailman/listinfo/ess-help
>



-- 
best,
-tony

blindglobe at gmail.com
Muttenz, Switzerland.
"Commit early,commit often, and commit in a repository from which we
can easily roll-back your mistakes" (AJR, 4Jan05).

Drink Coffee: Do stupid things faster with more energy!




More information about the ESS-help mailing list