[ESS] In Stata mode, where do graphs display?
brend@n@h@|p|n @end|ng |rom u|@|e
Wed Feb 24 19:23:14 CET 2016
Console Stata doesn't show graphs. What I do is export it to EPS and
. graph export /tmp/x.eps, replace
. !evince /tmp/x.eps &
This is for Linux, the detail will differ according to OS.
Second question: re line ends:
What Stata does itself with its "do-file" editor is to write the region
to a temporary file, issue a command within Stata to "do" the temporary
file, and then delete it. I emulate this with a function with which I
replace the usual eval-region command. This is largely based on
ess-eval-region. See below.
;; Stata equivalent of ess-eval-region
(defun delimit-do (start end toggle &optional clear message)
"Send the current region to the inferior ESS process, Stata do-editor style.
Creates a temporary file, \"do\"-es it, deletes it.
With prefix argument toggle the meaning of `ess-eval-visibly-p';
this does not apply when using the S-plus GUI, see `ess-eval-region-ddeclient'."
(ess-force-buffer-current "Process to use: ")
(message "Starting evaluation...")
(setq message (or message "Eval region"))
;; don't send new lines (avoid screwing the debugger)
(skip-chars-forward "\n\t ")
(setq start (point))
(ess-blink-region start end))
;; don't send new lines at the end (avoid screwing the debugger)
(skip-chars-backward "\n\t ")
(setq end (point)))
(commands (buffer-substring-no-properties start end))
(delimit-do-file (make-temp-file "delimit-do" nil ".do"))
(proc (get-process ess-local-process-name))
(visibly (if toggle (not ess-eval-visibly-p) ess-eval-visibly-p))
(dev-p (process-get proc 'developer))
(tb-p (process-get proc 'tracebug)))
;; Go to the start of the section and look back for #delimit
;; if found set delimit unless the delimiter is not ";"
(setq delimit (re-search-backward "^#delimit +\\(.+\\)$" nil t))
(if (not (string-match ";" (match-string 1))) (setq delimit nil))))
(if clear (insert "clear\n"))
(if delimit (insert "#delimit ;\n"
(insert commands "\n"))
(write-file delimit-do-file nil)
(format "do %s\nrm %s\n" delimit-do-file delimit-do-file))
(if (and (fboundp 'deactivate-mark) ess-eval-deactivate-mark)
;; return value
(list start end))
Brendan Halpin, Head, Department of Sociology, University of Limerick, Ireland
Tel: w +353-61-213147 f +353-61-202569 Room F1-002 x 3147
mailto:brendan.halpin using ul.ie ULSociology on Facebook: http://on.fb.me/fjIK9t
More information about the ESS-help