[ESS] This is not spam

Dan Bolser dmb at mrc-dunn.cam.ac.uk
Wed Oct 4 20:15:00 CEST 2006


Re: Emacs Noob seeks dream function "C-c C-c"

Dan Bolser wrote:
>
> GSOH
>
>
> The following does not work, and I can't work out why (I am very 
> inexperienced with emacs).
>
> (defun ess-eval-paragraph-and-step-xxx (vis)
>  "Send the current paragraph to the inferior ESS process and move 
> forward to
> the next paragraph.  Arg has same meaning as for `ess-eval-region'."
>  (interactive "P")
>  (let ((beg-end (ess-eval-paragraph vis)))
>    (goto-char (1+ (cadr beg-end))))
>  (save-excursion
>    (ess-switch-to-end-of-ESS)
>    )
>  )
>
>
> I am trying to get the functionality of ess-eval-paragraph-and-step 
> (C-c C-c), but combine it with the convenience of 
> ess-eval-line-and-step (C-c C-n), which also shows the 'process 
> window' at the appropriate place (the bottom). The above code leaves 
> the 'active' cursor in the 'process window' which isn't what I want.
>
> I would like ess-eval-paragraph-and-step-xxx to evaluate the function 
> or paragraph AND also show the 'process window' AND move the 'cursor' 
> to the bottom of the 'process window' AND put the cursor back at the 
> end of the function or paragraph just as ess-eval-paragraph-and-step 
> does. I had limited success using an *other-window* command (I forget 
> which), but obviously that is not as good as talking directly to the 
> ESS 'process window'
>
> Thanks for any help
>
> Dan.
>
>
>
> P.S.
>
> Hmmm....
>
> I got this to work (but I don't really know how)...
>
>
> (defun ess-eval-paragraph-and-step-xxx (vis)
>  "Er..."
>  (interactive "P") ; What is this?
>  (ess-eval-paragraph-and-step vis)
>  (previous-line 1)
>  (ess-eval-line-and-step)
>  )
>
> (global-set-key (kbd "C-c C-c") 'ess-eval-paragraph-and-step-xxx)
>
>
> However, that 'global-set-key' part doesn't seem to work (running the 
> function from M-x appears to work fine). Is this a dumb issue, or is 
> the binding gobbled up by ess? (I am running all this after loading 
> ess with
>
> ;; Allow R command automatically
> (load "/home/xxx/emacs/ess-5.3.3/lisp/ess-site")
>
>
>
>
>
>
>
>




More information about the ESS-help mailing list