[ESS] Dumping functions with C-c C-d in R 2.0.0 has new "feature"

Martin Maechler maechler at stat.math.ethz.ch
Wed Oct 27 08:37:43 CEST 2004

>>>>> "PaCo" == Patrick Connolly <p.connolly at hortresearch.co.nz>
>>>>>     on Wed, 27 Oct 2004 13:11:48 +1300 writes:

    PaCo> I keep my functions and other objects with a comment showing the date
    PaCo> it was last modified.  

    PaCo> Now when I edit functions using R-2.0.0 with ESS 5.2.2, I get this
    PaCo> information in the buffer used for editing.  For me, that's rather
    PaCo> inconvenient (for reasons I can go into if it's important to know) and
    PaCo> I'd prefer to keep the previous behaviour.

    PaCo> I've decided it must be more of an ESS thing than an R thing since it
    PaCo> doesn't happen in the *R* buffer, but, of course, it's an R thing in
    PaCo> that it didn't happen before R-2.x.x.

Well, I'm pretty much sure it's an R thing.
C-c C-d  ends up calling
    (defun ess-dump-object (object filename) )
which really relies on the variable inferior-ess-dump-command 
which is   "dump(\"%s\",file=\"%s\")\n"

and then ``we all know'' that the behavior of dump() has changed
in R 2.0.0:  The idea of dump()s  default behavior is really
that source()ing its result should give the original object:
Hence dump() *should* by default also dump attributes, such as
your date.  Now the good news for you :
dump() has also a new argument 'control' for controlling its
behavior in quite some detail.
Particularly, I'm pretty sure that if you 

(setq inferior-ess-dump-command 
      "dump(\"%s\", file=\"%s\", control=\"useSource\")\n")

you'll be happy -- for functions --- no attributes will be shown
in your dump buffer. 
{You may be very unhappy though when dumping other objects;
 you can just about forget to dump data frames with this setting
 and C-c C-d}

Note that you actually should use *customize* to change this
emacs variable instead of doing it directly.
The quickest way to customize it, is to type
 C-h v inferior-ess-dump-command 
 opens a *Help* buffer which 2nd-to-last line
 `` You can customize this variable ''
 where the 'customize' is underlined and "clickable" (middle button)
 and leads you directly to the proper customize buffer.


More information about the ESS-help mailing list