>>>>> "BR" == B Rowlingson <B.Rowlingson at lancaster.ac.uk> writes:>> Could you check and see if the variable is global or >> buffer-local? ("C-h v ess-dump-filename-template" should do >> it). BR> ess-dump-filename-template's value is "rowlings.%s.S" Local in BR> buffer *S+5*; global value is "rowlings.%s.S" [+ docs] Defined BR> in `ess-cust'. BR> whereas ess-source-directory is: BR> ess-source-directory's value is "./Src99/" [+ docs] Defined in BR> `ess-cust'. BR> Such scoping concepts are beyond my meagre elisp BR> knowledge. There's a whole bunch of BR> 'make-variable-buffer-local' calls in ess-cust.el but neither BR> of the two variables are mentioned... The problem is this: buffer-local variables accomodate any value which might vary between buffers. So, the "right" place to define this will be in a hook that gets called when R-mode gets called, since for example, we'd like to dump SAS code in rowlings.%s.sas, etc. I think that ess-dump-filename-template needs to be redefined in essd-sp5.el , or essd-r.el, if you want your site-configs to persist across users (and actually work). HOWEVER, you mentioned that what you wanted was the "default" function thing, i.e. dumped <- function { } placed into a non-existant buffer. This is a difference as far as how S-PLUS and R dump objects, I think. Your point, which I recall (I've not used S-PLUS for actual data analysis in a long time) is that this gets set for non-existant objects when using ESS for S-PLUS, and not for R, sounds familiar. I've CC'd ESS-help and R-help; can anyone verify this discrepancy (with ESS under S-PLUS and R)? best, -tony -- A.J. Rossini Rsrch. Asst. Prof. of Biostatistics BlindGlobe Networks (home/default) rossini at blindglobe.net UW Biostat/Center for AIDS Research rossini at u.washington.edu FHCRC/SCHARP/HIV Vaccine Trials Net rossini at scharp.org FHCRC: M/Tu: 206-667-7025 (fax=4812) | Voicemail is pretty sketchy CFAR: W/F: 206-731-3647 (fax=3694) | Email is far better than phone UW: Th/F: 206-543-1044 (fax=3286) | Change last 4 digits of phone for fax -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> HOWEVER, you mentioned that what you wanted was the "default" function > thing, i.e. > dumped <- function { } > placed into a non-existant buffer. This is a difference as far as how > S-PLUS and R dump objects, I think. Your point, which I recall (I've > not used S-PLUS for actual data analysis in a long time) is that this > gets set for non-existant objects when using ESS for S-PLUS, and not > for R, sounds familiar. > > I've CC'd ESS-help and R-help; can anyone verify this discrepancy > (with ESS under S-PLUS and R)?Its because the first thing Splus's dump(foo) function does is to write "foo" <- into the dump file. If the object doesn't exist, its not until that point that the dump stops, and you are left with '"foo" <-' in the file. ESS uses this, and appends the ess-function-template to get "foo" <- function( ) { } in function ess-dump-file-other-window. Since R gives you a zero-length file when you dump a non-existent object, ESS cant use this trick, and since ess-dump-file-other-window is only passed the filename and not the object name it cant write it to the file (unless it deparses the filename. Ick.). I've rewritten ess-dump-file-other-window to take filename and object as argument. If it spots a new object (using the ess-dumped-missing-re as before) then it clears out the buffer and inserts "object" <- (ess-function-template). This works for Splus 5 and R 1.2.0. I don't have any of the other systems that ESS uses so I cant see if it breaks anything else. One other related matter - if ess-function-template isn't formatted exactly how the pretty-formatter does it, then the buffer is reformatted and marked as modified, nullifying the (set-buffer-modified-p nil) in the dump function. Bug or feature? You decide. Barry -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._