[ESS] any way to speed up Emacs\ESS?

Deepayan Sarkar deepayan.sarkar at gmail.com
Mon Feb 16 18:42:20 CET 2009


On 2/16/09, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
>
>     KDH> Put               (setq ess-eval-visibly-p nil)
>     KDH> in your .emacs for
>     KDH> letting this be the default behaviour
>
>  exactly.  We have used this as our stats "department" default
>  forever.
>
>  The only (?) reasons it's not the default in ESS are
>
>  - because the "visibility-turned-on" option is more intuitive to
>   beginning users of ESS

And when giving live R demos in presentations...

>  - to remain compatible to all previous versions of ESS

I'm curious: does anyone know why things are slow with visibility
turned on? It's presumably a emacs22 issue, because there were no
speed issues in emacs21

As an aside, I tried defining a (crude) alternative to ess-eval-region
that loops through a region calling ess-eval-line-and-step (which has
no speed penalty even with visibility):

(defun myess-eval-region (start end)
  "Call ess-eval-line for each line overlapping region. "
  (interactive "r")
  (ess-force-buffer-current "Process to load into: ")
  (message "Starting evaluation... %s %s %s" start end (point))
  (goto-char start)
  (comint-bol)
  (while (< (point) end)
    (ess-eval-line-and-step)))

Unfortunately, this seems to echo the whole region first, and then
shows the results. Is there a simple way to force updating after each
call? Inserting a call to (sleep-for) seems to work, but surely there
is a better way:

(defun myess-eval-region (start end)
  "Call ess-eval-line for each line overlapping region. "
  (interactive "r")
  (ess-force-buffer-current "Process to load into: ")
  (message "Starting evaluation... %s %s %s" start end (point))
  (goto-char start)
  (comint-bol)
  (while (< (point) end)
    (progn
      (ess-eval-line-and-step)
      (sleep-for 0.001))))

-Deepayan




More information about the ESS-help mailing list