[ESS-bugs] ESS 5.3.7: Bug

Rodney Sparapani rsparapa at mcw.edu
Mon May 19 18:58:57 CEST 2008


Will wrote:
> Hi, there!
>
> Thanks for your quick response! Yes, I suggest to include my corrected 
> function into ESS (without the comments). I'd like to point out that 
> adding <ess-sas-submit-command-options>, ".sas", and the necessary 
> blanks is necessary if you want to configure SAS under Batch Mode (the 
> only mode working under MS Windows) so one can submit code and call 
> the data viewer from within ESS. Otherwise the necessary options for 
> submitting code and viewing data will conflict.
>
> I found the email again I posted on 2007-10-11 to the ess-bugs list 
> where this issue is described in more detail. If I can get access to 
> the  ESS repository I can also change the function myself.
>
> Best, Will
>
Hi Will:

Well, have you tried that code?  I did and it doesn't work.  Are you 
customizing the default
value of ess-sas-submit-command-options?  If so, then I guess it would 
work.  However, here
is a more general solution that should work either with a customization 
or with a local
variable setting.  But, it has the annoying feature that I have to 
confirm with a
return every time in the presence of local variables (customization 
might not do that):

(defun ess-sas-submit-region ()
    "Write region to temporary file, and submit to SAS."
    (interactive)
    (ess-sas-file-path)
    (hack-local-variables t)
    (write-region (region-beginning) (region-end)
    (concat (ess-sas-temp-root) ".sas"))

    (let ((arg1 ess-sas-submit-command)
      (arg2 ess-sas-submit-command-options))
    (save-excursion
      (ess-sas-goto-shell t)

    (if (and (w32-shell-dos-semantics)
    (string-equal ":" (substring ess-sas-file-path 1 2)))
    (progn
        (insert (substring ess-sas-file-path 0 2))
        (comint-send-input)
    ))

    (insert "cd \"" (convert-standard-filename
    (file-name-directory ess-sas-file-path)) "\"")
    (comint-send-input)

    (insert (concat ess-sas-submit-pre-command " " arg1
      " " arg2
          " " (ess-sas-temp-root) " " ess-sas-submit-post-command))
    (comint-send-input)
    ))
)

I'll be committing shortly.

---
Rodney Sparapani      Center for Patient Care & Outcomes Research (PCOR)
Sr. Biostatistician              Department of Medicine
Was 'Name That Tune' rigged?     Medical College of Wisconsin (MCW)
WWLD: What Would Lombardi Do     Milwaukee, WI, USA



More information about the ESS-bugs mailing list