Upload version for checking.
[ess.git] / doc / html / ess.html
blobfe579634d4d1a34b432ca5a298d59e6c612232f0
1 <html lang="en">
2 <head>
3 <title>ESS -- Emacs Speaks Statistics</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="ESS -- Emacs Speaks Statistics">
6 <meta name="generator" content="makeinfo 4.8">
7 <link title="Top" rel="top" href="#Top">
8 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9 <meta http-equiv="Content-Style-Type" content="text/css">
10 <style type="text/css"><!--
11 pre.display { font-family:inherit }
12 pre.format { font-family:inherit }
13 pre.smalldisplay { font-family:inherit; font-size:smaller }
14 pre.smallformat { font-family:inherit; font-size:smaller }
15 pre.smallexample { font-size:smaller }
16 pre.smalllisp { font-size:smaller }
17 span.sc { font-variant:small-caps }
18 span.roman { font-family:serif; font-weight:normal; }
19 span.sansserif { font-family:sans-serif; font-weight:normal; }
20 --></style>
21 </head>
22 <body>
23 <h1 class="settitle">ESS -- Emacs Speaks Statistics</h1>
24 <h2 class="majorheading"><a name="TOC0"></a>ESS &mdash; Emacs Speaks Statistics</h2>
26 <!-- node-name, next, previous, up -->
27 <div class="node">
28 <p><hr>
29 <a name="Top"></a>
30 Next:&nbsp;<a rel="next" accesskey="n" href="#Introduction">Introduction</a>,
31 Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
32 Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
34 </div>
36 <h2 class="unnumbered">ESS: Emacs Speaks Statistics</h2>
38 <p>ESS version
39 5.2.12
41 <pre class="display"> by A.J. Rossini,
42 R.M. Heiberger,
43 K. Hornik,
44 M. Maechler,
45 R.A. Sparapani
46 and S.J. Eglen.
47 </pre>
48 <!-- (Formerly: Doug -->
49 <!-- Bates, Ed Kademan, Frank Ritter and David Smith). -->
50 <blockquote>
51 Emacs Speaks Statistics (ESS) provides an intelligent, consistent
52 interface between the user and the software. ESS interfaces with
53 SAS, S-PLUS, R, BUGS and other statistical analysis packages under
54 the Unix, Microsoft Windows, and Apple Mac operating systems. ESS
55 is itself a package within the emacs text editor and uses emacs
56 features to streamline the creation and use of statistical software.
57 ESS knows the syntax and grammar of statistical analysis packages
58 and provides consistent display and editing features based on that
59 knowledge. ESS assists in interactive and batch execution of
60 statements written in these statistical analysis languages.
61 </blockquote>
63 <ul class="menu">
64 <li><a accesskey="1" href="#Introduction">Introduction</a>: Overview of features provided by this package
65 <li><a accesskey="2" href="#Installation">Installation</a>: Installing ESS on your system
67 <li><a accesskey="3" href="#Interactive-ESS">Interactive ESS</a>: Interacting with statistical programs
68 <li><a accesskey="4" href="#Entering-commands">Entering commands</a>: Interacting with the ESS process
69 <li><a accesskey="5" href="#Transcript-Mode">Transcript Mode</a>: Manipulating saved transcript files
71 <li><a accesskey="6" href="#ESS-for-the-S-family">ESS for the S family</a>
72 <li><a accesskey="7" href="#Editing">Editing</a>: How to create/edit objects and functions
73 <li><a accesskey="8" href="#Editing-R-documentation-files">Editing R documentation files</a>
74 <li><a accesskey="9" href="#Help">Help</a>: Reading help files
76 <li><a href="#ESS-for-SAS">ESS for SAS</a>
77 <li><a href="#ESS-for-BUGS">ESS for BUGS</a>
79 <li><a href="#Miscellaneous">Miscellaneous</a>: Other features of ESS
80 <li><a href="#Mailing-lists_002fbug-reports">Mailing lists/bug reports</a>: How to get assistance with ESS
81 <li><a href="#Customization">Customization</a>: Customizing ESS
83 <li><a href="#Key-Index">Key Index</a>
84 <li><a href="#Concept-Index">Concept Index</a>
85 <li><a href="#Variable-and-command-index">Variable and command index</a>
86 <!-- @detailmenu -->
87 <!-- The Detailed Node Listing - -->
88 <!-- Introduction to ESS -->
89 <!-- * Features:: Why should I use ESS? -->
90 <!-- * New features:: -->
91 <!-- * Credits:: Authors of and contributors to ESS -->
92 <!-- * Latest version:: Getting the latest version of ESS -->
93 <!-- * Manual:: How to read this manual -->
94 <!-- Installing ESS on your system -->
95 <!-- * Unix installation:: Installing ESS on your Unix system -->
96 <!-- * Microsoft Windows installation:: Installing ESS on your MS Windows system -->
97 <!-- * Requirements:: emacs, Operating Systems and Statistical Packages -->
98 <!-- * System dependent:: Other variables you may need to change -->
99 <!-- Starting the ESS process -->
100 <!-- * Multiple ESS processes:: -->
101 <!-- * ESS processes on Remote Computers:: -->
102 <!-- * Customizing startup:: Changing the startup actions -->
103 <!-- Help for the S family -->
104 <!-- * ESS(S)-Editing files:: -->
105 <!-- * iESS(S)-Inferior ESS processes:: -->
106 <!-- * Handling and Reusing Transcripts:: -->
107 <!-- * ESS-help-assistance with viewing help:: -->
108 <!-- * Philosophies for using ESS(S):: -->
109 <!-- * Scenarios for use (possibilities-based on actual usage):: -->
110 <!-- * Customization Examples and Solutions to Problems:: -->
111 <!-- Help for SAS -->
112 <!-- * ESS(SAS)-Design philosophy:: -->
113 <!-- * ESS(SAS)-Editing files:: -->
114 <!-- * iESS(SAS)-Interactive SAS processes:: -->
115 <!-- * ESS(SAS)-Batch SAS processes:: -->
116 <!-- * ESS(SAS)-Function keys for batch processing:: -->
117 <!-- * ESS(SAS)-TAB key:: -->
118 <!-- * ESS(SAS)-Usage scenarios:: -->
119 <!-- * iESS(SAS)-Common problems:: -->
120 <!-- * ESS(SAS)-MS Windows:: -->
121 <!-- Interacting with the ESS process -->
122 <!-- * Command-line editing:: Entering commands and fixing mistakes -->
123 <!-- * Completion:: Completion of object names -->
124 <!-- * Completion details:: Advanced completion concepts -->
125 <!-- * Transcript:: Manipulating the transcript -->
126 <!-- * Command History:: Command History -->
127 <!-- * History expansion:: References to historical commands -->
128 <!-- * Hot keys:: Hot keys for common commands -->
129 <!-- * Statistical Process running in ESS?:: -->
130 <!-- * Other:: Other commands provided by inferior-ESS -->
131 <!-- Manipulating the transcript -->
132 <!-- * Last command:: Manipulating the output from the last command -->
133 <!-- * Process buffer motion:: Viewing older commands -->
134 <!-- * Transcript resubmit:: Re-submitting commands from the transcript -->
135 <!-- * Saving transcripts:: Keeping a record of your S session -->
136 <!-- Editing S functions -->
137 <!-- * Edit buffer:: Edit objects in a specialized buffer -->
138 <!-- * Loading:: Loading source files into the ESS process -->
139 <!-- * Error Checking:: Detecting errors in source files -->
140 <!-- * Evaluating code:: Sending code to the ESS process -->
141 <!-- * Indenting:: Indenting and formatting @Sl{} code -->
142 <!-- * Other edit buffer commands:: Commands for motion, completion and more -->
143 <!-- * Source Files:: Maintaining @Sl{} source files -->
144 <!-- * Source Directories:: Names and locations of dump files -->
145 <!-- Manipulating saved transcript files -->
146 <!-- * Resubmit:: Resubmitting commands from the transcript file -->
147 <!-- * Clean:: Cleaning transcript files -->
148 <!-- Other features of ESS -->
149 <!-- * Highlighting:: Syntactic highlighting of buffers -->
150 <!-- * Graphics:: Using graphics with ESS -->
151 <!-- * Object Completion:: -->
152 <!-- Using graphics with ESS -->
153 <!-- * printer:: The printer() graphics driver -->
154 <!-- * X11:: The X11() (and other X-windows based) driver -->
155 <!-- Bugs and Bug Reporting, Mailing Lists -->
156 <!-- * Bugs:: -->
157 <!-- * Reporting Bugs:: -->
158 <!-- * Mailing Lists:: -->
159 <!-- Customizing ESS -->
160 <!-- * Variables:: Variables for customization -->
161 <!-- * Hooks:: Customizing ESS with hooks -->
162 <!-- * Keybindings:: Changing the default ESS keybindings -->
163 <!-- Variables for customization -->
164 <!-- * Variables for starting ESS:: Variables for starting ESS -->
165 <!-- * Dump file variables:: Variables for dump files -->
166 <!-- * Indentation variables:: Variables controlling indentation -->
167 <!-- * Variables controlling interaction:: Variables controlling interaction -->
168 <!-- with the ESS process -->
169 <!-- @end detailmenu -->
170 </ul>
172 <!-- node-name, next, previous, up -->
173 <div class="node">
174 <p><hr>
175 <a name="Introduction"></a>
176 Next:&nbsp;<a rel="next" accesskey="n" href="#Installation">Installation</a>,
177 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
178 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
180 </div>
182 <h2 class="chapter">1 Introduction to ESS</h2>
184 <p><a name="index-introduction-1"></a>
185 The S family (S, Splus and R) and SAS statistical analysis packages
186 provide sophisticated statistical and graphical routines for manipulating
187 data. <b>E</b>macs <b>S</b>peaks <b>S</b>tatistics (ESS) is based on the merger
188 of two pre-cursors, S-mode and SAS-mode, which provided support for the
189 S family and SAS respectively. Later on, Stata-mode was also incorporated.
191 <p>ESS provides a common, generic, and useful interface, through emacs, to
192 many statistical packages. It currently supports the S family, SAS, BUGS,
193 Stata and XLisp-Stat with the level of support roughly in that order.
195 <p>A bit of notation before we begin. <em>emacs</em> refers to both
196 <em>GNU Emacs</em> by the Free Software Foundation, as well as
197 <em>XEmacs</em> by the XEmacs Project. The emacs major
198 mode <code>ESS[language]</code>, where <code>language</code> can take values such as
199 <code>S</code>, <code>SAS</code>, or <code>XLS</code>. The inferior process interface
200 (the connection between emacs and the running process) referred to as inferior ESS
201 (<code>iESS</code>), is denoted in the modeline by <code>ESS[dialect]</code>, where
202 <code>dialect</code> can take values such as <code>S3</code>, <code>S4</code>, <code>S+3</code>,
203 <code>S+4</code>, <code>S+5</code>, <code>S+6</code>, <code>S+7</code>, <code>R</code>, <code>XLS</code>, <code>VST</code>, <code>SAS</code>.
205 <p>Currently, the documentation contains many references to <cite>`S'</cite>
206 where actually any supported (statistics) language is meant, i.e., `S'
207 could also mean `XLisp-Stat' or `SAS'.
209 <p><a name="index-interactive-use-of-S-2"></a>
210 <a name="index-using-S-interactively-3"></a>For exclusively interactive users of S, ESS provides a number of
211 features to make life easier. There is an easy to use command history
212 mechanism, including a quick prefix-search history. To reduce typing,
213 command-line completion is provided for all S objects and &ldquo;hot
214 keys&rdquo; are provided for common S function calls. Help files are
215 easily accessible, and a paging mechanism is provided to view them.
216 Finally, an incidental (but very useful) side-effect of ESS is that a
217 transcript of your session is kept for later saving or editing.
219 <p><a name="index-transcripts-of-S-sessions-4"></a>No special knowledge of Emacs is necessary when using S
220 interactively under ESS.
222 <p><a name="index-programming-in-S-5"></a>For those that use S in the typical edit&ndash;test&ndash;revise cycle when
223 programming S functions, ESS provides for editing of S functions
224 in Emacs edit buffers. Unlike the typical use of S where the editor
225 is restarted every time an object is edited, ESS uses the current Emacs
226 session for editing. In practical terms, this means that you can edit
227 more than one function at once, and that the ESS process is still
228 available for use while editing. Error checking is performed on
229 functions loaded back into S, and a mechanism to jump directly to the
230 error is provided. ESS also provides for maintaining text versions of
231 your S functions in specified source directories.
233 <ul class="menu">
234 <li><a accesskey="1" href="#Features">Features</a>: Why should I use ESS?
235 <li><a accesskey="2" href="#New-features">New features</a>
236 <li><a accesskey="3" href="#Credits">Credits</a>: Authors of and contributors to ESS
237 <li><a accesskey="4" href="#Latest-version">Latest version</a>: Getting the latest version of ESS
238 <li><a accesskey="5" href="#Manual">Manual</a>: How to read this manual
239 </ul>
241 <!-- node-name, next, previous, up -->
242 <div class="node">
243 <p><hr>
244 <a name="Features"></a>
245 Next:&nbsp;<a rel="next" accesskey="n" href="#New-features">New features</a>,
246 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
247 Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
249 </div>
251 <h3 class="section">1.1 Why should I use ESS?</h3>
253 <p>Statistical packages are powerful software systems for manipulating and
254 analyzing data, but their user interfaces often leave something something
255 to be desired: they offer weak editor functionality and they differ
256 among themselves so markedly that you have to re-learn how to do those
257 things for each package. ESS is a package which is designed to make
258 editing and interacting with statistical packages more uniform,
259 user-friendly and give you the power of emacs as well.
261 <p>ESS provides several features which make it easier to interact with the
262 ESS process (a connection between your buffer and the statistical
263 package which is waiting for you to input commands). These include:
265 <ul>
266 <li><b>Command-line editing</b> for fixing mistakes in commands before they are
267 entered. The `<samp><span class="samp">-e</span></samp>' flag for S-plus provides something similar to
268 this, but here you have the full range of Emacs commands rather than a
269 limited subset. However, other packages such as XLisp-Stat and S3 do not
270 necessarily have features like this built-in.
271 See <a href="#Command_002dline-editing">Command-line editing</a>.
273 <li><b>Searchable command history</b> for recalling previously-submitted
274 commands. This provides all the features of the `<samp><span class="samp">Splus -e</span></samp>' history
275 mechanism, plus added features such as history searching.
276 See <a href="#Command-History">Command History</a>.
278 <li><b>Command-line completion</b> of both object and file names for quick
279 entry. This is similar to <code>tcsh</code>'s facility for filenames; here it
280 also applies to object names and list components.
281 See <a href="#Completion">Completion</a>.
283 <li><b>Hot-keys</b> for quick entry of commonly-used commands in `S' such as
284 <code>objects()</code> and <code>search()</code>.
285 See <a href="#Hot-keys">Hot keys</a>.
287 <li><b>Transcript recording</b> for a complete record of all the actions in an
288 S session.
289 See <a href="#Transcript">Transcript</a>.
291 <li><b>Interface to the help system</b>, with a specialized mode for viewing S
292 help files.
293 See <a href="#Help">Help</a>.
295 </ul>
297 <p>If you commonly create or modify S functions, you will have found
298 the standard facilities for this (the `<samp><span class="samp">fix()</span></samp>' function, for
299 example) severely limiting. Using S's standard features, one can only
300 edit one function at a time, and you can't continue to use S while
301 editing. ESS corrects these problems by introducing the following
302 features:
304 <ul>
305 <li><b>Object editing</b>. ESS allows you to edit more than one function
306 simultaneously in dedicated Emacs buffers. The ESS process may
307 continue to be used while functions are being edited.
308 See <a href="#Edit-buffer">Edit buffer</a>.
310 <li><b>A specialized editing mode</b> for S code, which provides syntactic
311 indentation and highlighting.
312 See <a href="#Indenting">Indenting</a>.
314 <li><b>Facilities for loading and error-checking source files</b>, including a
315 keystroke to jump straight to the position of an error in a source file.
316 See <a href="#Error-Checking">Error Checking</a>.
318 <li><b>Source code revision maintenance</b>, which allows you to keep historic
319 versions of S source files.
320 See <a href="#Source-Files">Source Files</a>.
322 <li><b>Facilities for evaluating S code</b> such as portions of source
323 files, or line-by-line evaluation of files (useful for debugging).
324 See <a href="#Evaluating-code">Evaluating code</a>.
325 </ul>
327 <p>Finally, ESS provides features for re-submitting commands from saved
328 transcript files, including:
330 <ul>
331 <li><b>Evaluation of previously entered commands</b>, stripping away
332 unnecessary prompts.
333 See <a href="#Transcript-resubmit">Transcript resubmit</a>.
335 </ul>
337 <!-- node-name, next, previous, up -->
338 <div class="node">
339 <p><hr>
340 <a name="New-features"></a>
341 Next:&nbsp;<a rel="next" accesskey="n" href="#Credits">Credits</a>,
342 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Features">Features</a>,
343 Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
345 </div>
347 <h3 class="section">1.2 New features in ESS</h3>
349 <p>Changes/New Features in 5.2.12:
350 <ul>
351 <li><acronym>ESS[SAS]</acronym>: <kbd>M-;</kbd> fixed, but the XEmacs function <code>comment-dwim</code>
352 may be broken, if so, use <kbd>M-x comment-region</kbd> and <kbd>M-x uncomment-region</kbd>
353 instead; only valid PROCs are fontified which is very helpful finding syntax errors
354 (currently supported: BASE, ETS, FSP, GRAPH, IML, INSIGHT and STAT).
355 <li>Rterm/Cygwin combination works under Microsoft Windows.
356 <li><acronym>ESS[R]</acronym>: internal calls use baseenv() instead of NULL and
357 define 'baseenv' where needed.
358 </ul>
360 <p>Changes/New Features in 5.2.11:
361 <ul>
362 <li>ESS Info entry and <samp><span class="file">dir</span></samp> handled more effectively for GNU Emacs users
363 <li><acronym>ESS[SAS]</acronym>: temporary files created for batch submission of a
364 region are now named based on the current file; see <code>ess-sas-file-root</code>
365 for details; all <code>lag</code> and <code>dif</code> functions now fontified correctly
366 <li>iESS[SAS]: fixed a few nagging bugs, however, still does not appear to
367 work at this time; please let us know if you have any ideas.
368 <li><acronym>ESS[S]</acronym>: Support for running other versions of Splus has been
369 added for unix. Two new variables, <code>ess-s-versions</code> and
370 <code>ess-s-versions-list</code>, are used to tell ESS what other versions of
371 Splus you would like to run.
372 </ul>
374 <p>Changes/New Features in 5.2.10:
375 <ul>
376 <li><acronym>ESS[R]</acronym>: ess-r-versions can no longer be customized (since the
377 customization was not taking effect unless customizations were loaded
378 before ESS). Its value has been changed so that it will also find R
379 executables beginning &ldquo;R-devel&rdquo; and &ldquo;R-patched&rdquo;. If you wish to
380 change this variable, it must be set in your <samp><span class="file">.emacs</span></samp> before ESS is
381 loaded.
382 <li>Installation with GNU Make enhanced: unix and unix-like
383 operating systems will now be able to install <acronym>ESS</acronym> for all
384 users in either a GNU Emacs site-lisp or an XEmacs package
385 configuration by editing <samp><span class="file">lisp/ess-site.el</span></samp> and <samp><span class="file">Makeconf</span></samp>
386 accordingly, then issuing <code>make install</code>
387 <li><acronym>ESS[S]</acronym>: Filename completion (inside strings) now also works in
388 XEmacs for R and S-plus.
389 <!-- working around a bug in Xemacs -->
390 </ul>
392 <p>Changes/New Features in 5.2.9:
393 <ul>
394 <li><acronym>ESS[R]</acronym> for Windows: the \ directory character bug
395 with respect to ess-load-file has been eradicated.
396 <li>i<acronym>ESS[SAS]</acronym><!-- /@w -->: <kbd>C-c C-r</kbd> and <kbd>C-c C-b</kbd> once again
397 work as intended and documented.
398 <li><acronym>ESS[S]</acronym>: M-x ess-fix-EQ-assign is a bit more agressive.
399 <li><acronym>ESS[S]</acronym>: Imenu now also shows setAs(), etc.
400 <li><acronym>ESS[R]</acronym>: R function pattern enhanced with underlying code such that
401 <kbd>M-C-a</kbd> (<code>ess-beginning-of-function</code>) etc now work for many more
402 cases, including S4 method definitions.
403 <li>i<acronym>ESS[R]</acronym><!-- /@w -->: myOwnhelp(1) no longer wrongly triggers help(1).
404 <li><acronym>ESS[R]</acronym>: Improved detection of bogus help buffers: valid help
405 buffers containing with the string &ldquo;no documentation&rdquo;(e.g. contour)
406 were being treated as bogus.
407 <li><acronym>ESS[R]</acronym>: In R help buffers, if <code>options("help.try.all.packages" =
408 TRUE)</code> then <code>?rlm</code> will list which packages rlm is defined in. This help
409 buffer is not bogus, but instead is now relabelled &ldquo;*help[R](rlm in
410 packages)*&rdquo;.
411 <li><acronym>ESS[STA]</acronym>: add &ldquo;//&rdquo; as comment starting character to syntax-table.
412 </ul>
414 <p>Changes/New Features in 5.2.8:
415 <ul>
416 <li>iESS: [Tab] completes <strong>file</strong> names &ldquo;inside string&rdquo; as in
417 earlier (&lt;= 5.2.3) ESS versions.
418 </ul>
420 <p>Changes/New Features in 5.2.7:
421 <ul>
422 <li>If you use Custom to change the variable ess-toolbar-items,
423 the new toolbar is used in all subsequent ESS buffers.
424 <li><acronym>ESS[SAS]</acronym>: new feature: if ess-sas-log-max &gt;0 and
425 your .log grows to more than ess-sas-log-max bytes, just
426 the first ess-sas-log-max bytes are refreshed; this is helpful when your .sas program
427 generates lots of error messages and gets too big for emacs to display
428 <li><acronym>ESS[R/S]</acronym>: <kbd>M-;</kbd> in R/S editing modes will now indent with
429 either one or two hashes depending on context.
430 <li><acronym>ESS[R]</acronym>: David Whiting's Sweave extensions (to 'noweb')
431 are now available (from ess-swv.el loaded by default).
432 </ul>
434 <p>Changes/New Features in 5.2.6:
435 <ul>
436 <li>Removed non-ASCII characters in a few files.
437 <li><acronym>ESS[R]</acronym>: now works better when UTF-8 locale is active; in
438 particular, you get correct directional quotes in R's startup message
439 for R-devel (unstable development version of R 2.1.0) when using
440 environment variables LANGUAGE=en@quot LC_ALL=en_US.UTF-8
441 <li><acronym>ESS[SAS]</acronym>: toggling of .log mode improved (<kbd>F10</kbd>); toggling of
442 .lst mode now also available (<kbd>C-F10</kbd>); killing all buffers associated
443 with .sas program no longer bound to <kbd>C-F10</kbd> since its a bit overzealous.
444 <li>S-Plus 7 for Windows is now recognized.
445 <li><acronym>ESS[S]</acronym> (incl. R): in auto-fill mode, strings are not wrapped anymore.
446 <li><acronym>ESS[S]</acronym> (incl. R): font-lock now correctly differs between R and S,
447 e.g., for "_"; both now fontify warning(.) and S does terminate() additionally.
448 <li>Support for `bell' aka `beep' aka `ding' aka `alarm' in all inferior
449 modes: When \a is output &ldquo;to the the console&rdquo; at the beginning of a line,
450 the bell is rung.
451 </ul>
453 <p>Changes/New Features in 5.2.5:
454 <ul>
455 <li><acronym>ESS[R]</acronym>: <kbd>C-c C-q</kbd> or `<samp><span class="samp">Quit S</span></samp>' from the menu now should work
456 (again and less klunkily) and do not append `<samp><span class="samp">-exited</span></samp>' to the
457 buffer name. Further, the behavior of <code>(ess-cleanup)</code>, called from
458 ess-quit, now depends on the new customizable variable
459 <code>ess-S-quit-kill-buffers-p</code> which defaults to <code>nil</code>.
460 Consequently, the question <em>&ldquo;Delete all buffers associated
461 with ..?&rdquo;</em> will not be asked anymore by default.
462 <li><acronym>ESS[SAS]</acronym> &ndash; ess-ebcdic-to-ascii-search-and-replace will now work
463 with the <code>recode</code> application as well which is available on many platforms
464 <li><acronym>ESS[S]</acronym> (incl. R): Name completion for slots of S4 objects now works!
465 </ul>
467 <p>Changes/New Features in 5.2.4:
468 <ul>
469 <li>The documentation now includes an overview of how to use the emacs
470 TAGS facility for S functions. (The distribution also used to contain a
471 directory <samp><span class="file">etc/other/Tags</span></samp> where a ~1990 version of <samp><span class="file">etags.c</span></samp> was
472 distributed; this is no longer relevant and so has been deleted.)
473 <li><acronym>ESS[SAS]</acronym> &ndash; When you are working with EBCDIC files on an ASCII
474 platform, .log NOTEs may display as gibberish since the EBCDIC
475 characters are not converted to ASCII prior to their display. So,
476 the function ess-ebcdic-to-ascii-search-and-replace is provided for
477 convenience and is bound to <kbd>C-F11</kbd>. This function requires the
478 <code>dd</code> command (only available on unix or unix-like platforms).
479 <li>ESS: Completion of object names is now always done dynamically rather
480 than allowing the option of using a pre-computed database (by
481 <code>ess-create-object-name-db</code>) since modern computers seem fast
482 enough for dynamic completion. (We expect few users, if any, have
483 been using the pre-computed database method.)
484 <li>ESS: object completion in iESS buffers running on Windows was
485 very slow (for GNU Emacs, but not XEmacs) and has now been fixed.
486 Further, it was more or less broken for all versions of S-plus 6.x,
487 and has been fixed to work everywhere but with the Windows' GUI of
488 S-plus. The list of objects now shows unique names also when an
489 object appears more than once in the search path.
490 <li><acronym>ESS[R]</acronym>: Completion of object names now also includes those
491 starting with &ldquo;.&rdquo;.
492 </ul>
494 <p>Changes/New Features in 5.2.3:
495 <ul>
496 <li>ESS: When new inferior ESS processes are created, by default they
497 will replace the current buffer (this restores behavior from pre
498 5.2.0). If you wish new ESS processes to start in another window of the
499 current frame, set inferior-ess-same-window to nil.
500 <li>New variables inferior-Splus-args and inferior-R-args provide a
501 way to pass command line arguments to starting S and R processes.
502 </ul>
504 <p>Changes/New Features in 5.2.2:
505 <ul>
506 <li>bug-fixes for 5.2.1 (require 'executable), html docs, etc.
507 <li>ess-lisp-directory/../doc/info added to Info-directory-list
508 if ess-info not found by info
509 <li><acronym>ESS[R]</acronym>: If you have other versions of R on your
510 exec-path, such as "R-1.8.1" with Unix or "rw1081" with Windows,
511 ESS will find them and create appropriate functions, such as
512 <kbd>M-x R-1.8.1</kbd> or <kbd>M-x rw1081</kbd>, for calling them.
513 By default only Unix programs beginning "R-1" and
514 "R-2" and Windows programs parallel to the
515 version of R in your exec-path will be found,
516 but see ess-r-versions and ess-rterm-versions for ways to find other
517 versions of R.
518 <li><acronym>ESS[R]</acronym>: Other versions of R, such as "R-1.8.1" on Unix and "rw1081" on
519 Windows, are added to the
520 "ESS / Start Process / Other" menu.
521 <li><acronym>ESS[S]</acronym>: If you have other versions of S-Plus on your Windows computer,
522 such as S-Plus 6.1 or S-Plus 4.5, ESS will find them and create appropriate
523 functions, such as <kbd>M-x splus61</kbd>, for calling the console version (Sqpe)
524 inside an emacs buffer. By default only
525 programs installed in the default location will be found, but see
526 ess-SHOME-versions for ways to find other versions of S-Plus.
527 <li><acronym>ESS[S]</acronym>: Other versions of Sqpe on Windows, such as "splus61",
528 are added to the
529 "ESS / Start Process / Other" menu.
530 <li><acronym>ESS[R]</acronym>: (bug fix) ess-quit (bound to <kbd>C-c C-q</kbd>) should now quit the
531 inferior R process, when issued from either the inferior buffer, or from
532 a .R buffer.
533 </ul>
535 <p>Changes/New Features in 5.2.1:
536 <ul>
537 <li><acronym>ESS[S]</acronym> (R and S-plus): now have toolbar support
538 with icons to evaluate code in the inferior process or to switch
539 there. This code is experimental and likely to change as XEmacs/Emacs
540 issues get resolved. The toolbar should be enabled if your Emacs
541 displays images, but can be disabled with the variable ess-use-toolbar.
542 Thanks to David Smith from Insightful for the S-plus logo.
543 <li><acronym>ESS[SAS]</acronym>: ess-sas-graph-view (<kbd>F12</kbd>) enhanced; you can specify
544 external file viewers for each graphics file type via the alist
545 ess-sas-graph-view-viewer-alist; also .jpg/.gif are now handled
546 by image-mode on XEmacs, if available, otherwise by graphics
547 primitives as before
548 </ul>
550 <p>Changes/New Features in 5.2.0:
551 <ul>
552 <li><acronym>ESS[BUGS]</acronym>: new info documentation! now supports interactive
553 processing thanks to <a href="mailto:Aki.Vehtari@hut.fi">Aki Vehtari</a>;
554 new architecture-independent unix support as well as support for BUGS v. 0.5
555 <li><acronym>ESS[SAS]</acronym>: convert .log to .sas with ess-sas-transcript;
556 info documentation improved; Local Variable bug fixes;
557 SAS/IML statements/functions now highlighted; files edited
558 remotely by ange-ftp/EFS/tramp are recognized and pressing
559 SUBMIT opens a buffer on the remote host via the local variable
560 ess-sas-shell-buffer-remote-init which defaults to "ssh";
561 changed the definition of the variable ess-sas-edit-keys-toggle
562 to boolean rather than 0/1; added the function ess-electric-run-semicolon
563 which automatically reverse indents lines containing only "run;";
564 <kbd>C-F1</kbd> creates MS RTF portrait from the current buffer;
565 <kbd>C-F2</kbd> creates MS RTF landscape from the current buffer;
566 <kbd>C-F9</kbd> opens a SAS DATASET with PROC INSIGHT rather than PROC FSVIEW;
567 "inferior" aliases for SAS batch: <kbd>C-c C-r</kbd> for submit region,
568 <kbd>C-c C-b</kbd> for submit buffer, <kbd>C-c C-x</kbd> for goto .log; <kbd>C-c C-y</kbd> for goto .lst
569 <li><acronym>ESS[S]</acronym>: Pressing underscore ("_") once inserts " &lt;- " (as before);
570 pressing underscore twice inserts a literal underscore. To stop this
571 smart behaviour, add "(ess-toggle-underscore nil)" to your .emacs after
572 ess-site has been loaded;
573 ess-dump-filename-template-proto (new name!) now can be
574 customized successfully (for S language dialects);
575 Support for Imenu has been improved; set ess-imenu-use-S to non-nil to
576 get an "Imenu-S" item on your menubar;
577 ess-help: Now using nice underlines (instead of `nuke-* ^H_')
578 <li><acronym>ESS[R]</acronym>: After (require 'essa-r), <kbd>M-x ess-r-var</kbd> allows to load
579 numbers from any Emacs buffer into an existing *R* process;
580 <kbd>M-x ess-rdired</kbd> gives a &ldquo;directory editor&rdquo; of R objects;
581 fixed ess-retr-lastvalue-command, i.e. .Last.value bug
582 (thanks to David Brahm)
583 <li>ESS: Support for creating new window frames has been added to
584 ESS. Inferior ESS processes can be created in dedicated frames by
585 setting inferior-ess-own-frame to t. ESS help buffers can also open in
586 new frames; see the documentation for ess-help-own-frame for details.
587 (Thanks to Kevin Rodgers for contributing code.)
588 </ul>
590 <p>Changes/New Features in 5.1.24:
591 <ul>
592 <li>The version number is now correct even inside ESS/Emacs
593 </ul>
595 <p>Changes/New Features in 5.1.23:
596 <ul>
597 <li>Minor more Makefile clean up.
598 </ul>
600 <p>Changes/New Features in 5.1.22:
601 <ul>
602 <li>Besides info documentation, PDF and HTML
603 documentation are also provided (instead of built using "make") and available
604 on the web as well; see <a href="http://ess.r-project.org/">ESS web page</a> and <a href="http://lib.stat.cmu.edu/general/ESS/doc">StatLib</a>
605 <li>Now that info documentation is available, the
606 README.* files are no longer supported. However, they
607 are still distributed for what it's worth.
608 <li>ESS is now an XEmacs package! See
609 <a href="http://www.xemacs.org/Install/index.html">XEmacs Installation HOWTO</a>
610 for details (specifically, items 10-15).
611 <li><acronym>ESS[SAS]</acronym>: more user-friendly enhancements for remote
612 SAS batch jobs with Kermit file transfers (LOG and OUTPUT
613 function key features now supported). Multiple shells
614 now supported so you can run SAS on different computers
615 from different buffers by setting the buffer-local variable
616 ess-sas-shell-buffer to unique buffer names.
617 <li>Major re-vamping of Makefile/Makeconf.
618 </ul>
620 <p>Changes/New Features in 5.1.21:
621 <ul>
622 <li><acronym>ESS[SAS]</acronym>: info documentation now available!, see
623 ESS-&gt;Help for SAS; <kbd>F12</kbd> opens GSASFILE nearest point for viewing
624 either within emacs, when available, or via an external viewer;
625 more syntax highlighting keywords; more enhancements for remote
626 SAS batch jobs with Kermit; new framework for remote SAS interactive
627 jobs, see ess-remote
628 <li><acronym>ESS[S]</acronym>: info documentation now available!, see
629 ESS-&gt;Help for the S family
630 <li>Makefile: tag now independent of rel; info files
631 made by doc/Makefile and installed in new info sub-directory
632 </ul>
634 <p>Changes/New Features in 5.1.20:
635 <ul>
636 <li>New `options()$STERM' in the S dialects (S, S-Plus, R).
637 The S program can determine the environment in which it is
638 currently running. ESS sets the option to `iESS' or `ddeESS'
639 when it starts an S language process. We recommend other specific
640 values for S language processes that ESS does not start.
641 <li>New `ess-mouse-me' function, assigned to S-mouse-3 by default.
642 User may click on a word or region and then choose from the
643 menu to display the item, or a summary, or a plot, etc.
644 This feature is still under development.
645 <li>GNU Emacs 21.1 is now supported (fixed for S dialects, SAS &amp; BUGS),
646 (some from Stephen Eglen).
647 <li>XEmacs 21.x is now supported (fixed w32-using-nt bug)
648 <li>XEmacs on Win (NT) is better supported.
649 <li>Workaround for bug in Sqpe+6 (S-PLUS 6 for Win).
650 <li>should now work even when imenu is not available (for old XEmacsen).
651 <li><acronym>ESS[SAS]</acronym>: XEmacs-Imenu fix; <kbd>C-TAB</kbd> is globalized along with your
652 function-key definitions, if specified; you can specify your SAS
653 library definitions outside of autoexec.sas for ess-sas-data-view
654 with SAS code placed in the variable ess-sas-data-view-libname,
655 also the dataset name is defaulted to the nearest permanent dataset
656 to point; Speedbar support now works for permanent datasets, please
657 ignore first./last.; new font-locking is now the default with more
658 improvements for font-locking PROCs, macro statements, * ; and %* ;
659 comments; you can toggle sas-log-mode with <kbd>F10</kbd> which will font-lock
660 your .log (if it isn't too big); submit remote .sas files accessed
661 with ange-ftp, EFS or Tramp (Kermit is experimental) by setting
662 ess-sas-submit-method to 'sh; ess-sas-submit-command and
663 ess-sas-submit-command-options are buffer-local so you can have
664 local file variable sections at the end of your .sas files to
665 request different executables or specify special options and the
666 local file variables are re-read at submit instead of only at file
667 open so that if you make a change it is picked up immediately;
668 <li><acronym>ESS[BUGS]</acronym>: font-lock with `in' fixed.
669 <li>for STATA: font-lock bug fixed.
670 <li>for Rd mode: <kbd>C-c C-v</kbd> and `switch-process' in menu.
671 further, <kbd>C-c C-f</kbd> prefix (Rd-font) for inserting or surrounding a word
672 by things such as \code{.}, \code{\link{.}}, \emph{.} etc.
673 <li>new functions (ess-directory-function) and (ess-narrow-to-defun)
674 ess-directory &lt;-&gt; default-directory logic (Jeff Mincy).
675 <li>Re-organized Makefile and fixed a few bugs.
676 </ul>
678 <p>Changes/New Features in 5.1.19:
679 <ul>
680 <li>S+6 now supported (Tony Rossini (Unix) and Rich Heiberger (Windows))
681 <li>New BUGS support through <acronym>ESS[BUGS]</acronym> mode (Rodney Sparapani)
682 Templates assist you in writing .bug and .cmd code (.cmd and .log
683 are replaced by .bmd and .bog to avoid emacs extension collisions).
684 Substitution" parameters facilitate "automagic" generation of
685 data...in" and "init...in" filenames, "const N=" from your data
686 file and "monitor()/stats()" commands. Activated by pressing <kbd>F12</kbd>.
687 <li>Fixes for `ess-smart-underscore' SAS breakage (Rich Heiberger)
688 <li>You can change between PC and Unix, local and global SAS function-key
689 definitions interactively (Rich Heiberger)
690 <li><kbd>C-Submit</kbd> a highlighted region to SAS batch (Rodney Sparapani)
691 <li>New and improved SAS syntax highlighting (Rodney Sparapani)
692 To get the new functionality, set ess-sas-run-make-regexp to nil.
693 Also available in .log files via <kbd>F10</kbd>.
694 <li>Open a permanent SAS dataset for viewing via <kbd>F9</kbd> (Rodney Sparapani)
695 You must have the library defined in autoexec.sas for it to work.
696 <li>User-friendly defaults for `sas-program', `ess-sas-batch-pre-command'
697 and `ess-sas-batch-post-command' as well Customize support for these
698 and other <acronym>ESS[SAS]</acronym> variables (Rodney Sparapani)
699 <li>`ess-sas-suffix-2' now defaults to .dat via <kbd>F11</kbd> (Rodney Sparapani)
700 <li>Emacs/XEmacs, Unix/Windows issues collectively handled in ess-emcs.el
701 <li>defadvice solves problem of missing *ESS* (thanks to Jeff Mincy)
702 <li>Improved manual a bit by including things that were only in `README'.
703 </ul>
705 <p>Changes/New Features in 5.1.18:
706 <ul>
707 <li>New `ess-smart-underscore' function, now assigned to "_" by default.
708 Inserts `ess-S-assign' (customizable " &lt;- "), unless inside string
709 and comments where plain "_" is used instead. (MM)
710 <li>Fixes for longstanding interactive SAS breakage (RMH)
711 </ul>
713 <p>Changes/New Features in 5.1.17:
714 <ul>
715 <li>Documentation for Windows Installation (Rich Heiberger)
716 <li>removal of ess-vars, finalization of customize support (in the
717 sense that there is no more use of ess-vars, but that we need to
718 fix ess-cust) (AJ Rossini)
719 <li>Many small (and large) fixes/contributions (MMaechler)
720 <li>addition of the "S-equal" variable and provide <kbd>M-x ess-add-MM-keys</kbd>
721 a way to remap "_" to `ess-S-assign', typically " &lt;- ", but
722 customizable. (MMaechler)
723 </ul>
725 <p>Changes/New Features in 5.1.16:
726 <ul>
727 <li>BUG FIXES
728 <li>Better SAS support
729 </ul>
731 <p>Changes/New Features in 5.1.15:
732 <ul>
733 <li>BUG FIXES
734 </ul>
736 <p>Changes/New Features in 5.1.14:
737 <ul>
738 <li>Yet more fixes to SAS mode, (Rich Heiberger and Rodney Sparapani)
739 <li>Customize support (for most Emacsen which support it) (AJRossini)
740 <li>ARC and ViSta support out of the box, and fixes for XLispStat (AJRossini)
741 </ul>
743 <p>Changes/New Features in 5.1.13:
744 <ul>
745 <li>Version numbering finally all depending on the ./VERSION file,
746 thanks to Martin Maechler.
747 <li>Yet more fixes to SAS mode, thanks to Rich Heiberger.
748 </ul>
750 <p>Changes/New Features in 5.1.12:
751 <ul>
752 <li>Splus 5.1 stabilized, thanks to Martin Maechler, Bill Venables,
753 Chuck Taylor, and others.
754 <li>More fixes to SAS mode, thanks to Rodney Sparapani
755 and Rich Heiberger.
756 </ul>
758 <p>Changes/New Features in 5.1.11:
759 <ul>
760 <li>More fixes to Stata mode, thanks to
761 <a href="mailto:brendan@essex.ac.uk">Brendan Halpin</a>.
762 <li>fixed bugs in ESS-elsewhere, thanks to many testers
763 <li>README.SPLUS4WIN has DETAILED instructions for S-PLUS 2000, thanks
764 to <a href="mailto:brahm@alum.mit.edu">David Brahm</a>.
765 <li>Fixes to SAS mode, thanks to Rodney Sparapani
766 </ul>
768 <p>Changes/New Features in 5.1.10:
769 <ul>
770 <li>More fixes to Stata mode
771 <li>primitive generic version of ESS-elsewhere
772 <li>Small fixes to SAS/Stata.
773 </ul>
775 <p>Changes/New Features in 5.1.9:
776 <ul>
777 <li>Stata mode works
778 <li>Literate Data Analysis using Noweb works
779 </ul>
781 <p>Changes/New Features in 5.1.8:
782 <ul>
783 <li>Bug fixes
784 <li>R documentation mode defaults changed
785 </ul>
787 <p>Changes/New Features in 5.1.2:
788 <ul>
789 <li>able to use inferior iESS mode to
790 communicate directly with a running S-Plus 4.x process using the
791 Microsoft DDE protocol. We use the familiar (from Unix ESS) <kbd>C-c C-n</kbd>
792 and related key sequences to send lines from the S-mode file to the
793 inferior S process. We continue to edit S input files in <acronym>ESS[S]</acronym> mode
794 and transcripts of previous S sessions in ESS Transcript mode. All
795 three modes know the S language, syntax, and indentation patterns and
796 provide the syntactic highlighting that eases the programming tasks.
797 </ul>
799 <!-- node-name, next, previous, up -->
800 <div class="node">
801 <p><hr>
802 <a name="Credits"></a>
803 Next:&nbsp;<a rel="next" accesskey="n" href="#Latest-version">Latest version</a>,
804 Previous:&nbsp;<a rel="previous" accesskey="p" href="#New-features">New features</a>,
805 Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
807 </div>
809 <h3 class="section">1.3 Authors of and contributors to ESS</h3>
811 <p><a name="index-comint-6"></a><a name="index-authors-7"></a><a name="index-credits-8"></a>
812 The ESS environment is built on the open-source projects of
813 many contributors, dating back nearly 15 years.
814 Doug Bates and Ed Kademan wrote S-mode in 1989 to edit S and Splus
815 files in GNU Emacs. Frank Ritter and Mike Meyer added features,
816 creating version 2. Meyer and David Smith made further contributions,
817 creating version 3. For version 4, David Smith provided process
818 interaction based on Olin Shivers' comint package.
820 <p>John Sall wrote GNU Emacs macros for SAS source code around 1990.
821 Tom Cook added more functionality creating SAS-mode which was
822 distributed in 1994. Also in 1994, A.J. Rossini extended S-mode
823 to support XEmacs. Together with extensions written by Martin Maechler,
824 this became version 4.7 and supported S, Splus, and R.
825 In 1995, Rossini extended SAS-mode to work with XEmacs.
827 <p>In 1997, Rossini merged S-mode and SAS-mode into a single Emacs
828 package for statistical programming; the product of this marriage was
829 called ESS version 5.
831 <ul>
832 <li>The multiple process code, and the idea for
833 <code>ess-eval-line-and-next-line</code> are by Rod Ball.
835 <li>Thanks to Doug Bates for many useful suggestions.
837 <li>Thanks to Martin Maechler for reporting and fixing bugs, providing many
838 useful comments and suggestions, and for maintaining the S-mode mailing
839 list.
841 <li>Thanks to Frank Ritter for updates from the previous version, the menu
842 code, and invaluable comments on the manual.
844 <li>Thanks to Ken'ichi Shibayama for his excellent indenting code, and many
845 comments and suggestions.
847 <li>Last but definitely not least, thanks to the many beta testers of the
848 S-mode and ESS mailing lists.
849 </ul>
851 <p><em>ESS</em> version 5 is being developed and currently maintained by
853 <ul>
854 <li><!-- @uref{http://www.google.com/,A.J. Rossini} -->
855 <a href="mailto:blindglobe@gmail.com">A.J. Rossini</a>
856 <!-- -->
857 <li><!-- @uref{http://www.sbm.temple.edu/departments/statistics/,Richard M. Heiberger} -->
858 <a href="mailto:rmh@temple.edu">Richard M. Heiberger</a>
859 <!-- -->
860 <li><!-- @uref{http://www.ci.tuwien.ac.at/~hornik,Kurt Hornik} -->
861 <a href="mailto:Kurt.Hornik@R-project.org">Kurt Hornik</a>
862 <!-- -->
863 <li><!-- @uref{http://stat.ethz.ch/people/maechler/,Martin Maechler} -->
864 <a href="mailto:maechler@stat.math.ethz.ch">Martin Maechler</a>
865 <!-- -->
866 <li><!-- @uref{http://www.mcw.edu/pcor/rsparapa,Rodney A. Sparapani} -->
867 <a href="mailto:rsparapa@mcw.edu">Rodney A. Sparapani</a>
868 <!-- -->
869 <li><!-- @uref{http://www.anc.ed.ac.uk/~stephen,Stephen Eglen} -->
870 <a href="mailto:stephen@gnu.org">Stephen Eglen</a>
871 </ul>
873 <!-- node-name, next, previous, up -->
874 <div class="node">
875 <p><hr>
876 <a name="Latest-version"></a>
877 Next:&nbsp;<a rel="next" accesskey="n" href="#Manual">Manual</a>,
878 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Credits">Credits</a>,
879 Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
881 </div>
883 <h3 class="section">1.4 Getting the latest version of ESS</h3>
885 <p>The latest released version of ESS is always available on the web at:
886 <a href="http://ess.r-project.org">ESS web page</a> or
887 <a href="http://lib.stat.cmu.edu/general/ESS/">StatLib</a>
889 <!-- There no longer is an anonymous CVS repository for ESS, due to lack of -->
890 <!-- interest, little demand, and problems with security. -->
891 <!-- text below modified from R-admin.texi (thanks to Kurt for the tip). -->
892 <p>The latest development version of ESS is available via
893 <a href="https://svn.R-project.org/ESS/">https://svn.R-project.org/ESS/</a>, the ESS Subversion repository. If
894 you have a Subversion client (see <a href="http://subversion.tigris.org/">http://subversion.tigris.org/</a>),
895 you can download the sources using:
896 <pre class="smallexample"> % svn checkout https://svn.r-project.org/ESS/trunk <var>path</var>
897 </pre>
898 <p class="noindent">which will put the ESS files into directory <var>path</var>. Later,
899 within that directory, `svn update' will bring that directory up to
900 date. Windows-based tools such as TortoiseSVN are also available for
901 downloading the files. Alternatively, you can browse the sources with a
902 web browser at: <a href="https://svn.r-project.org/ESS/trunk">ESS SVN site</a>. However, please use a subversion client instead to minimize the
903 load when retrieving.
905 <p>If you remove other versions of ESS from your emacs load-path, you can
906 then use the development version by adding the following to .emacs:
908 <pre class="example"> (load "/path/to/ess-svn/lisp/ess-site.el")
909 </pre>
910 <p>Note that https is required, and that the SSL certificate for the
911 Subversion server of the R project is
913 <pre class="smallexample"> Certificate information:
914 - Hostname: svn.r-project.org
915 - Valid: from Jul 16 08:10:01 2004 GMT until Jul 14 08:10:01 2014 GMT
916 - Issuer: Department of Mathematics, ETH Zurich, Zurich, Switzerland, CH
917 - Fingerprint: c9:5d:eb:f9:f2:56:d1:04:ba:44:61:f8:64:6b:d9:33:3f:93:6e:ad
918 </pre>
919 <p class="noindent">(currently, there is no &ldquo;trusted certificate&rdquo;). You can accept this
920 certificate permanently and will not be asked about it anymore.
922 <!-- node-name, next, previous, up -->
923 <div class="node">
924 <p><hr>
925 <a name="Manual"></a>
926 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Latest-version">Latest version</a>,
927 Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
929 </div>
931 <h3 class="section">1.5 How to read this manual</h3>
933 <p>If you need to install ESS, read <a href="#Installation">Installation</a> for details on what
934 needs to be done before proceeding to the next chapter.
936 <p>In this manual we use the standard notation for describing the
937 keystrokes used to invoke certain commands. <kbd>C-&lt;chr&gt;</kbd> means hold
938 the CONTROL key while typing the character &lt;chr&gt;. <kbd>M-&lt;chr&gt;</kbd> means
939 hold the META or EDIT or ALT key down while typing &lt;chr&gt;. If there is no
940 META, EDIT or ALT key, instead press and release the ESC key and then
941 type &lt;chr&gt;.
943 <p>All ESS commands can be invoked by typing <kbd>M-x command</kbd>. Most of
944 the useful commands are bound to keystrokes for ease of use. Also, the
945 most popular commands are also available through the emacs menubar, and
946 finally, if available, a small subset are provided on the toolbar.
947 Where possible, keybindings are similar to other modes in emacs to
948 strive for a consistent user interface within emacs, regardless of the
949 details of which programming language is being edited, or process being
950 run.
952 <p>Some commands, such as <kbd>M-x R</kbd> can accept an optional `prefix'
953 argument. To specify the prefix argument, you would type <kbd>C-u</kbd>
954 before giving the command. e.g. If you type <kbd>C-u M-x R</kbd>, you will
955 be asked for command line options that you wish to invoke the R process
956 with.
958 <p>Emacs is often referred to as a `self-documenting' text editor. This
959 applies to ESS in two ways. First, limited documentation about each ESS
960 command can be obtained by typing <kbd>C-h f</kbd>. For example, if you type
961 <kbd>C-h f ess-eval-region</kbd>, documentation for that command will appear
962 in a separate *Help* buffer. Second, a complete list of keybindings
963 that are available in each ESS mode and brief description of that mode
964 is available by typing <kbd>C-h m</kbd> within an ESS buffer.
966 <p>Emacs is a versatile editor written in both C and lisp; ESS is written
967 in the Emacs lisp dialect (termed `elisp') and thus benefits from the
968 flexible nature of lisp. In particular, many aspects of ESS behaviour
969 can be changed by suitable customization of lisp variables. This manual
970 mentions some of the most frequent variables. A full list of them
971 however is available by using the Custom facility within emacs. (Type
972 <kbd>M-x customize-group RET ess RET</kbd> to get started.)
973 <a href="#Customization">Customization</a> provides details of common user variables you can
974 change to customize ESS to your taste, but it is recommended that you
975 defer this section until you are more familiar with ESS.
977 <!-- node-name, next, previous, up -->
978 <div class="node">
979 <p><hr>
980 <a name="Installation"></a>
981 Next:&nbsp;<a rel="next" accesskey="n" href="#Interactive-ESS">Interactive ESS</a>,
982 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
983 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
985 </div>
987 <h2 class="chapter">2 Installing ESS on your system</h2>
989 <p><a name="index-installation-9"></a>
990 The following section details those steps necessary to get ESS running
991 on your system.
993 <ul class="menu">
994 <li><a accesskey="1" href="#Unix-installation">Unix installation</a>: Installing ESS on your Unix system
995 <li><a accesskey="2" href="#Microsoft-Windows-installation">Microsoft Windows installation</a>: Installing ESS on your MS Windows system
996 <li><a accesskey="3" href="#Requirements">Requirements</a>: emacs, Operating Systems and Statistical Packages
997 </ul>
999 <!-- FIXME: the following contains @node s *and* is also included by readme.texi -->
1000 <!-- which does *not* include 'requires.texi' -->
1001 <!-- ==> *must* give node pointer problems! -->
1002 <p>We now discuss installation, which might happen under Unix or
1003 Microsoft Windows. First, we discuss Unix installation.
1004 See <a href="#Unix-installation">Unix installation</a>.
1006 <p>For Microsoft Windows Installation please skip to the
1007 See <a href="#Microsoft-Windows-installation">Microsoft Windows installation</a>.
1009 <div class="node">
1010 <p><hr>
1011 <a name="Unix-installation"></a>
1012 Next:&nbsp;<a rel="next" accesskey="n" href="#Microsoft-Windows-installation">Microsoft Windows installation</a>,
1013 Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
1015 </div>
1017 <!-- node-name, next, previous, up -->
1018 <h3 class="section">2.1 Unix installation</h3>
1020 <ol type=1 start=1>
1022 <li><code>cd</code> to a directory where you want to install ESS, creating it if necessary.
1023 This directory will be referred to below as <samp><span class="file">ESSDIR</span></samp>.
1024 <!-- It will contain, -->
1025 <!-- at the end, the tar file @file{ess-VERSION.tar.gz}, and a directory for -->
1026 <!-- the ESS source, which will be termed "the ESS-VERSION source directory". -->
1027 <!-- Note that the .elc files may be installed elsewhere (as specified in the -->
1028 <!-- Makefile) if desired. -->
1030 <li>Retrieve the latest version from
1031 <a href="http://ess.r-project.org/downloads/ess">ESS downloads area</a>
1032 to <samp><span class="file">ESSDIR</span></samp>.
1034 <li>Decompress/unarchive the files from the disribution.
1035 <pre class="display"> Either, <code>gunzip &lt; ess-VERSION.tar.gz | tar xf -</code>,
1036 or using GNU tar, <code>tar zxf ess-VERSION.tar.gz</code>.
1037 </pre>
1038 <p>The <code>tar</code> command will create the subdirectory <samp><span class="file">ess-VERSION</span></samp> and install
1039 the files there.
1041 <!-- If you are using GNU Emacs 19.29, decompress/unarchive -->
1042 <!-- @file{ESSDIR/ess-VERSION/lisp/19.29.tar.gz}, -->
1043 <!-- read @file{ESSDIR/ess-VERSION/lisp/19.29/README}, follow the instructions -->
1044 <!-- and you might be able to get ESS to work. -->
1045 <!-- @emph{Please note that GNU Emacs 19.29 is no longer supported}. -->
1046 <!-- For a list of supported versions of emacs, see @xref{Requirements}. -->
1047 <li>Edit the file <samp><span class="file">ESSDIR/ess-VERSION/lisp/ess-site.el</span></samp> as explained in the
1048 comments section of that file.
1049 <!-- Installations that are using ESS only for S-Plus -->
1050 <!-- 6.x will probably not need to make any changes. Installations that also -->
1051 <!-- have one or more of (S4, S+3/4/5/6/7, R, SAS, BUGS, XLispStat, Stata) -->
1052 <!-- may need to uncomment corresponding lines in @file{ESSDIR/ess-VERSION/lisp/ess-site.el}. -->
1054 <li> Add the line
1055 <pre class="example"> (load "ESSDIR/ess-VERSION/lisp/ess-site")
1056 </pre>
1057 <p>to your user or system installation file (GNU Emacs uses
1058 <samp><span class="file">$HOME/.emacs</span></samp> and XEmacs uses <samp><span class="file">$HOME/.xemacs/init.el</span></samp> for the
1059 user initialization file. GNU Emacs uses <samp><span class="file">default.el</span></samp> or
1060 <samp><span class="file">site-init.el</span></samp> and XEmacs uses <samp><span class="file">site-start.el</span></samp> for the system
1061 installation file).
1063 <p>Alternatively, if <samp><span class="file">ess-site.el</span></samp> is in your current <code>load-path</code>, then:
1064 <pre class="example"> (require 'ess-site)
1065 </pre>
1066 <p>to configure emacs for ESS.
1068 <li>That's it! If you are installing just a local copy of ESS for yourself,
1069 ESS is now ready to be used. (The remaining step below is for advanced
1070 installation.) To edit statistical programs, load the files with the
1071 requiste extensions (<samp><span class="file">.sas</span></samp> for SAS, <samp><span class="file">.S</span></samp> for S-PLUS,
1072 <samp><span class="file">.R</span></samp> for R, and <samp><span class="file">.lsp</span></samp> for XLispStat). To start a statistical
1073 process within emacs, such as R, type <code>M-x R</code>.
1075 <!-- @item -->
1076 <!-- (OPTIONAL) If you are running S-PLUS or R, you might consider -->
1077 <!-- installing the database files. From within emacs, @code{C-x d} to the -->
1078 <!-- directory containing ESS. Now: -->
1079 <!-- @example -->
1080 <!-- M-x S+6 -->
1081 <!-- @end example -->
1082 <!-- to get S running. Once you see the SPLUS prompt, do: -->
1083 <!-- @example -->
1084 <!-- M-x ess-create-object-name-db -->
1085 <!-- @end example -->
1086 <!-- (this will create the file @file{ess-sp6-namedb.el}; if it isn't in the -->
1087 <!-- ESS directory, move it there). -->
1088 <!-- Then, completions will be autoloaded and will not be regenerated for -->
1089 <!-- every session. -->
1090 <!-- For R, do the same, using -->
1091 <!-- @example -->
1092 <!-- M-x R -->
1093 <!-- @end example -->
1094 <!-- and then @code{M-x ess-create-object-name-db} creating -->
1095 <!-- @file{ess-r-namedb.el}; if it isn't in the ESS directory, move it there). -->
1096 <li><b>(OPTIONAL) READ THIS ITEM THOROUGHLY BEFORE STARTING</b>:
1098 <p>If you want to place the compiled files in other locations edit the
1099 <code>LISPDIR</code>, <code>INFODIR</code> and <code>ETCDIR</code> entries in Section 1 of
1100 <samp><span class="file">Makeconf</span></samp> in the <samp><span class="file">ESSDIR/ess-VERSION</span></samp> directory (if you are
1101 using XEmacs, then see the XEmacs subsection in Section 1 of <samp><span class="file">Makeconf</span></samp>).
1103 <p>You can compile those files by:
1104 <pre class="example"> make all
1105 </pre>
1106 <p>When that completes successfully, install the compiled files:
1107 <pre class="example"> make install
1108 </pre>
1109 <!-- This will install the compiled info files and lisp files. If you are an -->
1110 <!-- XEmacs user, then you should be done. If not, then you may have to -->
1111 <!-- edit/create the file @file{dir} that is found in the directory specified -->
1112 <!-- by @code{INFODIR}: see the sample @file{dir} in ESSDIR/ess-VERSION/doc/info. -->
1113 <!-- If @file{dir} does not exist in @code{INFODIR}, then the sample -->
1114 <!-- @file{dir} will be installed. -->
1115 <p><em>Note:</em> ESS is no longer available as an XEmacs package. However,
1116 ESS will work best if the XEmacs sumo tarball (all XEmacs packages combined)
1117 has been installed. For more information on installing XEmacs packages, see
1118 <a href="http://www.xemacs.org/Documentation/packageGuide.html">Quickstart Package Guide</a>.
1120 <!-- An alternative, if you are running XEmacs and have access to the -->
1121 <!-- XEmacs system directories, would be to place the directory in the -->
1122 <!-- site-lisp directory, and simply type @code{make all} (and copy the -->
1123 <!-- documentation as appropriate). -->
1124 <!-- For GNU Emacs, you would still have to move the files into the top level -->
1125 <!-- site-lisp directory. -->
1126 </ol>
1128 <!-- >>>> FIXME (see comment in ess.texi): error in ``makeinfo readme.texi'' -->
1129 <!-- @node Microsoft Windows installation, , Unix installation, Installation -->
1130 <div class="node">
1131 <p><hr>
1132 <a name="Microsoft-Windows-installation"></a>
1133 Next:&nbsp;<a rel="next" accesskey="n" href="#Requirements">Requirements</a>,
1134 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Unix-installation">Unix installation</a>,
1135 Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
1137 </div>
1139 <!-- node-name, next, previous, up -->
1140 <h3 class="section">2.2 Microsoft Windows installation</h3>
1142 <p>For <b>Microsoft Windows installation</b>, please follow the next steps:
1143 (see separate instructions above for UNIX See <a href="#Unix-installation">Unix installation</a>.
1145 <ol type=1 start=1>
1147 <li><code>cd</code> to a directory where you keep emacs lisp files, or create a
1148 new directory (for example, <samp><span class="file">c:\emacs\</span></samp>) to hold the distribution.
1149 This directory will be referred to below as "the ESS distribution
1150 directory". It will contain, at the end, a directory for the ESS
1151 source, which will be termed "the ESS-VERSION source directory".
1153 <li>Retrieve the latest zip file (<samp><span class="file">ess-VERSION.zip</span></samp>) from
1154 <a href="http://ess.r-project.org/downloads/ess">ESS downloads area</a> and
1155 store it in the ESS distribution directory. Be aware that http browsers
1156 on Windows frequently change the "." and "-" characters in filenames to
1157 other punctuation. Please change the names back to their original form.
1159 <li>Extract all the files from <samp><span class="file">ess-VERSION.zip</span></samp> into the ESS
1160 distribution directory. In Windows Explorer,
1161 you can unpack the archive by double clicking on the folder; you should
1162 then see a new folder called <samp><span class="file">ess-VERSION</span></samp>. Drag that folder into
1163 your ESS distribution directory.
1165 <li>Add the line
1166 <pre class="example"> (load "C:/emacs/ess-VERSION/lisp/ess-site")
1167 </pre>
1168 <p>to your emacs initialization file. (GNU Emacs uses the filename
1169 <samp><span class="file">~/.emacs</span></samp> and XEmacs uses the filename
1170 <samp><span class="file">~/.xemacs/init.el</span></samp> for the initialization file. The tilde is
1171 recognised by emacs as your HOME directory, i.e. the value of your HOME
1172 environment variable.) Replace
1173 <code>VERSION</code> above with the version number of ESS. Remember to use
1174 forwardslashes <code>/</code> rather than <code>\\</code> in your filename.
1176 <p>After saving your initialization file, ESS is now installed. Start a
1177 new emacs and you should be ready to use ESS. For example, to edit
1178 statistical programs, load the files with the requisite extensions
1179 (".sas" for SAS, ".S" or "s" or "q" or "Q" for S-PLUS, ".r" or ".R" for
1180 R, and ".lsp" for XLispStat). One further step is needed if you wish to
1181 run statistical processes, see below.
1183 <li>To run statistical processes under ESS, Windows users will need to make
1184 sure that the directories for the software they will be using is in the
1185 PATH environment variable. On Windows 9x, add lines similar to the
1186 following to your <samp><span class="file">c:\autoexec.bat</span></samp> file:
1187 <pre class="example"> path=%PATH%;c:\progra~1\spls2000\cmd
1188 </pre>
1189 <p>On Windows NT/2000/XP, add the directories to the PATH using the
1190 <code>My Computer/Control Panel/System/Advanced/Environment Variables</code> menu.
1191 Note that the directory containing the program is
1192 added to the PATH, not the program itself. One such line is needed
1193 for each software program. Be sure to use the abbreviation
1194 <code>progra~1</code> and not the long version with embedded blanks. Use
1195 backslashes "\".
1197 <p>An alternative, for R users, is that rather than adjusting the PATH
1198 variable, you can add the following to your emacs initialization file
1199 (and restart emacs):
1200 <pre class="example"> (setq inferior-R-program-name "C:/progra~1/R/R-2.2.1/bin/Rterm.exe")
1201 </pre>
1202 <p>This assumes that you have installed R-2.2.1 in the default location.
1203 Change the path otherwise to point to other locations.
1205 <p>To start the S-PLUS [67].x GUI from ESS under emacs:
1206 <pre class="example"> M-x S
1207 (or <code>M-x S+6</code>).
1208 </pre>
1209 <p>You will then be
1210 asked for a pathname ("S starting data directory?"), from which to
1211 start the process. The prompt will propose your current directory
1212 as the default. ESS will start the S-PLUS GUI. There will be
1213 slight delay during which emacs is temporarily frozen. ESS will arrange for
1214 communication with the S-PLUS GUI using the DDE protocol.
1215 Send lines or regions
1216 from the emacs buffer containing your S program (for example,
1217 <samp><span class="file">myfile.s</span></samp>) to the S-PLUS Commands Window with the
1218 <code>C-c C-n</code> or <code>C-c C-r</code> keys.
1219 (If you are still using S-PLUS 4.x or 2000, then use <code>M-x S+4</code>.)
1221 <p>To start an S-PLUS [67].x session inside an emacs buffer&mdash;and
1222 without the S-PLUS GUI:
1223 <pre class="example"> M-x Sqpe
1224 (or <code>M-x Sqpe+6</code>).
1225 </pre>
1226 <p>You will then be asked for a pathname ("S starting data
1227 directory?"), from which to start the process. The prompt will
1228 propose your current directory as the default.
1229 You get Unix-like behavior, in particular the entire
1230 transcript is available for emacs-style search commands.
1231 Send lines or regions from the emacs buffer containing your S
1232 program (for example, <samp><span class="file">myfile.s</span></samp>) to the *S+6* buffer with the
1233 <code>C-c C-n</code> or <code>C-c C-r</code> keys.
1234 Interactive graphics are available with Sqpe by using the java
1235 library supplied with S-PLUS 6.1 and newer releases.
1236 Enter the commands:
1237 <pre class="example"> library(winjava)
1238 java.graph()
1239 </pre>
1240 <p>Graphs can be saved from the <code>java.graph</code> device
1241 in several formats, but not PostScript. If you
1242 need a PostScript file you will need to open a separate
1243 <code>postscript</code> device.
1244 (If you are still using S-PLUS 4.x or 2000, then use <code>M-x Sqpe+4</code>.)
1246 <p>To connect to an already running S-PLUS GUI (started, for example,
1247 from the S-PLUS icon):
1248 <pre class="example"> M-x S+6-existing
1249 </pre>
1250 <p>You will then be
1251 asked for a pathname ("S starting data directory?"), from which to
1252 start the process. The prompt will propose your current directory
1253 as the default. ESS will arrange for
1254 communication with the already running S-PLUS GUI using the DDE protocol.
1255 Send lines or regions
1256 from the emacs buffer containing your S program (for example,
1257 <samp><span class="file">myfile.s</span></samp>) to the S-PLUS Commands Window with the
1258 <code>C-c C-n</code> or <code>C-c C-r</code> keys.
1259 (If you are still using S-PLUS 4.x or 2000, then use <code>M-x S+4-existing</code>.)
1261 <p>If you wish to run R, you can start it with:
1262 <pre class="example"> M-x R
1263 </pre>
1264 <p>XLispStat can not currently be run with
1265 <pre class="example"> M-x XLS
1266 </pre>
1267 <p>Hopefully, this will change. However, you can still edit with
1268 emacs, and cut and paste the results into the XLispStat
1269 *Listener* Window under Microsoft Windows.
1271 <!-- SAS for Windows uses the batch access with function keys that is -->
1272 <!-- described in -->
1273 <!-- @file{doc/README.SAS}. -->
1274 <!-- @xref{ESS(SAS)-MS Windows}. -->
1275 <!-- The user can also edit SAS files -->
1276 <!-- in an @code{ESS[SAS]} buffer and than manually copy and paste them into -->
1277 <!-- an Editor window in the SAS Display Manager. -->
1278 <!-- For Windows, inferior SAS in an @code{@iESS{[SAS]}} buffer does not work -->
1279 <!-- on the local machine. It does work over a network connection to -->
1280 <!-- SAS running on a remote Unix computer. -->
1281 <!-- Reason: we use ddeclient to interface with programs and SAS doesn't -->
1282 <!-- provide the corresponding ddeserver capability. -->
1283 <!-- @item -->
1284 <!-- (OPTIONAL) If you are running Sqpe or R, you might consider -->
1285 <!-- installing the database files. From within emacs, @code{C-x d} to -->
1286 <!-- the directory containing ESS. Now: -->
1287 <!-- @example -->
1288 <!-- M-x Sqpe+6 -->
1289 <!-- @end example -->
1290 <!-- to get S running. Once you see the SPLUS prompt, do: -->
1291 <!-- @example -->
1292 <!-- M-x ess-create-object-name-db -->
1293 <!-- @end example -->
1294 <!-- (this will create the file @file{ess-s+6-namedb.el}; if it isn't in the -->
1295 <!-- ESS directory, move it there). -->
1296 <!-- Then, completions will be autoloaded and will not be regenerated -->
1297 <!-- for every session. -->
1298 <!-- For R, do the same, using -->
1299 <!-- @example -->
1300 <!-- M-x R -->
1301 <!-- @end example -->
1302 <!-- and then @code{M-x ess-create-object-name-db} creating -->
1303 <!-- @file{ess-r-namedb.el}; if it isn't in the ESS directory, move it -->
1304 <!-- there). -->
1305 <li>That's it!
1307 </ol>
1308 <!-- Requirements duplicated? -->
1309 <!-- @node Requirements, , Microsoft Windows installation, Installation -->
1310 <!-- node-name, next, previous, up -->
1311 <!-- @section Requirements -->
1312 <!-- @include requires.texi -->
1314 <div class="node">
1315 <p><hr>
1316 <a name="Requirements"></a>
1317 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Microsoft-Windows-installation">Microsoft Windows installation</a>,
1318 Up:&nbsp;<a rel="up" accesskey="u" href="#Installation">Installation</a>
1320 </div>
1322 <!-- node-name, next, previous, up -->
1323 <h3 class="section">2.3 Requirements</h3>
1325 <p>ESS has been tested with
1327 <ul>
1328 <li>R &gt;=0.49
1329 <li>S-PLUS 3.3-4, 4.5, 5.0-1, 6.0-2, 7.0, 2000
1330 <li>S4
1331 <li>SAS &gt;=6.12
1332 <li>BUGS 0.5, 0.603
1333 <li>Stata &gt;=6.0
1334 <li>XLispStat &gt;=3.50
1335 </ul>
1337 <p>on the following platforms
1339 <ul>
1340 <li>Linux (all)
1341 <li>Solaris/SunOS (all)
1342 <!-- cannot confirm this right now @item SGI (all) -->
1343 <li>Microsoft Windows 95/98/NT/2000/XP (R, SPLUS 4.5/6.0-2/7.0/2000, SAS and BUGS)
1344 <li>Apple Mac OS (SAS for OS 9 and R for OS X)
1345 </ul>
1347 <p>with the following versions of emacs
1349 <ul>
1350 <li>GNU Emacs 20.3-7, 21.1, 21.3-4, 22.0.50-pretesting
1351 <li>XEmacs 21.0, 21.1.13-14, 21.4.0-8, 21.4.9-13<a rel="footnote" href="#fn-1" name="fnd-1"><sup>1</sup></a>, 21.4.14-15, 21.4.17-18, 21.5.23
1352 <!-- @item GNU Emacs <20.3 and XEmacs <21.0@footnote{These releases of emacs are no -->
1353 <!-- longer supported, so an upgrade is recommended if you plan to use ESS. -->
1354 <!-- If you have GNU Emacs 19.29, see @xref{Unix installation}. Also, note -->
1355 <!-- that the `custom' library bundled with Emacs 19.34 is too _old_, its API is -->
1356 <!-- incompatible with the `new custom' bundled with recent Emacsen. -->
1357 <!-- The `new custom' for Emacs 19.34 is available for download -->
1358 <!-- @uref{ftp://ftp.dina.kvl.dk/pub/Staff/Per.Abrahamsen/custom/custom-1.9962.tar.gz, here}.} -->
1359 </ul>
1361 <!-- node-name, next, previous, up -->
1362 <div class="node">
1363 <p><hr>
1364 <a name="Interactive-ESS"></a>
1365 Next:&nbsp;<a rel="next" accesskey="n" href="#Entering-commands">Entering commands</a>,
1366 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Installation">Installation</a>,
1367 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1369 </div>
1371 <h2 class="chapter">3 Interacting with statistical programs</h2>
1373 <p>As well as using ESS to edit your source files for statistical programs,
1374 you can use ESS to run these statistical programs. In this chapter, we
1375 mostly will refer by example to running S from within emacs. The emacs
1376 convention is to name such processes running under its control as
1377 `inferior processes'. This term can be slightly misleading, in which
1378 case these processes can be thought of `interactive processes'. Either
1379 way, we use the term `iESS' to refer to the Emacs mode used to interact
1380 with statistical programs.
1382 <!-- node-name, next, previous, up -->
1383 <ul class="menu">
1384 <li><a accesskey="1" href="#Starting-up">Starting up</a>
1385 <li><a accesskey="2" href="#Multiple-ESS-processes">Multiple ESS processes</a>
1386 <li><a accesskey="3" href="#ESS-processes-on-Remote-Computers">ESS processes on Remote Computers</a>
1387 <li><a accesskey="4" href="#S_002belsewhere-and-ESS_002delsewhere">S+elsewhere and ESS-elsewhere</a>
1388 <li><a accesskey="5" href="#Customizing-startup">Customizing startup</a>
1389 </ul>
1391 <div class="node">
1392 <p><hr>
1393 <a name="Starting-up"></a>
1394 Next:&nbsp;<a rel="next" accesskey="n" href="#Multiple-ESS-processes">Multiple ESS processes</a>,
1395 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Interactive-ESS">Interactive ESS</a>,
1396 Up:&nbsp;<a rel="up" accesskey="u" href="#Interactive-ESS">Interactive ESS</a>
1398 </div>
1400 <h3 class="section">3.1 Starting an ESS process</h3>
1402 <p><a name="index-starting-ESS-10"></a><a name="index-running-S-11"></a>
1403 To start an S session, simply type <kbd>M-x S RET</kbd>.
1404 <a name="index-S-12"></a>
1405 <a name="index-ESS-process-directory-13"></a><a name="index-starting-directory-14"></a><a name="index-working-directory-15"></a><a name="index-directories-16"></a>
1406 S will then (by default) ask the question
1407 <pre class="example"> S starting data directory?
1408 </pre>
1409 <p class="noindent">Enter the name of the directory you wish to start S from (that is,
1410 the directory you would have <code>cd</code>'d to before starting S from
1411 the shell). This directory should have a <samp><span class="file">.Data</span></samp> subdirectory.
1413 <p>You will then be popped into a buffer
1414 <a name="index-ESS-process-buffer-17"></a><a name="index-process-buffer-18"></a>with name `<samp><span class="samp">*S*</span></samp>' which will be used
1415 for interacting with the ESS process, and you can start entering commands.
1417 <!-- node-name, next, previous, up -->
1418 <div class="node">
1419 <p><hr>
1420 <a name="Multiple-ESS-processes"></a>
1421 Next:&nbsp;<a rel="next" accesskey="n" href="#ESS-processes-on-Remote-Computers">ESS processes on Remote Computers</a>,
1422 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Starting-up">Starting up</a>,
1423 Up:&nbsp;<a rel="up" accesskey="u" href="#Interactive-ESS">Interactive ESS</a>
1425 </div>
1427 <h3 class="section">3.2 Running more than one ESS process</h3>
1429 <p><a name="index-Multiple-ESS-processes-19"></a>
1430 ESS allows you to run more than one ESS process simultaneously in the
1431 same session. Each process has a name and a number; the initial process
1432 <a name="index-process-names-20"></a>(process 1) is simply named (using S-PLUS as an example) `<samp><span class="samp">S+3:1</span></samp>'.
1433 <!-- You may start a new process by passing a numeric argument to -->
1434 <!-- @kbd{M-x S}. For example, typing @kbd{ESC 2 M-x S} starts up -->
1435 <!-- an ESS process with name @samp{S2}, in a buffer whose name -->
1436 <!-- is initially @samp{*S2*}. -->
1437 The name of the process is shown in the mode line in square brackets
1438 (for example, `<samp><span class="samp">[S+3:2]</span></samp>'); this is useful if the process buffer is
1439 renamed. Without a prefix argument, <kbd>M-x S</kbd> starts a new ESS
1440 process, using the first available process number. With a prefix
1441 argument (for R), <kbd>C-u M-x R</kbd> allows for the specification of
1442 command line options.
1444 <p><a name="index-ess_002drequest_002da_002dprocess-21"></a>You can switch to any active ESS process with the command
1445 `<samp><span class="samp">M-x ess-request-a-process</span></samp>'. Just enter the name of the process
1446 you require; completion is provided over the names of all running S
1447 processes. This is a good command to consider binding to a global key.
1449 <!-- SJE - commented outl the default behaviour now is to label *S* rather -->
1450 <!-- than *S:1*. -->
1451 <!-- @vindex ess-plain-first-buffername -->
1452 <!-- For the predecessor to ESS (S-mode 4.8), the initial process was not -->
1453 <!-- visibly numbered, i.e. S instead of S1 was used in the mode-line. To -->
1454 <!-- obtain this behavior, set the variable @code{ess-plain-first-buffername} -->
1455 <!-- to @code{t}. See @file{ess-site} for how to set this for all users. -->
1456 <!-- node-name, next, previous, up -->
1457 <div class="node">
1458 <p><hr>
1459 <a name="ESS-processes-on-Remote-Computers"></a>
1460 Next:&nbsp;<a rel="next" accesskey="n" href="#S_002belsewhere-and-ESS_002delsewhere">S+elsewhere and ESS-elsewhere</a>,
1461 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Multiple-ESS-processes">Multiple ESS processes</a>,
1462 Up:&nbsp;<a rel="up" accesskey="u" href="#Interactive-ESS">Interactive ESS</a>
1464 </div>
1466 <h3 class="section">3.3 ESS processes on Remote Computers</h3>
1468 <p><a name="index-Remote-Computers-22"></a><a name="index-ess_002dremote-23"></a><a name="index-ESS_002delsewhere-24"></a><a name="index-S_002belsewhere-25"></a>
1469 ESS works with processes on remote computers as easily as with
1470 processes on the local machine. The recommended way to access a
1471 statistical program on remote computer is to start it from a telnet or
1472 ssh buffer and then connect ESS to that buffer.
1474 <ol type=1 start=1>
1475 <li>Start a new telnet or ssh buffer and connect to the remote computer
1476 (e.g. use `<samp><span class="samp">M-x telnet</span></samp>' or `<samp><span class="samp">M-x ssh</span></samp>'; ssh.el is available at
1477 <a href="ftp://ftp.splode.com/pub/users/friedman/emacs-lisp/ssh.el">ftp://ftp.splode.com/pub/users/friedman/emacs-lisp/ssh.el</a>).
1479 <li>Start the ESS process on the remote machine, for example with one of
1480 the commands `<samp><span class="samp">Splus</span></samp>', or `<samp><span class="samp">R</span></samp>', or `<samp><span class="samp">sas -stdio</span></samp>'.
1482 <li>Enter the ESS command `<samp><span class="samp">M-x ess-remote</span></samp>'. You will be prompted for
1483 a program name. Enter `<samp><span class="samp">sp6</span></samp>' or `<samp><span class="samp">r</span></samp>' or `<samp><span class="samp">sas</span></samp>' or another
1484 valid name. Your telnet process is now known to ESS. All the usual
1485 ESS commands (`<samp><span class="samp">C-c C-n</span></samp>' and its relatives) now work with the S
1486 language processes. For SAS you need to use a different command
1487 `<samp><span class="samp">C-c i</span></samp>' (that is a regular `<samp><span class="samp">i</span></samp>', not a `<samp><span class="samp">C-i</span></samp>') to send
1488 lines from your <samp><span class="file">myfile.sas</span></samp> to the remote SAS process.
1489 `<samp><span class="samp">C-c i</span></samp>' sends lines over invisibly.
1490 <!-- and lets SAS display them formatted correctly as in a SAS log file. -->
1491 With ess-remote you get teletype behavior&mdash;the data input, the
1492 log, and the listing all appear in the same buffer. To make this work,
1493 you need to end every PROC and DATA step with a "RUN;" statement. The
1494 "RUN;" statement is what tells SAS that it should process the preceding
1495 input statements.
1497 <li>Graphics (interactive) on the remote machine. If you run X11
1498 (See <a href="#X11">X11</a>, X-windows)
1499 on both the local and remote machines then you should be able to
1500 display the graphs locally by setting the `<samp><span class="samp">DISPLAY</span></samp>' environment
1501 variable appropriately. Windows users can download `<samp><span class="samp">xfree86</span></samp>'
1502 from cygwin.
1504 <li>Graphics (static) on the remote machine.
1505 If you don't run the X window system on the local machine, then you can write
1506 graphics to a file on the remote machine, and display the file in
1507 a graphics viewer on the local machine. Most statistical software can
1508 write one or more of postscript, GIF, or JPEG files.
1509 Depending on the versions of emacs and the operating system that you
1510 are running, emacs itself may display `<samp><span class="samp">.gif</span></samp>' and `<samp><span class="samp">.jpg</span></samp>'
1511 files. Otherwise, a graphics file viewer will be needed.
1512 Ghostscript/ghostview may be downloaded to display `<samp><span class="samp">.ps</span></samp>' and
1513 `<samp><span class="samp">.eps</span></samp>' files. Viewers for GIF and JPEG are usually included with
1514 operating systems. See <a href="#ESS_0028SAS_0029_002d_002dFunction-keys-for-batch-processing">ESS(SAS)&ndash;Function keys for batch processing</a>,
1515 for more information on using the F12 key for displaying graphics files
1516 with SAS.
1517 </ol>
1519 <p>Should you or a colleague inadvertently start a statistical process in
1520 an ordinary `<samp><span class="samp">*shell*</span></samp>' buffer, the `<samp><span class="samp">ess-remote</span></samp>' command can
1521 be used to convert it to an ESS buffer and allow you to use the ESS
1522 commands with it.
1524 <p>We have two older commands, now deprecated, for accessing ESS processes
1525 on remote computers.
1526 See <a href="#S_002belsewhere-and-ESS_002delsewhere">S+elsewhere and ESS-elsewhere</a>.
1528 <!-- node-name, next, previous, up -->
1529 <div class="node">
1530 <p><hr>
1531 <a name="S+elsewhere-and-ESS-elsewhere"></a>
1532 <a name="S_002belsewhere-and-ESS_002delsewhere"></a>
1533 Next:&nbsp;<a rel="next" accesskey="n" href="#Customizing-startup">Customizing startup</a>,
1534 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS-processes-on-Remote-Computers">ESS processes on Remote Computers</a>,
1535 Up:&nbsp;<a rel="up" accesskey="u" href="#Interactive-ESS">Interactive ESS</a>
1537 </div>
1539 <h3 class="section">3.4 S+elsewhere and ESS-elsewhere</h3>
1541 <p>These commands are now deprecated. We recommend `<samp><span class="samp">ess-remote</span></samp>'. We
1542 have two versions of the elsewhere function. `<samp><span class="samp">S+elsewhere</span></samp>' is
1543 specific for the S-Plus program. The more general function
1544 `<samp><span class="samp">ESS-elsewhere</span></samp>' is not as stable.
1546 <ol type=1 start=1>
1547 <li>Enter `<samp><span class="samp">M-x S+elsewhere</span></samp>'.
1548 You will be prompted for a starting directory. I usually give it my
1549 project directory on the local machine, say `<samp><span class="samp">~myname/myproject/</span></samp>'
1551 <p>Or enter `<samp><span class="samp">M-x ESS-elsewhere</span></samp>'. You will be prompted for an ESS
1552 program and for a starting directory. I usually give it my project
1553 directory on the local machine, say `<samp><span class="samp">~myname/myproject/</span></samp>'
1555 <li>The `<samp><span class="samp">*S+3*</span></samp>' buffer will appear with a prompt from the
1556 local operating system (the unix prompt on a unix workstation or with
1557 cygwin bash on a PC, or the msdos prompt on a PC without bash). emacs
1558 may freeze because the cursor is at the wrong place. Unfreeze it with
1559 `<samp><span class="samp">C-g</span></samp>' then move the cursor to the end with `<samp><span class="samp">M-&gt;</span></samp>'.
1560 With `<samp><span class="samp">S+elsewhere</span></samp>' the buffer name is based on the name of the ESS program.
1561 <li>Enter
1562 `<samp><span class="samp">telnet myname@other.machine</span></samp>' (or `<samp><span class="samp">ssh myname@other.machine</span></samp>').
1563 You will be prompted for your password on the remote machine.
1565 `<samp><span class="samp">M-x send-invisible</span></samp>'
1566 before typing the password itself.
1568 <li>Before starting the ESS process, type `<samp><span class="samp">stty -echo nl</span></samp>'
1569 at the unix prompt. The `<samp><span class="samp">-echo</span></samp>' turns off the echo, the
1570 `<samp><span class="samp">nl</span></samp>' turns off the newline that you see as `<samp><span class="samp">^M</span></samp>'.
1572 <li>You are now talking to the unix prompt on the other machine in the
1573 `<samp><span class="samp">*S+3*</span></samp>' buffer. cd into the directory for the current project and start
1574 the ESS process by entering
1575 `<samp><span class="samp">Splus</span></samp>' or `<samp><span class="samp">R</span></samp>' or `<samp><span class="samp">sas -stdio</span></samp>'
1576 as appropriate. If you can login remotely to your Windows 2000, then
1577 you should be able to run `<samp><span class="samp">Sqpe</span></samp>' on the Windows machine. I haven't
1578 tested this and noone has reported their tests to me. You will not be
1579 able to run the GUI through this text-only connection.
1581 <li>Once you get the S or R or SAS prompt, then you are completely connected.
1582 All the `<samp><span class="samp">C-c C-n</span></samp>' and related commands work correctly in sending
1583 commands from `<samp><span class="samp">myfile.s</span></samp>' or `<samp><span class="samp">myfile.r</span></samp>' on the PC to the
1584 `<samp><span class="samp">*S+3*</span></samp>' buffer running the S or R or SAS program on the remote machine.
1586 <li>Graphics on the remote machine works fine. If you run the X window
1587 system on the remote unix machine you should be able to display them in
1588 `<samp><span class="samp">xfree86</span></samp>' on your PC. If you don't run X11, then you can write
1589 graphics to the postscript device and copy it to your PC with dired and
1590 display it with ghostscript.
1591 </ol>
1593 <!-- node-name, next, previous, up -->
1594 <div class="node">
1595 <p><hr>
1596 <a name="Customizing-startup"></a>
1597 Previous:&nbsp;<a rel="previous" accesskey="p" href="#S_002belsewhere-and-ESS_002delsewhere">S+elsewhere and ESS-elsewhere</a>,
1598 Up:&nbsp;<a rel="up" accesskey="u" href="#Interactive-ESS">Interactive ESS</a>
1600 </div>
1602 <h3 class="section">3.5 Changing the startup actions</h3>
1604 <p>If you do not wish ESS to prompt for a starting directory when starting
1605 a new process, set the variable <code>ess-ask-for-ess-directory</code> to
1606 <a name="index-ess_002dask_002dfor_002dess_002ddirectory-26"></a><code>nil</code>. In this case, the value of the variable <code>ess-directory</code>
1607 <a name="index-ess_002ddirectory-27"></a>is used as the starting directory. The default value for this variable
1608 is your home directory. If <code>ess-ask-for-ess-directory</code> has a
1609 non-<code>nil</code> value (as it does by default) then the value of
1610 <code>ess-directory</code> provides the default when prompting for the
1611 starting directory. Incidentally, <code>ess-directory</code> is an ideal
1612 variable to set in <code>ess-pre-run-hook</code>.
1614 <p>If you like to keep a record of your S sessions, set the variable
1615 <code>ess-ask-about-transfile</code> to <code>t</code>, and you will be asked for a
1616 filename for the transcript before the ESS process starts.
1618 <div class="defun">
1619 &mdash; User Option: <b>ess-ask-about-transfile</b><var><a name="index-ess_002dask_002dabout_002dtransfile-28"></a></var><br>
1620 <blockquote><p>If non-<code>nil</code>, as for a file name in which to save the session
1621 transcript.
1622 </p></blockquote></div>
1624 <p><a name="index-transcript-file-29"></a>Enter the name of a file in which to save the transcript at the prompt.
1625 If the file doesn't exist it will be created (and you should give it a
1626 file name ending in `<samp><span class="samp">.St</span></samp>'); if the file already exists the
1627 transcript will be appended to the file. (Note: if you don't set this
1628 variable but you still want to save the transcript, you can still do it
1629 later &mdash; see <a href="#Saving-transcripts">Saving transcripts</a>.)
1631 <p>Once these questions are answered (if they are asked at all) the S
1632 process itself is started by calling the program name specified in the
1633 variable <code>inferior-ess-program</code>.
1634 <a name="index-inferior_002dess_002dprogram-30"></a>If you need to pass any arguments to this program, they may be specified
1635 in the variable <code>inferior-</code><var>S_program_name</var><code>-args</code> (e.g. if
1636 <code>inferior-ess-program</code> is <code>"S+"</code> then the variable to set is
1637 <code>inferior-S+-args</code>.
1638 <a name="index-arguments-to-S-program-31"></a>It is not normally necessary to pass arguments to the S program; in
1639 particular do not pass the `<samp><span class="samp">-e</span></samp>' option to <code>Splus</code>, since ESS
1640 provides its own command history mechanism.
1642 <p>By default, the new process will be displayed in the same window in the
1643 current frame. If you wish your S process to appear in a separate
1644 variable, customize the variable <code>inferior-ess-own-frame</code>.
1645 Alternatively, change <code>inferior-ess-same-window</code> if you wish the
1646 process to appear within another window of the current frame.
1648 <!-- node-name, next, previous, up -->
1649 <div class="node">
1650 <p><hr>
1651 <a name="Entering-commands"></a>
1652 Next:&nbsp;<a rel="next" accesskey="n" href="#Transcript-Mode">Transcript Mode</a>,
1653 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Interactive-ESS">Interactive ESS</a>,
1654 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1656 </div>
1658 <h2 class="chapter">4 Interacting with the ESS process</h2>
1660 <p><a name="index-entering-commands-32"></a><a name="index-commands-33"></a><a name="index-sending-input-34"></a>
1661 The primary function of the ESS package is to provide an easy-to-use
1662 front end to the S interpreter. This is achieved by running the S
1663 process from within an Emacs buffer, so that the Emacs editing commands
1664 are available to correct mistakes in commands, etc. The features of
1665 Inferior S mode are similar to those provided by the standard Emacs
1666 shell mode (see <a href="emacs.html#Shell-Mode">Shell Mode</a>). Command-line completion of S objects and a number of `hot
1667 keys' for commonly-used S commands are also provided for ease of
1668 typing.
1670 <ul class="menu">
1671 <li><a accesskey="1" href="#Command_002dline-editing">Command-line editing</a>: Entering commands and fixing mistakes
1672 <li><a accesskey="2" href="#Completion">Completion</a>: Completion of object names
1673 <li><a accesskey="3" href="#Completion-details">Completion details</a>: Advanced completion concepts
1674 <li><a accesskey="4" href="#Transcript">Transcript</a>: Manipulating the transcript
1675 <li><a accesskey="5" href="#Command-History">Command History</a>: Command History
1676 <li><a accesskey="6" href="#History-expansion">History expansion</a>: References to historical commands
1677 <li><a accesskey="7" href="#Hot-keys">Hot keys</a>: Hot keys for common commands
1678 <li><a accesskey="8" href="#Statistical-Process-running-in-ESS_003f">Statistical Process running in ESS?</a>
1679 <li><a accesskey="9" href="#Emacsclient">Emacsclient</a>: Using emacsclient
1680 <li><a href="#Other">Other</a>: Other commands provided by inferior-ESS
1681 </ul>
1683 <!-- node-name, next, previous, up -->
1684 <div class="node">
1685 <p><hr>
1686 <a name="Command-line-editing"></a>
1687 <a name="Command_002dline-editing"></a>
1688 Next:&nbsp;<a rel="next" accesskey="n" href="#Completion">Completion</a>,
1689 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Entering-commands">Entering commands</a>,
1690 Up:&nbsp;<a rel="up" accesskey="u" href="#Entering-commands">Entering commands</a>
1692 </div>
1694 <h3 class="section">4.1 Entering commands and fixing mistakes</h3>
1696 <p><a name="index-command_002dline-editing-35"></a>
1697 Sending a command to the ESS process is as simple as typing it in
1698 and pressing the &lt;RETURN&gt; key:
1700 <ul>
1701 <li><kbd>RET</kbd> (<code>inferior-ess-send-input</code>) <br>
1702 <a name="index-inferior_002dess_002dsend_002dinput-36"></a>Send the command on the current line to the ESS process.
1703 </ul>
1705 <p>If you make a typing error before pressing <kbd>RET</kbd> all the usual Emacs
1706 editing commands are available to correct it (see <a href="emacs.html#Basic">Basic</a>). Once the
1707 command has been corrected you can press &lt;RETURN&gt; (even if the
1708 cursor is not at the end of the line) to send the corrected command to
1709 the ESS process.
1711 <p>ESS provides some other commands which are useful for fixing mistakes:
1713 <ul>
1714 <li><kbd>C-c C-w</kbd> (<code>backward-kill-word</code>) <br>
1715 <a name="index-backward_002dkill_002dword-37"></a>Deletes the previous word (such as an object name) on the command line.
1717 <li><kbd>C-c C-u</kbd> (<code>comint-kill-input</code>) <br>
1718 <a name="index-comint_002dkill_002dinput-38"></a>Deletes everything from the prompt to point. Use this to abandon a
1719 command you have not yet sent to the ESS process.
1721 <li><kbd>C-c C-a</kbd> (<code>comint-bol</code>) <br>
1722 <a name="index-comint_002dbol-39"></a>Move to the beginning of the line, and then skip forwards past the
1723 prompt, if any.
1724 </ul>
1726 <p>See <a href="emacs.html#Shell-Mode">Shell Mode</a>, for other
1727 commands relevant to entering input.
1729 <!-- node-name, next, previous, up -->
1730 <div class="node">
1731 <p><hr>
1732 <a name="Completion"></a>
1733 Next:&nbsp;<a rel="next" accesskey="n" href="#Completion-details">Completion details</a>,
1734 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Command_002dline-editing">Command-line editing</a>,
1735 Up:&nbsp;<a rel="up" accesskey="u" href="#Entering-commands">Entering commands</a>
1737 </div>
1739 <h3 class="section">4.2 Completion of object names</h3>
1741 <p><a name="index-completion-of-object-names-40"></a><a name="index-command_002dline-completion-41"></a>
1742 In the process buffer, the &lt;TAB&gt; key is for completion, similar to
1743 that provided by Shell Mode for filenames. In Inferior S mode,
1744 pressing the &lt;TAB&gt; key when the cursor is following the first few
1745 characters of an object name <em>completes</em> the object name; if the
1746 cursor is following a file name <kbd>TAB</kbd> completes the file name.
1748 <ul>
1749 <li><kbd>TAB</kbd> (<code>comint-dynamic-complete</code>) <br>
1750 <a name="index-comint_002ddynamic_002dcomplete-42"></a>Complete the S object name or filename before point.
1751 </ul>
1753 <p>When the cursor is just after a partially-completed object name,
1754 pressing &lt;TAB&gt; provides completion in a similar fashion to
1755 <code>tcsh</code>
1756 <a name="index-tcsh-43"></a>except that completion is performed over all known S object names
1757 instead of file names. ESS maintains a list of all objects known to S
1758 at any given time, which basically consists of all objects (functions
1759 and datasets) in every attached directory listed by the <code>search()</code>
1760 command
1761 <a name="index-search_0028_0029-44"></a>along with the component objects of attached data frames
1762 <a name="index-data-frames-45"></a>(if your version of S supports them).
1764 <p>For example, consider the three functions (available in Splus version
1765 3.0) called <code>binomplot()</code>, <code>binom.test()</code> and
1766 <code>binomial()</code>. Typing <kbd>bin TAB</kbd> after the S prompt will
1767 insert the characters `<samp><span class="samp">om</span></samp>', completing the longest prefix
1768 (`<samp><span class="samp">binom</span></samp>') which distinguishes these three commands. Pressing
1769 <kbd>TAB</kbd> once more provides a list of the three commands which have
1770 this prefix, allowing you to add more characters (say, `<samp><span class="samp">.</span></samp>') which
1771 specify the function you desire. After entering more characters
1772 pressing <kbd>TAB</kbd> yet again will complete the object name up to
1773 uniqueness, etc. If you just wish to see what completions exist without
1774 adding any extra characters, type <kbd>M-?</kbd>.
1776 <ul>
1777 <li><kbd>M-?</kbd> (<code>ess-list-object-completions</code>) <br>
1778 <a name="index-ess_002dlist_002dobject_002dcompletions-46"></a>List all possible completions of the object name at point.
1779 </ul>
1781 <p>ESS also provides completion over the components of named lists accessed
1782 using the `<samp><span class="samp">$</span></samp>' notation, to any level of nested lists. This feature
1783 is particularly useful for checking what components of a list object
1784 exist while partway through entering a command: simply type the object
1785 name and `<samp><span class="samp">$</span></samp>' and press <kbd>TAB</kbd> to see the names of existing list
1786 components for that object.
1787 <a name="index-lists_002c-completion-on-47"></a><a name="index-completion-on-lists-48"></a>
1788 <a name="index-completion-on-file-names-49"></a>Completion is also provided over file names, which is particularly
1789 useful when using S functions such as <code>get()</code> or <code>scan()</code>
1790 which require fully expanded file names. Whenever the cursor is within
1791 an S string, pressing <kbd>TAB</kbd> completes the file name before
1792 point, and also expands any `<samp><span class="samp">~</span></samp>' or environment variable references.
1794 <p>If the cursor is not in a string and does not follow a (partial) object
1795 name, the &lt;TAB&gt; key has a third use: it expands history references.
1796 See <a href="#History-expansion">History expansion</a>.
1798 <!-- node-name, next, previous, up -->
1799 <div class="node">
1800 <p><hr>
1801 <a name="Completion-details"></a>
1802 Next:&nbsp;<a rel="next" accesskey="n" href="#Transcript">Transcript</a>,
1803 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Completion">Completion</a>,
1804 Up:&nbsp;<a rel="up" accesskey="u" href="#Entering-commands">Entering commands</a>
1806 </div>
1808 <h3 class="section">4.3 Completion details</h3>
1810 <p>ESS automatically keeps track of any objects added or deleted to the
1811 system (such as new objects created, or directories added to the search
1812 list) to make completion as accurate as possible. Whenever ESS notices
1813 that search list has changed
1814 <a name="index-ess_002dchange_002dsp_002dregexp-50"></a><a rel="footnote" href="#fn-2" name="fnd-2"><sup>2</sup></a> when you attach a directory or data
1815 frame, the objects associated with it immediately become available for a
1816 completion; when it is detached completion is no longer available on
1817 those objects.
1819 <p>To maintain a list of accessible objects for completion, ESS needs to
1820 determine which objects are contained in each directory or data frame on
1821 the search list. This is done at the start of each S session, by
1822 running the <code>objects()</code> command on every element of the search
1823 list.
1825 <!-- On some systems, however, this can be rather slow; it's doubly -->
1826 <!-- frustrating when you consider that most of the directories on the search -->
1827 <!-- list are the standard @Sl{} libraries, which never change anyway! When -->
1828 <!-- ESS was installed, a database of the standard object names should have -->
1829 <!-- been created which should speed up this process at the start of an S -->
1830 <!-- session; if it has not been created you will get a warning like -->
1831 <!-- `S-namedb.el does not exist'. @xref{Installation}, for information on -->
1832 <!-- how to create this database. -->
1833 <p>Efficiency in completion is gained by maintaining a cache of objects
1834 currently known to S; when a new object becomes available or is deleted,
1835 only one component of the cache corresponding to the associated
1836 directory needs to be refreshed. If ESS ever becomes confused about
1837 what objects are available for completion (such as when if refuses to
1838 complete an object you <strong>know</strong> is there), the command <kbd>M-x
1839 ess-resynch</kbd>
1840 <a name="index-ess_002dresynch-51"></a>forces the <em>entire</em> cache to be refreshed, which should fix the
1841 problem.
1843 <!-- node-name, next, previous, up -->
1844 <div class="node">
1845 <p><hr>
1846 <a name="Transcript"></a>
1847 Next:&nbsp;<a rel="next" accesskey="n" href="#Command-History">Command History</a>,
1848 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Completion-details">Completion details</a>,
1849 Up:&nbsp;<a rel="up" accesskey="u" href="#Entering-commands">Entering commands</a>
1851 </div>
1853 <h3 class="section">4.4 Manipulating the transcript</h3>
1855 <p>Most of the time, the cursor spends most of its time at the bottom of
1856 the ESS process buffer, entering commands. However all the input
1857 and output from the current (and previous) ESS sessions is stored in
1858 the process buffer (we call this the transcript) and often we want to
1859 <a name="index-transcript-52"></a>move back up through the buffer, to look at the output from previous
1860 commands for example.
1862 <p>Within the process buffer, a paragraph
1863 <a name="index-paragraphs-in-the-process-buffer-53"></a>is defined as the prompt, the command after the prompt, and the output
1864 from the command. Thus <kbd>M-{</kbd> and <kbd>M-}</kbd> move you backwards and
1865 forwards, respectively, through commands in the transcript. A
1866 particularly useful command is <kbd>M-h</kbd> (<code>mark-paragraph</code>) which
1867 will allow you to mark a command and its entire output (for deletion,
1868 perhaps). For more information about paragraph commands,
1869 see <a href="emacs.html#Paragraphs">Paragraphs</a>.
1871 <p>If an ESS process finishes and you restart it in the same process
1872 buffer, the output from the new ESS process appears after the output
1873 from the first ESS process separated by a form-feed (`<samp><span class="samp">^L</span></samp>')
1874 character. Thus pages in the ESS
1875 <a name="index-pages-in-the-process-buffer-54"></a>process buffer correspond to ESS sessions. Thus, for example, you may
1876 use <kbd>C-x [</kbd> and <kbd>C-x ]</kbd> to move backward and forwards through
1877 ESS sessions in a single ESS process buffer. For more information about
1878 page commands, see <a href="emacs.html#Pages">Pages</a>.
1880 <ul class="menu">
1881 <li><a accesskey="1" href="#Last-command">Last command</a>: Manipulating the output from the last command
1882 <li><a accesskey="2" href="#Process-buffer-motion">Process buffer motion</a>: Viewing older commands
1883 <li><a accesskey="3" href="#Transcript-resubmit">Transcript resubmit</a>: Re-submitting commands from the transcript
1884 <li><a accesskey="4" href="#Saving-transcripts">Saving transcripts</a>: Keeping a record of your S session
1885 </ul>
1887 <!-- node-name, next, previous, up -->
1888 <div class="node">
1889 <p><hr>
1890 <a name="Last-command"></a>
1891 Next:&nbsp;<a rel="next" accesskey="n" href="#Process-buffer-motion">Process buffer motion</a>,
1892 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Transcript">Transcript</a>,
1893 Up:&nbsp;<a rel="up" accesskey="u" href="#Transcript">Transcript</a>
1895 </div>
1897 <h4 class="subsection">4.4.1 Manipulating the output from the last command</h4>
1899 <p>Viewing the output of the command you have just entered is a common
1900 occurrence and ESS provides a number of facilities for doing this.
1901 <!-- Within the ESS process buffer, the variable @code{scroll-step} -->
1902 <!-- @vindex scroll-step -->
1903 <!-- is set to 4 (you can redefine this using @code{inferior-ess-mode-hook} -->
1904 <!-- @vindex inferior-ess-hook -->
1905 <!-- if you wish - @pxref{Hooks},) so that the cursor is usually near the -->
1906 <!-- bottom of the window. -->
1907 Whenever a command produces a longish output, it is possible that the
1908 window will scroll, leaving the next prompt near the middle of the
1909 window. The first part of the command output may have scrolled off the
1910 top of the window, even though the entire output would fit in the window
1911 if the prompt were near the bottom of the window. If this happens, you
1912 can use the command
1914 <ul>
1915 <li><kbd>C-c C-e</kbd> (<code>comint-show-maximum-output</code>) <br>
1916 <a name="index-comint_002dshow_002dmaximum_002doutput-55"></a>Move to the end of the buffer, and place cursor on bottom line of
1917 window.
1918 </ul>
1920 <p class="noindent">to make more of the last output visible. (To make this happen
1921 automatically for all inputs, set the variable
1922 <code>comint-scroll-to-bottom-on-input</code> to <code>t</code>.)
1924 <p>If the first part of the output is still obscured, use
1925 <a name="index-reading-long-command-outputs-56"></a>
1926 <ul>
1927 <li><kbd>C-c C-r</kbd> (<code>comint-show-output</code>) <br>
1928 <a name="index-comint_002dshow_002doutput-57"></a>Moves cursor to the previous command line and and places it at the top
1929 of the window.
1930 </ul>
1932 <p class="noindent">to view it. Finally, if you want to discard the last command output
1933 altogether, use
1935 <ul>
1936 <li><kbd>C-c C-o</kbd> (<code>comint-kill-output</code>) <br>
1937 <a name="index-comint_002dkill_002doutput-58"></a><a name="index-deleting-output-59"></a>Deletes everything from the last command to the current prompt.
1938 </ul>
1940 <p class="noindent">to delete it. Use this command judiciously to keep your transcript to a
1941 more manageable size.
1943 <!-- node-name, next, previous, up -->
1944 <div class="node">
1945 <p><hr>
1946 <a name="Process-buffer-motion"></a>
1947 Next:&nbsp;<a rel="next" accesskey="n" href="#Transcript-resubmit">Transcript resubmit</a>,
1948 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Last-command">Last command</a>,
1949 Up:&nbsp;<a rel="up" accesskey="u" href="#Transcript">Transcript</a>
1951 </div>
1953 <h4 class="subsection">4.4.2 Viewing older commands</h4>
1955 <p>If you want to view the output from more historic commands than the
1956 previous command, commands are also provided to move backwards and
1957 forwards through previously entered commands in the process buffer:
1959 <ul>
1960 <li><kbd>C-c C-p</kbd> (<code>comint-previous-input</code>) <br>
1961 <a name="index-comint_002dprevious_002dinput-60"></a>Moves point to the preceding command in the process buffer.
1963 <li><kbd>C-c C-n</kbd> (<code>comint-next-input</code>) <br>
1964 <a name="index-comint_002dnext_002dinput-61"></a>Moves point to the next command in the process buffer.
1965 </ul>
1967 <p class="noindent">Note that these two commands are analogous to <kbd>C-p</kbd> and <kbd>C-n</kbd>
1968 but apply to command lines rather than text lines. And just like
1969 <kbd>C-p</kbd> and <kbd>C-n</kbd>, passing a prefix argument to these commands
1970 means to move to the <var>ARG</var>'th next (or previous) command. (These
1971 commands are also discussed in <a href="emacs.html#Shell-History-Copying">Shell History Copying</a>.)
1973 <p>There are also two similar commands (not bound to any keys by default)
1974 which move to preceding or succeeding commands, but which first prompt
1975 for a regular expression (see <a href="emacs.html#Regexps">Syntax of Regular Expression</a>), and then moves to
1976 the next (previous) command matching the pattern.
1978 <ul>
1979 <li><code>(comint-backward-matching-input regexp arg)</code> <br>
1980 <a name="index-comint_002dbackward_002dmatching_002dinput-62"></a><code>(comint-forward-matching-input regexp arg)</code> <br>
1981 <a name="index-comint_002dforward_002dmatching_002dinput-63"></a>Search backward (forward) through the transcript buffer for the
1982 <var>arg</var>'th previous (next) command matching <var>regexp</var>. <var>arg</var>
1983 is the prefix argument; <var>regexp</var> is prompted for in the minibuffer.
1984 </ul>
1986 <!-- node-name, next, previous, up -->
1987 <div class="node">
1988 <p><hr>
1989 <a name="Transcript-resubmit"></a>
1990 Next:&nbsp;<a rel="next" accesskey="n" href="#Saving-transcripts">Saving transcripts</a>,
1991 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Process-buffer-motion">Process buffer motion</a>,
1992 Up:&nbsp;<a rel="up" accesskey="u" href="#Transcript">Transcript</a>
1994 </div>
1996 <h4 class="subsection">4.4.3 Re-submitting commands from the transcript</h4>
1998 <p>When moving through the transcript, you may wish to re-execute some of
1999 the commands you find there. ESS provides three commands to do this;
2000 these commands may be used whenever the cursor is within a command line
2001 in the transcript (if the cursor is within some command <em>output</em>,
2002 an error is signalled). Note all three commands involve the &lt;RETURN&gt;
2003 key.
2005 <ul>
2006 <li><kbd>RET</kbd> (<code>inferior-ess-send-input</code>) <br>
2007 <a name="index-inferior_002dess_002dsend_002dinput-64"></a>Copy the command under the cursor to the current command line, and
2008 execute it.
2010 <li><kbd>C-c RET</kbd> (<code>comint-copy-old-input</code>) <br>
2011 <a name="index-comint_002dcopy_002dold_002dinput-65"></a>Copy the command under the cursor to the current command line, but don't
2012 execute it. Leaves the cursor on the command line so that the copied
2013 command may be edited.
2015 <li><kbd>M-RET</kbd> (<code>ess-transcript-send-command-and-move</code>) <br>
2016 <a name="index-ess_002dtranscript_002dsend_002dcommand_002dand_002dmove-66"></a>Copy the command under the cursor to the current command line, and
2017 execute it. Moves the cursor to the following command.
2018 </ul>
2020 <p>When the cursor is not after the current prompt, the &lt;RETURN&gt; key
2021 has a slightly different behavior than usual. Pressing <kbd>RET</kbd> on any
2022 line containing a command that you entered (i.e. a line beginning with a
2023 prompt) sends that command to the ESS process once again. If you
2024 wish to edit the command before executing it, use <kbd>C-c RET</kbd> instead;
2025 it copies the command to the current prompt but does not execute it,
2026 allowing you to edit it before submitting it.
2028 <p>These two commands leave the cursor at the new command line, allowing
2029 you to continue with interactive use of S. If you wish to resubmit a
2030 series of commands from the transcript, consider using <kbd>M-RET</kbd>
2031 instead, which leaves the cursor at the command line following the one
2032 you re-submitted. Thus by using <kbd>M-RET</kbd> repeatedly, you can
2033 re-submit a whole series of commands.
2035 <p>These commands work even if if the current line is a continuation line
2036 (i.e. the prompt is `<samp><span class="samp">+</span></samp>' instead of `<samp><span class="samp">&gt;</span></samp>') &mdash; in this case all
2037 the lines that form the multi-line command are concatenated together and
2038 the resulting command is sent to the ESS process (currently this is
2039 the only way to resubmit a multi-line command to the ESS process in
2040 one go). If the current line does
2041 <a name="index-multi_002dline-commands_002c-resubmitting-67"></a>not begin with a prompt, an error is signalled. This feature, coupled
2042 with the command-based motion commands described above, could be used as
2043 a primitive history mechanism. ESS provides a more sophisticated
2044 mechanism, however, which is described in <a href="#Command-History">Command History</a>.
2046 <!-- node-name, next, previous, up -->
2047 <div class="node">
2048 <p><hr>
2049 <a name="Saving-transcripts"></a>
2050 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Transcript-resubmit">Transcript resubmit</a>,
2051 Up:&nbsp;<a rel="up" accesskey="u" href="#Transcript">Transcript</a>
2053 </div>
2055 <h4 class="subsection">4.4.4 Keeping a record of your S session</h4>
2057 <p>To keep a record of your S session in a disk file, use the Emacs
2058 command <kbd>C-x C-w</kbd> (<code>write-file</code>) to attach a file to the
2059 ESS process buffer. The name of the process buffer will (probably)
2060 change to the name of the file, but this is not a problem. You can
2061 still use S as usual; just remember to save the file before you quit
2062 Emacs with <kbd>C-x C-s</kbd>. You can make ESS prompt you for a filename in
2063 which to save the transcript every time you start S by setting the
2064 variable
2065 <a name="index-ess_002dask_002dabout_002dtransfile-68"></a><code>ess-ask-about-transfile</code> to <code>t</code>; see <a href="#Customizing-startup">Customizing startup</a>.
2066 <a name="index-transcript-file-names-69"></a>We recommend you save your transcripts with filenames that end in
2067 `<samp><span class="samp">.St</span></samp>'. There is a special mode (ESS transcript mode &mdash;
2068 see <a href="#Transcript-Mode">Transcript Mode</a>) for editing transcript files which is
2069 automatically selected for files with this suffix.
2071 <p><a name="index-editing-transcripts-70"></a>S transcripts can get very large, so some judicious editing is
2072 appropriate if you are saving it in a file. Use <kbd>C-c C-o</kbd> whenever
2073 a command produces excessively long output (printing large arrays, for
2074 example). Delete erroneous commands (and the resulting error messages
2075 or other output) by moving to the command (or its output) and typing
2076 <kbd>M-h C-w</kbd>. Also, remember that <kbd>C-c C-e</kbd> (and other hot keys)
2077 may be used for commands whose output you do not wish to appear in the
2078 transcript. These suggestions are appropriate even if you are not
2079 saving your transcript to disk, since the larger the transcript, the
2080 more memory your Emacs process will use on the host machine.
2082 <p>Finally, if you intend to produce S source code (suitable for using
2083 with <code>source()</code> or inclusion in an S function) from a
2084 transcript, then the command <kbd>M-x ess-transcript-clean-region</kbd> may
2085 be of use.
2086 <a name="index-ess_002dtranscript_002dclean_002dregion-71"></a>This command works in any Emacs buffer, and removes all prompts and
2087 command output from an ESS transcript within the current region, leaving
2088 only the commands. Don't forget to remove any erroneous commands first!
2090 <!-- node-name, next, previous, up -->
2091 <div class="node">
2092 <p><hr>
2093 <a name="Command-History"></a>
2094 Next:&nbsp;<a rel="next" accesskey="n" href="#History-expansion">History expansion</a>,
2095 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Transcript">Transcript</a>,
2096 Up:&nbsp;<a rel="up" accesskey="u" href="#Entering-commands">Entering commands</a>
2098 </div>
2100 <h3 class="section">4.5 Command History</h3>
2102 <p><a name="index-command-history-72"></a><a name="index-editing-commands-73"></a><a name="index-re_002dexecuting-commands-74"></a>
2103 ESS provides easy-to-use facilities for re-executing or editing previous
2104 commands. An input history of the last few commands is maintained (by
2105 default the last 50 commands are stored, although this can be changed by
2106 setting the variable <code>comint-input-ring-size</code> in
2107 <a name="index-comint_002dinput_002dring_002dsize-75"></a><code>inferior-ess-mode-hook</code>.) The simplest history commands simply
2108 select the next and previous commands in the input history:
2110 <ul>
2111 <li><kbd>M-p</kbd> (<code>comint-previous-input</code>) <br>
2112 <a name="index-comint_002dprevious_002dinput-76"></a>Select the previous command in the input history.
2114 <li><kbd>M-n</kbd> (<code>comint-next-input</code>) <br>
2115 <a name="index-comint_002dnext_002dinput-77"></a>Select the next command in the input history.
2116 </ul>
2118 <p class="noindent">For example, pressing <kbd>M-p</kbd> once will re-enter the last command into
2119 the process buffer after the prompt but does not send it to the ESS
2120 process, thus allowing editing or correction of the command before the
2121 ESS process sees it. Once corrections have been made, press
2122 <kbd>RET</kbd> to send the edited command to the ESS process.
2124 <p>If you want to select a particular command from the history by matching
2125 it against a regular expression (see <a href="emacs.html#Regexps">Syntax of Regular Expression</a>), to search for a
2126 particular variable name for example, these commands are also available:
2128 <ul>
2129 <li><kbd>M-r</kbd> (<code>comint-previous-matching-input</code>) <br>
2130 <a name="index-comint_002dprevious_002dmatching_002dinput-78"></a>Prompt for a regular expression, and search backwards through the input
2131 history for a command matching the expression.
2133 <li><kbd>M-s</kbd> (<code>comint-next-matching-input</code>) <br>
2134 <a name="index-comint_002dnext_002dmatching_002dinput-79"></a>Prompt for a regular expression, and search backwards through the input
2135 history for a command matching the expression.
2136 </ul>
2138 <p class="noindent">A common type of search is to find the last command that began with a
2139 particular sequence of characters; the following two commands provide an
2140 easy way to do this:
2142 <ul>
2143 <li><kbd>A-M-r</kbd> (<code>comint-previous-matching-input-from-input</code>) <br>
2144 <a name="index-comint_002dprevious_002dmatching_002dinput_002dfrom_002dinput-80"></a>Select the previous command in the history which matches the string
2145 typed so far.
2147 <li><kbd>A-M-s</kbd> (<code>comint-next-matching-input-from-input</code>) <br>
2148 <a name="index-comint_002dnext_002dmatching_002dinput_002dfrom_002dinput-81"></a>Select the next command in the history which matches the string typed so
2149 far.
2150 </ul>
2152 <p class="noindent">Instead of prompting for a regular expression to match against, as they
2153 instead select commands starting with those characters already entered.
2154 For instance, if you wanted to re-execute the last <code>attach()</code>
2155 command, you may only need to type <kbd>att</kbd> and then <kbd>A-M-r</kbd> and
2156 <kbd>RET</kbd>. (Note: you may not have an &lt;ALT&gt; key on your keyboard,
2157 in which case it may be a good idea to bind these commands to some other
2158 keys.)
2160 <p>See <a href="emacs.html#Shell-Ring">Shell History Ring</a>, for a more detailed discussion of the history mechanism.
2162 <!-- node-name, next, previous, up -->
2163 <div class="node">
2164 <p><hr>
2165 <a name="History-expansion"></a>
2166 Next:&nbsp;<a rel="next" accesskey="n" href="#Hot-keys">Hot keys</a>,
2167 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Command-History">Command History</a>,
2168 Up:&nbsp;<a rel="up" accesskey="u" href="#Entering-commands">Entering commands</a>
2170 </div>
2172 <h3 class="section">4.6 References to historical commands</h3>
2174 <p>Instead of searching through the command history using the command
2175 described in the previous section, you can alternatively refer to a
2176 historical command directly using a notation very similar to that used
2177 in <code>csh</code>. History references are introduced by a `<samp><span class="samp">!</span></samp>' or
2178 `<samp><span class="samp">^</span></samp>' character and have meanings as follows:
2180 <dl>
2181 <dt>`<samp><span class="samp">!!</span></samp>'<dd>The immediately previous command
2183 <br><dt>`<samp><span class="samp">!-</span><var>N</var></samp>'<dd>The <var>N</var>th previous command
2185 <br><dt>`<samp><span class="samp">!text</span></samp>'<dd>The last command beginning with the string `<samp><span class="samp">text</span></samp>'
2187 <br><dt>`<samp><span class="samp">!?text</span></samp>'<dd>The last command containing the string `<samp><span class="samp">text</span></samp>'
2188 </dl>
2190 <p>In addition, you may follow the reference with a <dfn>word designator</dfn>
2191 to select particular <dfn>words</dfn> of the input. A word is defined as a
2192 sequence of characters separated by whitespace. (You can modify this
2193 definition by setting the value of <code>comint-delimiter-argument-list</code>
2194 to a list of characters that are allowed to separate words and
2195 <a name="index-comint_002ddelimiter_002dargument_002dlist-82"></a>themselves form words.) Words are numbered beginning with zero. The
2196 word designator usually begins with a `<samp><span class="samp">:</span></samp>' (colon) character;
2197 however it may be omitted if the word reference begins with a `<samp><span class="samp">^</span></samp>',
2198 `<samp><span class="samp">$</span></samp>', `<samp><span class="samp">*</span></samp>' or `<samp><span class="samp">-</span></samp>'. If the word is to be selected from the
2199 previous command, the second `<samp><span class="samp">!</span></samp>' character can be omitted from the
2200 event specification. For instance, `<samp><span class="samp">!!:1</span></samp>' and `<samp><span class="samp">!:1</span></samp>' both
2201 refer to the first word of the previous command, while `<samp><span class="samp">!!$</span></samp>' and
2202 `<samp><span class="samp">!$</span></samp>' both refer to the last word in the previous command. The
2203 format of word designators is as follows:
2205 <dl>
2206 <dt>`<samp><span class="samp">0</span></samp>'<dd>The zeroth word (i.e. the first one on the command line)
2208 <br><dt>`<samp><var>n</var></samp>'<dd>The <var>n</var>th word, where <var>n</var> is a number
2210 <br><dt>`<samp><span class="samp">^</span></samp>'<dd>The first word (i.e. the second one on the command line)
2212 <br><dt>`<samp><span class="samp">$</span></samp>'<dd>The last word
2214 <br><dt>`<samp><var>x</var><span class="samp">-</span><var>y</var></samp>'<dd>A range of words; `<samp><span class="samp">-</span><var>y</var></samp>' abbreviates `<samp><span class="samp">0-</span><var>y</var></samp>'
2216 <br><dt>`<samp><span class="samp">*</span></samp>'<dd>All the words except the zeroth word, or nothing if the command had just
2217 one word (the zeroth)
2219 <br><dt>`<samp><var>x</var><span class="samp">*</span></samp>'<dd>Abbreviates <var>x</var>-$
2221 <br><dt>`<samp><var>x</var><span class="samp">-</span></samp>'<dd>Like `<samp><var>x</var><span class="samp">*</span></samp>', but omitting the last word
2222 </dl>
2224 <p>In addition, you may surround the entire reference except for the first
2225 `<samp><span class="samp">!</span></samp>' by braces to allow it to be followed by other (non-whitespace)
2226 characters (which will be appended to the expanded reference).
2228 <p>Finally, ESS also provides quick substitution; a reference like
2229 `<samp><span class="samp">^old^new^</span></samp>' means &ldquo;the last command, but with the first occurrence
2230 of the string `<samp><span class="samp">old</span></samp>' replaced with the string `<samp><span class="samp">new</span></samp>'&rdquo; (the last
2231 `<samp><span class="samp">^</span></samp>' is optional). Similarly, `<samp><span class="samp">^old^</span></samp>' means &ldquo;the last
2232 command, with the first occurrence of the string `<samp><span class="samp">old</span></samp>' deleted&rdquo;
2233 (again, the last `<samp><span class="samp">^</span></samp>' is optional).
2235 <p>To convert a history reference as described above to an input suitable
2236 for S, you need to <dfn>expand</dfn> the history reference, using the
2237 &lt;TAB&gt; key. For this to work, the cursor must be preceded by a space
2238 (otherwise it would try to complete an object name) and not be within a
2239 string (otherwise it would try to complete a filename). So to expand
2240 the history reference, type <kbd>SPC TAB</kbd>. This will convert the
2241 history reference into an S command from the history, which you can
2242 then edit or press &lt;RET&gt; to execute.
2244 <p>For example, to execute the last command that referenced the variable
2245 <code>data</code>, type <kbd>!?data SPC TAB RET</kbd>.
2247 <!-- node-name, next, previous, up -->
2248 <div class="node">
2249 <p><hr>
2250 <a name="Hot-keys"></a>
2251 Next:&nbsp;<a rel="next" accesskey="n" href="#Statistical-Process-running-in-ESS_003f">Statistical Process running in ESS?</a>,
2252 Previous:&nbsp;<a rel="previous" accesskey="p" href="#History-expansion">History expansion</a>,
2253 Up:&nbsp;<a rel="up" accesskey="u" href="#Entering-commands">Entering commands</a>
2255 </div>
2257 <h3 class="section">4.7 Hot keys for common commands</h3>
2259 <p>ESS provides a number of commands for executing the commonly used
2260 functions. These commands below are basically information-gaining
2261 commands (such as <code>objects()</code> or <code>search()</code>) which tend to
2262 clutter up your transcript and for this reason some of the hot keys
2263 display their output in a temporary buffer instead of the process buffer
2264 by default. This behavior is controlled by the variable
2265 <code>ess-execute-in-process-buffer</code> which, if
2266 <a name="index-ess_002dexecute_002din_002dprocess_002dbuffer-83"></a>non-<code>nil</code>, means that these commands will produce their output in
2267 the process buffer instead. In any case, passing a prefix argument to
2268 the commands (with <kbd>C-u</kbd>) will reverse the meaning of
2269 <code>ess-execute-in-process-buffer</code> for that command, i.e. the output
2270 will be displayed in the process buffer if it usually goes to a
2271 temporary buffer, and vice-versa. These are the hot keys that behave in
2272 this way:
2274 <ul>
2275 <li><kbd>C-c C-x</kbd> (<code>ess-execute-objects</code>) <br>
2276 <a name="index-ess_002dexecute_002dobjects-84"></a>Sends the <code>objects()</code>
2277 <a name="index-objects_0028_0029-85"></a>command to the ESS process. A prefix argument specifies the
2278 position on the search list (use a negative argument to toggle
2279 <code>ess-execute-in-process-buffer</code> as well). A quick way to see what
2280 objects are in your working directory.
2281 <a name="index-objects-86"></a><a name="index-objects_0028_0029-87"></a>
2282 <li><kbd>C-c C-s</kbd> (<code>ess-execute-search</code>) <br>
2283 <a name="index-ess_002dexecute_002dsearch-88"></a>Sends the <code>search()</code>
2284 <a name="index-search_0028_0029-89"></a>command to the ESS process.
2285 <a name="index-search-list-90"></a><a name="index-search_0028_0029-91"></a>
2286 <li><kbd>C-c C-e</kbd> (<code>ess-execute</code>) <br>
2287 <a name="index-ess_002dexecute-92"></a>Prompt for an ESS expression, and evaluate it.
2288 </ul>
2290 <p><code>ess-execute</code> may seem pointless when you could just type the
2291 command in anyway, but it proves useful for `spot' calculations which
2292 would otherwise clutter your transcript, or for evaluating an expression
2293 while partway through entering a command. You can also use this command
2294 to generate new hot keys using the Emacs keyboard macro facilities;
2295 see <a href="emacs.html#Keyboard-Macros">Keyboard Macros</a>.
2296 <a name="index-hot-keys-93"></a><a name="index-keyboard-short-cuts-94"></a>
2297 The following hot keys do not use <code>ess-execute-in-process-buffer</code>
2298 to decide where to display the output &mdash; they either always display in
2299 the process buffer or in a separate buffer, as indicated:
2301 <ul>
2302 <li><kbd>C-c C-a</kbd> (<code>ess-execute-attach</code>) <br>
2303 <a name="index-ess_002dexecute_002dattach-95"></a>Prompts for a directory to attach to the ESS process with the
2304 <code>attach()</code> command.
2305 <a name="index-attach_0028_0029-96"></a>If a numeric prefix argument is given it is used as the position on the
2306 search list to attach the directory; otherwise the S default of 2 is
2307 used. The <code>attach()</code> command actually executed appears in the
2308 process buffer.
2310 <li><kbd>C-c C-l</kbd> (<code>ess-load-file</code>) <br>
2311 <a name="index-ess_002dload_002dfile-97"></a>Prompts for a file to load into the ESS process using
2312 <code>source()</code>. If there is an error during loading, you can jump to
2313 the error in the file with <kbd>C-x `</kbd> (<code>ess-parse-errors</code>).
2314 <a name="index-ess_002dparse_002derrors-98"></a>See <a href="#Error-Checking">Error Checking</a>, for more details.
2316 <li><kbd>C-c C-v</kbd> (<code>ess-display-help-on-object</code>) <br> Pops up a help
2317 buffer for an S object or function. See <a href="#Help">Help</a> for more
2318 details.
2320 <li><kbd>C-c C-q</kbd> (<code>ess-quit</code>) <br>
2321 <a name="index-quitting-from-ESS-99"></a><a name="index-killing-the-ESS-process-100"></a>Sends the <code>q()</code>
2322 <a name="index-q_0028_0029-101"></a>command to the ESS process (or <code>(exit)</code>
2323 <a name="index-exit_0028_0029-102"></a>to the <b>XLS</b> process), and cleans up any temporary buffers (such as
2324 help buffers or edit buffers) you may have created along the way. Use
2325 this command when you have finished your S session instead of simply
2326 typing <code>q()</code> yourself, otherwise you will need to issue the command
2327 <kbd>M-x ess-cleanup</kbd>
2328 <a name="index-ess_002dcleanup-103"></a><a name="index-cleaning-up-104"></a><a name="index-temporary-buffers_002c-killing-105"></a><a name="index-killing-temporary-buffers-106"></a>command explicitly to make sure that all the files that need to be saved
2329 have been saved, and that all the temporary buffers have been killed.
2330 </ul>
2332 <!-- node-name, next, previous, up -->
2333 <div class="node">
2334 <p><hr>
2335 <a name="Statistical-Process-running-in-ESS%3f"></a>
2336 <a name="Statistical-Process-running-in-ESS_003f"></a>
2337 Next:&nbsp;<a rel="next" accesskey="n" href="#Emacsclient">Emacsclient</a>,
2338 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Hot-keys">Hot keys</a>,
2339 Up:&nbsp;<a rel="up" accesskey="u" href="#Entering-commands">Entering commands</a>
2341 </div>
2343 <h3 class="section">4.8 Is the Statistical Process running under ESS?</h3>
2345 <p><a name="index-STERM-107"></a><a name="index-STERM-108"></a>For the S languages (S, S-Plus, R) ESS sets an option in the current
2346 process that programs in the language can check to determine the
2347 environment in which they are currently running.
2349 <p>ESS sets
2350 <code>options(STERM="iESS")</code> for S language processes running in an
2351 inferior <code>i<acronym>ESS[S]</acronym><!-- /@w --></code> or <code>i<acronym>ESS[R]</acronym><!-- /@w --></code> buffer.
2353 <p>ESS sets
2354 <code>options(STERM="ddeESS")</code> for independent S-Plus for Windows
2355 processes running in the GUI and communicating with ESS via
2356 the DDE (Microsoft Dynamic Data Exchange) protocol through a
2357 <code>ddeESS[S]</code> buffer.
2359 <p>Other values of <code>options()$STERM</code> that we recommend are:
2361 <ul>
2362 <li><code>length</code>: Fixed length xterm or telnet window.
2363 <li><code>scrollable</code>: Unlimited length xterm or telnet window.
2364 <li><code>server</code>: S-Plus Stat Server.
2365 <li><code>BATCH</code>: BATCH.
2366 <li><code>Rgui</code>: R GUI.
2367 <li><code>Commands</code>: S-Plus GUI without DDE interface to ESS.
2368 </ul>
2370 <p>Additional values may be recommended in the future as new interaction
2371 protocols are created. Unlike the values <code>iESS</code> and <code>ddeESS</code>,
2372 ESS can't set these other values since the S language program is not
2373 under the control of ESS.
2375 <!-- node-name, next, previous, up -->
2376 <div class="node">
2377 <p><hr>
2378 <a name="Emacsclient"></a>
2379 Next:&nbsp;<a rel="next" accesskey="n" href="#Other">Other</a>,
2380 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Statistical-Process-running-in-ESS_003f">Statistical Process running in ESS?</a>,
2381 Up:&nbsp;<a rel="up" accesskey="u" href="#Entering-commands">Entering commands</a>
2383 </div>
2385 <h3 class="section">4.9 Using emacsclient</h3>
2387 <p><a name="index-emacsclient-109"></a>
2388 When starting R or S under Unix, ESS sets
2389 <code>options(editor="emacsclient")</code>. (Under Microsoft Windows, it will
2390 use gnuclient.exe rather than emacsclient, but the same principle
2391 applies.) Within your R session, for example, if you have a function
2392 called <code>iterator</code>, typing <code>fix(iterator)</code>, will show that
2393 function in a temporary Emacs buffer. You can then correct the
2394 function. When you kill the buffer, the definition of the function is
2395 updated. Using <code>edit()</code> rather than <code>fix()</code> means that the
2396 function is not updated. Finally, the S function <code>page(x)</code> will
2397 also show a text representation of the object <code>x</code> in a temporary
2398 Emacs buffer.
2400 <!-- node-name, next, previous, up -->
2401 <div class="node">
2402 <p><hr>
2403 <a name="Other"></a>
2404 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Emacsclient">Emacsclient</a>,
2405 Up:&nbsp;<a rel="up" accesskey="u" href="#Entering-commands">Entering commands</a>
2407 </div>
2409 <h3 class="section">4.10 Other commands provided by inferior-ESS</h3>
2411 <p>The following commands are also provided in the process buffer:
2413 <ul>
2414 <li><kbd>C-c C-c</kbd> (<code>comint-interrupt-subjob</code>) <br>
2415 <a name="index-comint_002dinterrupt_002dsubjob-110"></a>Sends a Control-C signal to the ESS process. This has the effect of
2416 <a name="index-aborting-S-commands-111"></a><a name="index-interrupting-S-commands-112"></a>aborting the current command.
2418 <li><kbd>C-c C-z</kbd> (<code>ess-abort</code>) <br>
2419 <a name="index-ess_002dabort-113"></a><a name="index-comint_002dstop_002dsubjob-114"></a>Sends a STOP signal to the ESS process, killing it immediately.
2420 It's not a good idea to use this, in general: Neither <code>q()</code> nor
2421 <code>.Last</code> will be executed and device drivers will not finish
2422 cleanly. This command is provided as a safety to
2423 <code>comint-stop-subjob</code>, which is usually bound to <kbd>C-c C-z</kbd>. If
2424 you want to quit from S, use <kbd>C-c C-q</kbd> (<code>ess-quit</code>) instead.
2425 <a name="index-ess_002dquit-115"></a><a name="index-aborting-the-ESS-process-116"></a>
2426 <li><kbd>C-c C-d</kbd> (<code>ess-dump-object-into-edit-buffer</code>) <br>
2427 <a name="index-ess_002ddump_002dobject_002dinto_002dedit_002dbuffer-117"></a>Prompts for an object to be edited in an edit buffer. See <a href="#Editing">Editing</a>.
2428 </ul>
2430 <p>Other commands available in Inferior S mode are discussed in
2431 <a href="emacs.html#Shell-Mode">Shell Mode</a>.
2433 <!-- node-name, next, previous, up -->
2434 <div class="node">
2435 <p><hr>
2436 <a name="Transcript-Mode"></a>
2437 Next:&nbsp;<a rel="next" accesskey="n" href="#ESS-for-the-S-family">ESS for the S family</a>,
2438 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Entering-commands">Entering commands</a>,
2439 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
2441 </div>
2443 <h2 class="chapter">5 Manipulating saved transcript files</h2>
2445 <p>Inferior S mode records the transcript (the list of all commands
2446 executed, and their output) in the process buffer, which can be saved as
2447 a <dfn>transcript file</dfn>, which should normally have the suffix
2448 <samp><span class="file">.St</span></samp>. The most obvious use for a transcript file is as a static
2449 record of the actions you have performed in a particular S session.
2450 Sometimes, however, you may wish to re-execute commands recorded in the
2451 transcript file by submitting them to a running ESS process. This
2452 is what Transcript Mode is for.
2454 <p>If you load file a with the suffix <samp><span class="file">.St</span></samp> into Emacs, it is placed
2455 in S Transcript Mode. Transcript Mode is similar to Inferior S mode
2456 (see <a href="#Entering-commands">Entering commands</a>):
2457 <a name="index-transcript-mode-motion-118"></a><a name="index-motion-in-transcript-mode-119"></a>paragraphs are defined as a command and its output, and you can move
2458 though commands either with the paragraph commands or with <kbd>C-c C-p</kbd>
2459 and <kbd>C-c C-n</kbd>.
2461 <ul class="menu">
2462 <li><a accesskey="1" href="#Resubmit">Resubmit</a>: Resubmitting commands from the transcript file
2463 <li><a accesskey="2" href="#Clean">Clean</a>: Cleaning transcript files
2464 </ul>
2466 <!-- node-name, next, previous, up -->
2467 <div class="node">
2468 <p><hr>
2469 <a name="Resubmit"></a>
2470 Next:&nbsp;<a rel="next" accesskey="n" href="#Clean">Clean</a>,
2471 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Transcript-Mode">Transcript Mode</a>,
2472 Up:&nbsp;<a rel="up" accesskey="u" href="#Transcript-Mode">Transcript Mode</a>
2474 </div>
2476 <h3 class="section">5.1 Resubmitting commands from the transcript file</h3>
2478 <p>Three commands are provided to re-submit command lines from the
2479 transcript file to a running ESS process. They are:
2481 <ul>
2482 <li><kbd>RET</kbd> (<code>ess-transcript-send-command</code>) <br>
2483 Send the current command line to the ESS process, and execute it.
2484 <a name="index-ess_002dtranscript_002dsend_002dcommand-120"></a>
2485 <li><kbd>C-c RET</kbd> (<code>ess-transcript-copy-command</code>) <br>
2486 Copy the current command to the ESS process, and switch to the
2487 ESS process buffer (ready to edit the copied command).
2488 <a name="index-ess_002dtranscript_002dcopy_002dcommand-121"></a>
2489 <li><kbd>M-RET</kbd> (<code>ess-transcript-send-command-and-move</code>) <br>
2490 Send the current command to the ESS process, and move to the next
2491 command line. This command is useful for submitting a series of
2492 commands.
2493 </ul>
2495 <p class="noindent">Note that these commands are similar to those on the same keys in
2496 Inferior S Mode. In all three cases, the commands should be
2497 executed when the cursor is on a command line in the transcript; the
2498 prompt is automatically removed before the command is submitted.
2500 <!-- node-name, next, previous, up -->
2501 <div class="node">
2502 <p><hr>
2503 <a name="Clean"></a>
2504 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Resubmit">Resubmit</a>,
2505 Up:&nbsp;<a rel="up" accesskey="u" href="#Transcript-Mode">Transcript Mode</a>
2507 </div>
2509 <h3 class="section">5.2 Cleaning transcript files</h3>
2511 <p>Yet another use for transcript files is to extract the command lines for
2512 inclusion in an S source file or function. Transcript mode provides
2513 one command which does just this:
2515 <ul>
2516 <li><kbd>C-c C-w</kbd> (<code>ess-transcript-clean-region</code>) <br>
2517 Deletes all prompts and command output in the region, leaving only the
2518 commands themselves.
2519 </ul>
2521 <p class="noindent">The remaining command lines may then be copied to a source file or edit
2522 buffer for inclusion in a function definition, or may be evaluated
2523 directly (see <a href="#Evaluating-code">Evaluating code</a>) using the code evaluation commands
2524 from S mode, also available in S Transcript Mode.
2526 <!-- node-name, next, previous, up -->
2527 <div class="node">
2528 <p><hr>
2529 <a name="ESS-for-the-S-family"></a>
2530 Next:&nbsp;<a rel="next" accesskey="n" href="#Editing">Editing</a>,
2531 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Transcript-Mode">Transcript Mode</a>,
2532 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
2534 </div>
2536 <h2 class="chapter">6 ESS for the S family</h2>
2538 <ul class="menu">
2539 <li><a accesskey="1" href="#ESS_0028S_0029_002d_002dEditing-files">ESS(S)--Editing files</a>
2540 <li><a accesskey="2" href="#iESS_0028S_0029_002d_002dInferior-ESS-processes">iESS(S)--Inferior ESS processes</a>
2541 <li><a accesskey="3" href="#ESS_002dhelp_002d_002dassistance-with-viewing-help">ESS-help--assistance with viewing help</a>
2542 <li><a accesskey="4" href="#Philosophies-for-using-ESS_0028S_0029">Philosophies for using ESS(S)</a>
2543 <li><a accesskey="5" href="#Scenarios-for-use-_0028possibilities_002d_002dbased-on-actual-usage_0029">Scenarios for use (possibilities--based on actual usage)</a>
2544 <li><a accesskey="6" href="#Customization-Examples-and-Solutions-to-Problems">Customization Examples and Solutions to Problems</a>
2545 </ul>
2547 <div class="node">
2548 <p><hr>
2549 <a name="ESS(S)--Editing-files"></a>
2550 <a name="ESS_0028S_0029_002d_002dEditing-files"></a>
2551 Next:&nbsp;<a rel="next" accesskey="n" href="#iESS_0028S_0029_002d_002dInferior-ESS-processes">iESS(S)--Inferior ESS processes</a>,
2552 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-the-S-family">ESS for the S family</a>
2554 </div>
2556 <!-- node-name, next, previous, up - don't use @ESS .. -->
2557 <h3 class="section">6.1 ESS[S]&ndash;Editing files</h3>
2559 <p><acronym>ESS[S]</acronym> is the mode for editing S language files. This mode handles:
2561 <ul>
2562 <li> proper indenting, generated by both [Tab] and [Return].
2563 <li> color and font choices based on syntax.
2564 <li> ability to send the contents of an entire buffer, a highlighted
2565 region, an S function, or a single line to an inferior S process, if
2566 one is currently running.
2567 <li> ability to switch between processes which would be the target of the
2568 buffer (for the above).
2569 <li> The ability to request help from an S process for variables and
2570 functions, and to have the results sent into a separate buffer.
2571 <li> completion of object names and file names.
2572 </ul>
2574 <p><acronym>ESS[S]</acronym> mode should be automatically turned on when loading a file with
2575 the suffices found in ess-site (*.R, *.S, *.s, etc). However, one
2576 will have to start up an inferior process to take advantage of the
2577 interactive features.
2579 <div class="node">
2580 <p><hr>
2581 <a name="iESS(S)--Inferior-ESS-processes"></a>
2582 <a name="iESS_0028S_0029_002d_002dInferior-ESS-processes"></a>
2583 Next:&nbsp;<a rel="next" accesskey="n" href="#ESS_002dhelp_002d_002dassistance-with-viewing-help">ESS-help--assistance with viewing help</a>,
2584 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS_0028S_0029_002d_002dEditing-files">ESS(S)--Editing files</a>,
2585 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-the-S-family">ESS for the S family</a>
2587 </div>
2589 <!-- node-name, next, previous, up -->
2590 <h3 class="section">6.2 iESS[S]&ndash;Inferior ESS processes</h3>
2592 <p>iESS (inferior ESS) is the mode for interfacing with active
2593 statistical processes (programs). This mode handles:
2595 <ul>
2596 <li> proper indenting, generated by both [Tab] and [Return].
2597 <li> color and font highlighting based on syntax.
2598 <li> ability to resubmit the contents of a multi-line command
2599 to the executing process with a single keystroke [RET].
2600 <li> The ability to request help from the current process for variables
2601 and functions, and to have the results sent into a separate buffer.
2602 <li> completion of object names and file names.
2603 <li> interactive history mechanism.
2604 <li> transcript recording and editing.
2605 </ul>
2607 <p>To start up iESS mode, use:
2608 <pre class="example"> M-x S+3
2609 M-x S4
2610 M-x S+5
2611 M-x S+6
2612 M-x R
2613 </pre>
2614 <p>(for S-PLUS 3.x, S4, S+5, S+6 or S+7, and R, respectively. This assumes that
2615 you have access to each). Usually the site will have defined one of
2616 these programs (by default S+6) to the simpler name:
2618 <p>M-x S
2620 <p>In the (rare) case that you wish to pass command line arguments to the
2621 starting S+6 process, set the variable <code>inferior-Splus-args</code>.
2623 <p>Note that R has some extremely useful command line arguments. For
2624 example, <code>--vanilla</code> will ensure R starts up without loading in any init
2625 files. To enter a command line argument, call R using a "prefix
2626 argument", by
2628 <p>C-u M-x R
2630 <p>and when ESS prompts for "Starting Args ? ", enter (for example):
2632 <p><code>--vanilla</code>
2634 <p>Then that R process will be started up using <code>R --vanilla</code>. If you
2635 wish to always call R with certain arguments, set the variable
2636 <code>inferior-R-args</code> accordingly.
2638 <!-- Menubar access to other versions of R and Sqpe -->
2639 <p>If you have other versions of R or S-Plus available on the system, ESS
2640 is also able to start those versions. How this works depend on which OS
2641 you are using:
2643 <p>R on Unix systems:
2644 If you have "R-1.8.1" on
2645 your `exec-path', it can be started using <kbd>M-x R-1.8.1</kbd>. By
2646 default, ESS will find versions of R beginning "R-1" or "R-2". If your
2647 versions of R are called other names, consider renaming them with a
2648 symbolic link or change the variable <code>ess-r-versions</code>. To see
2649 which defuns have been created for starting different versions of R,
2650 type <kbd>M-x R-</kbd> and then hit [Tab]. You will then see if any defuns
2651 for particular versions of R have been created. These other versions of
2652 R can also be started from the "ESS-&gt;Start Process-&gt;Other" menu.
2654 <p>R on Windows systems:
2655 If you have "rw1081" on
2656 your `exec-path', it can be started using <kbd>M-x rw1081</kbd>. By
2657 default, ESS will find versions of R located in directories
2658 parallel to the version of R in your <code>PATH</code>. If your
2659 versions of R are called other names, you will need to change the variable
2660 <code>ess-rterm-versions</code>. To see
2661 which defuns have been created for starting different versions of R,
2662 type <kbd>M-x rw</kbd> and then hit [Tab]. You will then see if any defuns
2663 for particular versions of R have been created. These other versions of
2664 R can also be started from the "ESS-&gt;Start Process-&gt;Other" menu.
2666 <p>S on Unix systems: If you have "Splus7" on your `exec-path', it can be
2667 started using <kbd>M-x Splus7</kbd>. By default, ESS will find all
2668 executables beginning "Splus" on your path. If your versions of S are
2669 called other names, consider renaming them with a symbolic link or
2670 change the variable <code>ess-s-versions</code>. To see which defuns have
2671 been created for starting different versions of Splus, type <kbd>M-x
2672 Splus</kbd> and then hit [Tab]. You will then see if any defuns for
2673 particular versions of Splus have been created. These other versions of
2674 Splus can also be started from the "ESS-&gt;Start Process-&gt;Other" menu.
2676 <p>A second mechanim is also available for running other versions of Splus.
2677 The variable <code>ess-s-versions-list</code> is a list of lists; each sublist
2678 should be of the form: (DEFUN-NAME PATH ARGS). DEFUN-NAME is the name
2679 of the new emacs function you wish to create to start the new S process;
2680 PATH is the full path to the version of S you want to run; ARGS is an
2681 optional string of command-line arguments to pass to the S process.
2682 Here is an example setting:
2683 <pre class="example"> (setq ess-s-versions-list
2684 '( ("Splus64" "/usr/local/bin/Splus64")
2685 ("Splus64-j" "/usr/local/bin/Splus64" "-j")))
2686 </pre>
2687 <p>which will then allow you to do <kbd>M-x Splus64-j</kbd> to start Splus64
2688 with the corresponding command line arguments.
2690 <p>If you change the value of either <code>ess-s-versions</code> or
2691 <code>ess-s-versions-list</code>, you should put them in your .emacs before
2692 ess-site is loaded, since the new emacs functions are created when ESS
2693 is loaded.
2695 <p>Sqpe (S-Plus running inside an emacs buffer) on Windows systems:
2696 If you have an older version of S-Plus (S-Plus 6.1 for example) on your system,
2697 ir can be started inside an emacs buffer with <kbd>M-x splus61</kbd>. By
2698 default, ESS will find versions of S-Plus located in the installation
2699 directories that Insightful uses by default. If your
2700 versions of S-Plus are anywhere else, you will need to change the variable
2701 <code>ess-SHOME-versions</code>. To see
2702 which defuns have been created for starting different versions of S-Plus,
2703 type <kbd>M-x spl</kbd> and then hit [Tab]. You will then see if any defuns
2704 for particular versions of S-Plus have been created. These other versions of
2705 S-Plus can also be started from the "ESS-&gt;Start Process-&gt;Other" menu.
2707 <div class="node">
2708 <p><hr>
2709 <a name="ESS-help--assistance-with-viewing-help"></a>
2710 <a name="ESS_002dhelp_002d_002dassistance-with-viewing-help"></a>
2711 Next:&nbsp;<a rel="next" accesskey="n" href="#Philosophies-for-using-ESS_0028S_0029">Philosophies for using ESS(S)</a>,
2712 Previous:&nbsp;<a rel="previous" accesskey="p" href="#iESS_0028S_0029_002d_002dInferior-ESS-processes">iESS(S)--Inferior ESS processes</a>,
2713 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-the-S-family">ESS for the S family</a>
2715 </div>
2717 <!-- node-name, next, previous, up -->
2718 <h3 class="section">6.3 ESS-help&ndash;assistance with viewing help</h3>
2720 <p>ESS has built-in facilities for viewing help files from S. See <a href="#Help">Help</a>.
2722 <div class="node">
2723 <p><hr>
2724 <a name="Philosophies-for-using-ESS(S)"></a>
2725 <a name="Philosophies-for-using-ESS_0028S_0029"></a>
2726 Next:&nbsp;<a rel="next" accesskey="n" href="#Scenarios-for-use-_0028possibilities_002d_002dbased-on-actual-usage_0029">Scenarios for use (possibilities--based on actual usage)</a>,
2727 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS_002dhelp_002d_002dassistance-with-viewing-help">ESS-help--assistance with viewing help</a>,
2728 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-the-S-family">ESS for the S family</a>
2730 </div>
2732 <h3 class="section">6.4 Philosophies for using ESS[S]</h3>
2734 <p>The first is preferred, and configured for. The second one can be
2735 retrieved again, by changing emacs variables.
2737 <p>1: (preferred by the current group of developers): The source code is
2738 real. The objects are realizations of the source code. Source
2739 for EVERY user modified object is placed in a particular directory
2740 or directories, for later editing and retrieval.
2742 <p>2: (older version): S objects are real. Source code is a temporary
2743 realization of the objects. Dumped buffers should not be saved.
2744 _We_strongly_discourage_this_approach_. However, if you insist,
2745 add the following lines to your .emacs file:
2746 <pre class="example"> (setq ess-keep-dump-files 'nil)
2747 (setq ess-delete-dump-files t)
2748 (setq ess-mode-silently-save nil)
2749 </pre>
2750 <p>The second saves a small amount of disk space. The first allows for
2751 better portability as well as external version control for code.
2753 <div class="node">
2754 <p><hr>
2755 <a name="Scenarios-for-use-(possibilities--based-on-actual-usage)"></a>
2756 <a name="Scenarios-for-use-_0028possibilities_002d_002dbased-on-actual-usage_0029"></a>
2757 Next:&nbsp;<a rel="next" accesskey="n" href="#Customization-Examples-and-Solutions-to-Problems">Customization Examples and Solutions to Problems</a>,
2758 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Philosophies-for-using-ESS_0028S_0029">Philosophies for using ESS(S)</a>,
2759 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-the-S-family">ESS for the S family</a>
2761 </div>
2763 <h3 class="section">6.5 Scenarios for use (possibilities&ndash;based on actual usage)</h3>
2765 <p>We present some basic suggestions for using ESS to interact with S.
2766 These are just a subset of approaches, many better approaches are
2767 possible. Contributions of examples of how you work with ESS are
2768 appreciated (especially since it helps us determine priorities on
2769 future enhancements)! (comments as to what should be happening are
2770 prefixed by "##").
2771 <pre class="display"> 1: ## Data Analysis Example (source code is real)
2772 ## Load the file you want to work with
2773 C-x C-f myfile.s
2775 ## Edit as appropriate, and then start up S-PLUS 3.x
2776 M-x S+3
2778 ## A new buffer *S+3:1* will appear. Splus will have been started
2779 ## in this buffer. The buffer is in iESS [S+3:1] mode.
2781 ## Split the screen and go back to the file editing buffer.
2782 C-x 2 C-x b myfile.s
2784 ## Send regions, lines, or the entire file contents to S-PLUS. For regions,
2785 ## highlight a region with keystrokes or mouse and then send with:
2786 C-c C-r
2788 ## Re-edit myfile.s as necessary to correct any difficulties. Add
2789 ## new commands here. Send them to S by region with C-c C-r, or
2790 ## one line at a time with C-c C-n.
2792 ## Save the revised myfile.s with C-x C-s.
2794 ## Save the entire *S+3:1* interaction buffer with C-c C-s. You
2795 ## will be prompted for a file name. The recommended name is
2796 ## myfile.St. With the *.St suffix, the file will come up in ESS
2797 ## Transcript mode the next time it is accessed from Emacs.
2801 2: ## Program revision example (source code is real)
2803 ## Start up S-PLUS 3.x in a process buffer (this will be *S+3:1*)
2804 M-x S+3
2806 ## Load the file you want to work with
2807 C-x C-f myfile.s
2809 ## edit program, functions, and code in myfile.s, and send revised
2810 ## functions to S when ready with
2811 C-c C-f
2812 ## or highlighted regions with
2813 C-c C-r
2814 ## or individual lines with
2815 C-c C-n
2816 ## or load the entire buffer with
2817 C-c C-l
2819 ## save the revised myfile.s when you have finished
2820 C-c C-s
2824 3: ## Program revision example (S object is real)
2826 ## Start up S-PLUS 3.x in a process buffer (this will be *S+3:1*)
2827 M-x S+3
2829 ## Dump an existing S object my.function into a buffer to work with
2830 C-c C-d my.function
2831 ## a new buffer named yourloginname.my.function.S will be created with
2832 ## an editable copy of the object. The buffer is associated with the
2833 ## pathname /tmp/yourloginname.my.function.S and will amlost certainly not
2834 ## exist after you log off.
2836 ## enter program, functions, and code into work buffer, and send
2837 ## entire contents to S-PLUS when ready
2838 C-c C-b
2840 ## Go to *S+3:1* buffer, which is the process buffer, and examine
2841 ## the results.
2842 C-c C-y
2843 ## The sequence C-c C-y is a shortcut for: C-x b *S+3:1*
2845 ## Return to the work buffer (may/may not be prefixed)
2846 C-x C-b yourloginname.my.function.S
2847 ## Fix the function that didn't work, and resubmit by placing the
2848 ## cursor somewhere in the function and
2849 C-c C-f
2850 ## Or you could've selected a region (using the mouse, or keyboard
2851 ## via setting point/mark) and
2852 C-c C-r
2853 ## Or you could step through, line by line, using
2854 C-c C-n
2855 ## Or just send a single line (without moving to the next) using
2856 C-c C-j
2857 ## To fix that error in syntax for the "rchisq" command, get help
2858 ## by
2859 C-c C-v rchisq
2862 4: Data Analysis (S object is real)
2863 ## Start up S-PLUS 3.x, in a process buffer (this will be *S+3:1*)
2864 M-x S+3
2866 ## Work in the process buffer. When you find an object that needs
2867 ## to be changed (this could be a data frame, or a variable, or a
2868 ## function), dump it to a buffer:
2869 C-c C-d my.cool.function
2871 ## Edit the function as appropriate, and dump back in to the
2872 ## process buffer
2873 C-c C-b
2875 ## Return to the S-PLUS process buffer
2876 C-c C-y
2877 ## Continue working.
2879 ## When you need help, use
2880 C-c C-v rchisq
2881 ## instead of entering: help("rchisq")
2882 </pre>
2883 <div class="node">
2884 <p><hr>
2885 <a name="Customization-Examples-and-Solutions-to-Problems"></a>
2886 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Scenarios-for-use-_0028possibilities_002d_002dbased-on-actual-usage_0029">Scenarios for use (possibilities--based on actual usage)</a>,
2887 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-the-S-family">ESS for the S family</a>
2889 </div>
2891 <h3 class="section">6.6 Customization Examples and Solutions to Problems</h3>
2893 <p>1. Suppose that you are primarily an SPLUS 3.4 user, occasionally
2894 using S version 4, and sick and tired of the buffer-name *S+3*
2895 we've stuck you with. Simply edit the "ess-dialect" alist entry in
2896 the essd-sp3.el and essd-s4.el files to be "S" instead of "S4" and
2897 "S+3". This will ensure that all the inferior process buffer names
2898 are "*S*".
2900 <p>2. Suppose that you WANT to have the first buffer name indexed by
2901 ":1", in the same manner as your S-PLUS processes 2,3,4, and 5 (for
2902 you heavy simulation people). Then uncomment the line in ess-site
2903 (or add after your (require 'ess-site) or (load "ess-site") command
2904 in your .emacs file, the line:
2905 <pre class="example"> (setq ess-plain-first-buffername nil)
2906 </pre>
2907 <p>)
2909 <p>3. Fontlocking sometimes fails to behave nicely upon errors. When
2910 Splus dumps, a mis-matched " (double-quote) can result in the
2911 wrong font-lock face being used for the remainder of the buffer.
2913 <p>Solution: add a " at the end of the "Dumped..." statement, to
2914 revert the font-lock face back to normal.
2916 <!-- node-name, next, previous, up -->
2917 <div class="node">
2918 <p><hr>
2919 <a name="Editing"></a>
2920 Next:&nbsp;<a rel="next" accesskey="n" href="#Editing-R-documentation-files">Editing R documentation files</a>,
2921 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS-for-the-S-family">ESS for the S family</a>,
2922 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
2924 </div>
2926 <h2 class="chapter">7 Editing S functions</h2>
2928 <p><a name="index-editing-functions-122"></a>ESS provides facilities for editing S objects within your Emacs
2929 session. Most editing is performed on S functions, although in
2930 theory you may edit datasets as well. Edit buffers are always
2931 associated with files, although you may choose to make these files
2932 temporary if you wish. Alternatively, you may make use of a simple yet
2933 powerful mechanism for maintaining backups of text representations of
2934 S functions. Error-checking is performed when S code is loaded
2935 into the ESS process.
2937 <ul class="menu">
2938 <li><a accesskey="1" href="#Edit-buffer">Edit buffer</a>: Edit objects in a specialized buffer
2939 <li><a accesskey="2" href="#Loading">Loading</a>: Loading source files into the ESS process
2940 <li><a accesskey="3" href="#Error-Checking">Error Checking</a>: Detecting errors in source files
2941 <li><a accesskey="4" href="#Evaluating-code">Evaluating code</a>: Sending code to the ESS process
2942 <li><a accesskey="5" href="#Indenting">Indenting</a>: Indenting and formatting S code
2943 <li><a accesskey="6" href="#Other-edit-buffer-commands">Other edit buffer commands</a>: Commands for motion, completion and more
2944 <li><a accesskey="7" href="#Source-Files">Source Files</a>: Maintaining S source files
2945 <li><a accesskey="8" href="#Source-Directories">Source Directories</a>: Names and locations of dump files
2946 </ul>
2948 <!-- node-name, next, previous, up -->
2949 <div class="node">
2950 <p><hr>
2951 <a name="Edit-buffer"></a>
2952 Next:&nbsp;<a rel="next" accesskey="n" href="#Loading">Loading</a>,
2953 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Editing">Editing</a>,
2954 Up:&nbsp;<a rel="up" accesskey="u" href="#Editing">Editing</a>
2956 </div>
2958 <h3 class="section">7.1 Creating or modifying S objects</h3>
2960 <p><a name="index-edit-buffer-123"></a>
2961 To edit an S object, type
2963 <ul>
2964 <li><kbd>C-c C-d</kbd> (<code>ess-dump-object-into-edit-buffer</code>) <br>
2965 <a name="index-ess_002ddump_002dobject_002dinto_002dedit_002dbuffer-124"></a>Edit an S object in its own edit buffer.
2966 </ul>
2968 <p>from within the ESS process buffer (<code>*S*</code>). You will then be
2969 prompted for an object to edit: you may either type in the name of an
2970 existing object (for which completion is available using the <kbd>TAB</kbd>
2971 key),
2972 <a name="index-completion_002c-when-prompted-for-object-names-125"></a>or you may enter the name of a new object.
2973 <a name="index-creating-new-objects-126"></a><a name="index-new-objects_002c-creating-127"></a>A buffer will be created containing the text representation of the
2974 requested object or, if you entered the name of a non-existent object at
2975 the prompt and the variable <code>ess-function-template</code>
2976 <a name="index-ess_002dfunction_002dtemplate-128"></a>is non-<code>nil</code>, you will be presented with a template defined by that
2977 variable, which defaults to a skeleton function construct.
2979 <p>You may then edit the function as required. The edit buffer generated
2980 by <code>ess-dump-object-into-edit-buffer</code> is placed in the <code>ESS</code>
2981 major mode which provides a number of commands to facilitate editing
2982 S source code. Commands are provided to intelligently indent S
2983 code, evaluate portions of S code and to move around S code
2984 constructs.
2986 <p><a name="index-dump-files-129"></a><a name="index-reverting-function-definitions-130"></a>Note: when you dump a file with <kbd>C-c C-d</kbd>, ESS first checks
2987 to see whether there already exists an edit buffer containing that
2988 object and, if so, pops you directly to that buffer. If not, ESS next
2989 checks whether there is a file in the appropriate place with the
2990 appropriate name (see <a href="#Source-Files">Source Files</a>) and if so, reads in that file.
2991 You can use this facility to return to an object you were editing in a
2992 previous session (and which possibly was never loaded to the S
2993 session). Finally, if both these tests fail, the ESS process is
2994 consulted and a <code>dump()</code> command issued.
2995 <a name="index-dump_0028_0029-131"></a>If you want to force ESS to ask the ESS process for the object's
2996 definition (say, to reformat an unmodified buffer or to revert back to
2997 S's idea of the object's definition) pass a prefix argument to
2998 <code>ess-dump-object-into-edit-buffer</code> by typing <kbd>C-u C-c C-d</kbd>.
3000 <!-- node-name, next, previous, up -->
3001 <div class="node">
3002 <p><hr>
3003 <a name="Loading"></a>
3004 Next:&nbsp;<a rel="next" accesskey="n" href="#Error-Checking">Error Checking</a>,
3005 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Edit-buffer">Edit buffer</a>,
3006 Up:&nbsp;<a rel="up" accesskey="u" href="#Editing">Editing</a>
3008 </div>
3010 <h3 class="section">7.2 Loading source files into the ESS process</h3>
3012 <p>The best way to get information &mdash; particularly function definitions
3013 &mdash; into S is to load them in as source file, using S's
3014 <code>source</code> function. You have already seen how to create source
3015 files using <kbd>C-c C-d</kbd>; ESS provides a complementary command for
3016 loading source files (even files not created with ESS!) into the ESS
3017 process:
3019 <ul>
3020 <li><kbd>C-c C-l</kbd> (<code>ess-load-file</code>) <br>
3021 <a name="index-ess_002dload_002dfile-132"></a>Loads a file into the ESS process using <code>source()</code>.
3022 <a name="index-source_0028_0029-133"></a></ul>
3024 <p class="noindent">After typing <kbd>C-c C-l</kbd> you will prompted for the name of the file to
3025 load into S; usually this is the current buffer's file which is the
3026 default value (selected by simply pressing <kbd>RET</kbd> at the prompt).
3027 You will be asked to save the buffer first if it has been modified (this
3028 happens automatically if the buffer was generated with <kbd>C-c C-d</kbd>).
3029 The file will then be loaded, and if it loads successfully you will be
3030 returned to the ESS process.
3032 <!-- node-name, next, previous, up -->
3033 <div class="node">
3034 <p><hr>
3035 <a name="Error-Checking"></a>
3036 Next:&nbsp;<a rel="next" accesskey="n" href="#Evaluating-code">Evaluating code</a>,
3037 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Loading">Loading</a>,
3038 Up:&nbsp;<a rel="up" accesskey="u" href="#Editing">Editing</a>
3040 </div>
3042 <h3 class="section">7.3 Detecting errors in source files</h3>
3044 <p><a name="index-errors-134"></a><a name="index-parsing-errors-135"></a>If any errors occur when loading a file with <code>C-c C-l</code>, ESS will
3045 inform you of this fact. In this case, you can jump directly to the
3046 line in the source file which caused the error by typing <kbd>C-c `</kbd>
3047 (<code>ess-parse-errors</code>).
3048 <a name="index-ess_002dparse_002derrors-136"></a>You will be returned to the offending file (loading it into a buffer if
3049 necessary) with point at the line S reported as containing the
3050 error. You may then correct the error, and reload the file. Note that
3051 none of the commands in an S source file will take effect if any
3052 part of the file contains errors.
3054 <p>Sometimes the error is not caused by a syntax error (loading a
3055 non-existent file for example). In this case typing <kbd>C-c `</kbd> will
3056 simply display a buffer containing S's error message. You can force
3057 this behavior (and avoid jumping to the file when there <em>is</em> a
3058 syntax error) by passing a prefix argument to <code>ess-parse-errors</code>
3059 with <kbd>C-u C-c `</kbd>.
3061 <!-- node-name, next, previous, up -->
3062 <div class="node">
3063 <p><hr>
3064 <a name="Evaluating-code"></a>
3065 Next:&nbsp;<a rel="next" accesskey="n" href="#Indenting">Indenting</a>,
3066 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Error-Checking">Error Checking</a>,
3067 Up:&nbsp;<a rel="up" accesskey="u" href="#Editing">Editing</a>
3069 </div>
3071 <h3 class="section">7.4 Sending code to the ESS process</h3>
3073 <p>Other commands are also available for evaluating portions of code in the
3074 S process. These commands cause the selected code to be evaluated
3075 directly by the ESS process as if you had typed them in at the
3076 command line; the <code>source()</code> function is not used. You may choose
3077 whether both the commands and their output appear in the process buffer
3078 (as if you had typed in the commands yourself) or if the output alone is
3079 echoed. The behavior is controlled by the variable
3080 <code>ess-eval-visibly-p</code> whose default is <code>nil</code>
3081 <a name="index-ess_002deval_002dvisibly_002dp-137"></a>(display output only). Passing a prefix argument (<kbd>C-u</kbd>) to any of
3082 the following commands, however, reverses the meaning of
3083 <code>ess-eval-visibly-p</code> for that command only &mdash; for example <kbd>C-u
3084 C-c C-j</kbd> echoes the current line of S (or other) code in the ESS
3085 process buffer, followed by its output. This method of evaluation is an
3086 alternative to S's <code>source()</code> function
3087 <a name="index-source_0028_0029-138"></a><a name="index-echoing-commands-when-evaluating-139"></a><a name="index-evaluating-code-with-echoed-commands-140"></a>when you want the input as well as the output to be displayed. (You can
3088 sort of do this with <code>source()</code> when the option <code>echo=T</code> is
3089 set, except that prompts do not get displayed. ESS puts prompts in the
3090 right places.) The commands for evaluating code are:
3093 <a name="index-evaluating-S-expressions-141"></a>
3094 <ul><li><kbd>C-c C-j</kbd> (<code>ess-eval-line</code>) <br>
3095 <a name="index-ess_002deval_002dline-142"></a>Send the line containing point to the ESS process.
3097 <li><kbd>C-c M-j</kbd> (<code>ess-eval-line-and-go</code>) <br>
3098 <a name="index-ess_002deval_002dline_002dand_002dgo-143"></a>As above, but returns you to the ESS process buffer as well.
3100 <li><kbd>C-c C-f</kbd> or <kbd>ESC C-x</kbd> (aka <kbd>M-C-x</kbd>) (<code>ess-eval-function</code>) <br>
3101 <a name="index-ess_002deval_002dfunction-144"></a>Send the S function containing point to the ESS process.
3103 <li><kbd>C-c M-f</kbd> (<code>ess-eval-function-and-go</code>) <br>
3104 <a name="index-ess_002deval_002dfunction_002dand_002dgo-145"></a>As above, but returns you to the ESS process buffer as well.
3106 <li><kbd>C-c C-r</kbd> (<code>ess-eval-region</code>) <br>
3107 <a name="index-ess_002deval_002dregion-146"></a>Send the text between point and mark to the ESS process.
3109 <li><kbd>C-c M-r</kbd> (<code>ess-eval-region-and-go</code>) <br>
3110 <a name="index-ess_002deval_002dregion_002dand_002dgo-147"></a>As above, but returns you to the ESS process buffer as well.
3112 <li><kbd>C-c C-b</kbd> (<code>ess-eval-buffer</code>) <br>
3113 <a name="index-ess_002deval_002dbuffer-148"></a>Send the contents of the edit buffer to the ESS process.
3115 <li><kbd>C-c M-b</kbd> (<code>ess-eval-buffer-and-go</code>) <br>
3116 <a name="index-ess_002deval_002dfunction_002dand_002dgo-149"></a>As above, but returns you to the ESS process buffer as well.
3118 <li><kbd>C-c C-n</kbd> (<code>ess-eval-line-and-step</code>) <br>
3119 <a name="index-ess_002deval_002dline_002dand_002dstep-150"></a><a name="index-stepping-through-code-151"></a><a name="index-debugging-S-functions-152"></a>Sends the current line to the ESS process, echoing it in the process
3120 buffer, and moves point to the next line. Useful when debugging for
3121 stepping through your code.
3122 </ul>
3124 <p>It should be stressed once again that these <code>ess-eval-</code> commands
3125 should only be used for evaluating small portions of code for debugging
3126 purposes, or for generating transcripts from source files. When editing
3127 S functions, <kbd>C-c C-l</kbd> is the command to use to update the
3128 function's value. In particular, <code>ess-eval-buffer</code> is now largely
3129 obsolete.
3131 <p>One final command is provided for spot-evaluations of S code:
3133 <ul>
3134 <kbd>C-c C-t</kbd> (<code>ess-execute-in-tb</code>) <br>
3135 <a name="index-ess_002dexecute_002din_002dtb-153"></a>Prompt for an S expression and evaluate it. Displays result in a
3136 temporary buffer.
3137 </ul>
3139 <p class="noindent">This is useful for quick calculations, etc.
3141 <p>All the above commands are useful for evaluating small amounts of code
3142 and observing the results in the process buffer. A useful way to work
3143 is to divide the frame into two windows; one containing the source code
3144 and the other containing the process buffer. If you wish to make the
3145 process buffer scroll automatically when the output reaches the bottom
3146 of the window, you will need to set the variable
3147 <code>comint-scroll-to-bottom-on-output</code> to <code>'others</code> or <code>t</code>.
3149 <!-- node-name, next, previous, up -->
3150 <div class="node">
3151 <p><hr>
3152 <a name="Indenting"></a>
3153 Next:&nbsp;<a rel="next" accesskey="n" href="#Other-edit-buffer-commands">Other edit buffer commands</a>,
3154 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Evaluating-code">Evaluating code</a>,
3155 Up:&nbsp;<a rel="up" accesskey="u" href="#Editing">Editing</a>
3157 </div>
3159 <h3 class="section">7.5 Indenting and formatting S code</h3>
3161 <p>ESS now provides a sophisticated mechanism for indenting S source
3162 code (thanks to Ken'ichi Shibayama). Compound statements (delimited by
3163 `<samp><span class="samp">{</span></samp>' and `<samp><span class="samp">}</span></samp>') are indented relative to their enclosing block.
3164 In addition, the braces have been electrified to automatically indent to
3165 the correct position when inserted, and optionally insert a newline at
3166 the appropriate place as well. Lines which continue an incomplete
3167 expression are indented relative to the first line of the expression.
3168 Function definitions, <code>if</code> statements, calls to <code>expression()</code>
3169 and loop constructs are all recognized and indented appropriately. User
3170 variables are provided to control the amount if indentation in each
3171 case, and there are also a number of predefined indentation styles to
3172 choose from.
3174 <p><a name="index-comments-in-S-154"></a>Comments are also handled specially by ESS, using an idea borrowed from
3175 the Emacs-Lisp indentation style. By default,
3176 comments beginning with `<samp><span class="samp">###</span></samp>'
3177 are aligned to the beginning of the line. Comments beginning with
3178 `<samp><span class="samp">##</span></samp>' are aligned to the current level of indentation for the block
3179 containing the comment. Finally, comments beginning with `<samp><span class="samp">#</span></samp>' are
3180 aligned to a column on the right (the 40th column by default, but this
3181 value is controlled by the variable <code>comment-column</code>,)
3182 <a name="index-comment_002dcolumn-155"></a>or just after the expression on the line containing the comment if it
3183 extends beyond the indentation column. You turn off the default
3184 behavior by adding the line
3185 <code>(setq ess-fancy-comments nil)</code> to your <samp><span class="file">.emacs</span></samp> file.
3186 <a name="index-ess_002dfancy_002dcomments-156"></a>
3187 The indentation commands provided by ESS are:
3188 <a name="index-indenting-157"></a><a name="index-formatting-source-code-158"></a>
3189 <ul>
3190 <li><kbd>TAB</kbd> (<code>ess-indent-command</code>) <br>
3191 Indents the current line as S code. If a prefix argument is given,
3192 all following lines which are part of the same (compound) expression are
3193 indented by the same amount (but relative indents are preserved).
3195 <li><kbd>RET</kbd> (<code>newline-and-indent</code>) <br>
3196 <kbd>LFD</kbd> (<em>newline-and-indent</em>) <br>
3197 Insert a newline, and indent the next line. (Note that most keyboards
3198 nowadays do not have a &lt;LINEFEED&gt; key, but <kbd>C-j</kbd> is equivalent.)
3200 <li><kbd>ESC C-q</kbd> aka <kbd>M-C-q</kbd> aka <kbd>C-M-q</kbd> (<code>ess-indent-exp</code>) <br>
3201 Indents each line in the S (compound) expression which follows point.
3202 Very useful for beautifying your S code.
3204 <li><kbd>{</kbd> and <kbd>}</kbd> (<code>ess-electric-brace</code>) <br>
3205 The braces automatically indent to the correct position when typed.
3207 <li><kbd>M-;</kbd> (<code>indent-for-comment</code>) <br>
3208 Indents an existing comment line appropriately, or inserts an
3209 appropriate comment marker.
3211 <li><kbd>M-x ess-set-style</kbd> <br>
3212 Set the formatting style in this buffer to be one of the predefined
3213 styles: <code>GNU</code>, <code>BSD</code>, <code>K&amp;R</code>, <code>CLB</code>, and <code>C++</code>.
3214 The <code>DEFAULT</code> style uses the default values for the indenting
3215 variables (unless they have been modified in your <samp><span class="file">.emacs</span></samp> file.)
3216 <a name="index-g_t_0040file_007b_002eemacs_007d-file-159"></a>This command causes all of the formatting variables to be buffer-local.
3217 </ul>
3219 <!-- node-name, next, previous, up -->
3220 <div class="node">
3221 <p><hr>
3222 <a name="Other-edit-buffer-commands"></a>
3223 Next:&nbsp;<a rel="next" accesskey="n" href="#Source-Files">Source Files</a>,
3224 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Indenting">Indenting</a>,
3225 Up:&nbsp;<a rel="up" accesskey="u" href="#Editing">Editing</a>
3227 </div>
3229 <h3 class="section">7.6 Commands for motion, completion and more</h3>
3231 <p>A number of commands are provided to move across function definitions
3232 in the edit buffer:
3233 <ul>
3234 <li><kbd>ESC C-a</kbd> aka <kbd>C-M-a</kbd> (<code>ess-beginning-of-function</code>) <br>
3235 <a name="index-ess_002dbeginning_002dof_002dfunction-160"></a>Moves point to the beginning of the function containing point.
3237 <li><kbd>ESC C-e</kbd> aka <kbd>C-M-e</kbd> (<code>ess-end-of-function</code>) <br>
3238 <a name="index-ess_002dend_002dof_002dfunction-161"></a>Moves point to the end of the function containing point.
3240 <li><kbd>ESC C-h</kbd> aka <kbd>C-M-h</kbd> (<code>ess-mark-function</code>) <br>
3241 Places point at the beginning of the S function containing point, and
3242 mark at the end.
3243 </ul>
3244 Don't forget the usual Emacs commands for moving over balanced
3245 expressions and parentheses: See <a href="Emacs.html#Lists">Lists and Sexps</a>.
3247 <p><a name="index-completion-in-edit-buffer-162"></a>Completion is provided in the edit buffer in a similar fashion to the
3248 process buffer: <kbd>M-TAB</kbd> completes file names and <kbd>M-?</kbd> lists
3249 file completions. Since &lt;TAB&gt; is used for indentation in the edit
3250 buffer, object completion is now performed with <kbd>C-c TAB</kbd>. Note
3251 however that completion is only provided over globally known S objects
3252 (such as system functions) &mdash; it will <em>not</em> work for arguments to
3253 functions or other variables local to the function you are editing.
3255 <p>Finally, two commands are provided for returning to the ESS process buffer:
3257 <ul>
3258 <li><kbd>C-c C-z</kbd> (<code>ess-switch-to-end-of-ESS</code>) <br>
3259 <a name="index-ess_002dswitch_002dto_002dend_002dof_002dESS-163"></a>Returns you to the ESS process buffer, placing point at the end of the
3260 buffer.
3262 <li><kbd>C-c C-y</kbd> (<code>ess-switch-to-ESS</code>) <br>
3263 <a name="index-ess_002dswitch_002dto_002dESS-164"></a>Also returns to to the ESS process buffer, but leaves point where it was.
3264 </ul>
3266 <p>In addition some commands available in the process buffer are also
3267 available in the edit buffer. You can still read help files with
3268 <kbd>C-c C-v</kbd>, edit another function with <kbd>C-c C-d</kbd> and of course
3269 <kbd>C-c C-l</kbd> can be used to load a source file into S. See <a href="#Other">Other</a>,
3270 for more details on these commands.
3272 <!-- node-name, next, previous, up -->
3273 <div class="node">
3274 <p><hr>
3275 <a name="Source-Files"></a>
3276 Next:&nbsp;<a rel="next" accesskey="n" href="#Source-Directories">Source Directories</a>,
3277 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Other-edit-buffer-commands">Other edit buffer commands</a>,
3278 Up:&nbsp;<a rel="up" accesskey="u" href="#Editing">Editing</a>
3280 </div>
3282 <h3 class="section">7.7 Maintaining S source files</h3>
3284 <p>Every edit buffer in ESS is associated with a <dfn>dump file</dfn> on disk.
3285 Dump files are created whenever you type <kbd>C-c C-d</kbd>
3286 (<code>ess-dump-object-into-edit-buffer</code>), and may either be deleted
3287 after use, or kept as a backup file or as a means of keeping several
3288 versions of an S function.
3289 <a name="index-dump-files-165"></a>
3291 <div class="defun">
3292 &mdash; User Option: <b>ess-delete-dump-files</b><var><a name="index-ess_002ddelete_002ddump_002dfiles-166"></a></var><br>
3293 <blockquote><p>If non-<code>nil</code>, dump files created with C-c C-d are deleted
3294 immediately after they are created by the ess-process.
3295 </p></blockquote></div>
3297 <p>Since immediately after S dumps an object's definition to a disk
3298 file the source code on disk corresponds exactly to S's idea of the
3299 object's definition, the disk file isn't needed; deleting it now has the
3300 advantage that if you <em>don't</em> modify the file (say, because you
3301 just wanted to look at the definition of one of the standard S
3302 functions) the source dump file won't be left around when you kill the
3303 buffer. Note that this variable only applies to files generated with
3304 S's <code>dump</code> function; it doesn't apply to source files which already
3305 exist. The default value is <code>t</code>.
3307 <div class="defun">
3308 &mdash; User Option: <b>ess-keep-dump-files</b><var><a name="index-ess_002dkeep_002ddump_002dfiles-167"></a></var><br>
3309 <blockquote><p>Option controlling what to do with the dump file after an object has
3310 been successfully loaded into S. Valid values are <code>nil</code> (always
3311 delete), <code>ask</code> (always ask whether to delete), <code>check</code> (delete
3312 files generated with <kbd>C-c C-d</kbd> in this Emacs session, otherwise ask
3313 &mdash; this is the default) and <code>t</code> (never delete). This variable is
3314 buffer-local.
3315 </p></blockquote></div>
3317 <p>After an object has been successfully (i.e. without error) loaded
3318 back into S with <kbd>C-c C-l</kbd>, the disk file again corresponds
3319 exactly (well, almost &mdash; see below) to S's record of the object's
3320 definition, and so some people prefer to delete the disk file rather
3321 than unnecessarily use up space. This option allows you to do just
3322 that.
3324 <p><a name="index-comments-168"></a><a name="index-project-work-in-S-169"></a><a name="index-historic-backups-170"></a>If the value of <code>ess-keep-dump-files</code> is <code>t</code>, dump files are
3325 never deleted after they are loaded. Thus you can maintain a complete
3326 text record of the functions you have edited within ESS. Backup files
3327 are kept as usual, and so by using the Emacs numbered backup facility &mdash;
3328 see <a href="emacs.html#Backup-Names">Single or Numbered Backups</a>, you can keep a historic
3329 record of function definitions. Another possibility is to maintain the
3330 files with a version-control system such as RCS See <a href="emacs.html#Version-Control">Version Control</a>. As long as a dump file exists in the appropriate place for a
3331 particular object, editing that object with <kbd>C-c C-d</kbd> finds that
3332 file for editing (unless a prefix argument is given) &mdash; the ESS
3333 process is not consulted. Thus you can keep comments <em>outside</em> the
3334 function definition as a means of documentation that does not clutter
3335 the S object itself. Another useful feature is that you may format
3336 the code in any fashion you please without S re-indenting the code
3337 every time you edit it. These features are particularly useful for
3338 project-based work.
3340 <p>If the value of <code>ess-keep-dump-files</code> is nil, the dump file is always
3341 silently deleted after a successful load with <kbd>C-c C-l</kbd>. While this
3342 is useful for files that were created with <kbd>C-c C-d</kbd> it also applies
3343 to any other file you load (say, a source file of function
3344 definitions), and so can be dangerous to use unless you are careful.
3345 Note that since <code>ess-keep-dump-files</code> is buffer-local, you can make
3346 sure particular files are not deleted by setting it to <code>t</code> in the
3347 Local Variables section of the file See <a href="emacs.html#File-Variables">Local Variables in Files</a>.
3349 <p>A safer option is to set <code>ess-keep-dump-files</code> to <code>ask</code>; this
3350 means that ESS will always ask for confirmation before deleting the
3351 file. Since this can get annoying if you always want to delete dump
3352 files created with <code>C-c C-d</code>, but not any other files, setting
3353 <code>ess-keep-dump-files</code> to <code>check</code> (the default value) will
3354 silently delete dump files created with <kbd>C-c C-d</kbd> in the current
3355 Emacs session, but query for any other file. Note that in any case you
3356 will only be asked for confirmation once per file, and your answer is
3357 remembered for the rest of the Emacs session.
3359 <p>Note that in all cases, if an error (such as a syntax error) is detected
3360 while loading the file with <kbd>C-c C-l</kbd>, the dump file is <em>never</em>
3361 deleted. This is so that you can edit the file in a new Emacs session
3362 if you happen to quit Emacs before correcting the error.
3364 <p><a name="index-autosaving-171"></a>Dump buffers are always autosaved, regardless of the value of
3365 <code>ess-keep-dump-files</code>.
3367 <!-- node-name, next, previous, up -->
3368 <div class="node">
3369 <p><hr>
3370 <a name="Source-Directories"></a>
3371 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Source-Files">Source Files</a>,
3372 Up:&nbsp;<a rel="up" accesskey="u" href="#Editing">Editing</a>
3374 </div>
3376 <h3 class="section">7.8 Names and locations of dump files</h3>
3378 <p><a name="index-dump-file-names-172"></a>Every dump file should be given a unique file name, usually the dumped
3379 object name with some additions.
3381 <div class="defun">
3382 &mdash; User Option: <b>ess-dump-filename-template</b><var><a name="index-ess_002ddump_002dfilename_002dtemplate-173"></a></var><br>
3383 <blockquote><p>Template for filenames of dumped objects. <code>%s</code> is replaced by the
3384 object name.
3385 </p></blockquote></div>
3387 <p class="noindent">By default, dump file names are the user name, followed by `<samp><span class="samp">.</span></samp>' and
3388 the object and ending with `<samp><span class="samp">.S</span></samp>'. Thus if user <code>joe</code> dumps the
3389 object <code>myfun</code> the dump file will have name <samp><span class="file">joe.myfun.S</span></samp>.
3390 The username part is included to avoid clashes when dumping into a
3391 publicly-writable directory, such as <samp><span class="file">/tmp</span></samp>; you may wish to remove
3392 this part if you are dumping into a directory owned by you.
3394 <p><a name="index-dump-file-directories-174"></a>You may also specify the directory in which dump files are written:
3396 <div class="defun">
3397 &mdash; User Option: <b>ess-source-directory</b><var><a name="index-ess_002dsource_002ddirectory-175"></a></var><br>
3398 <blockquote><p>Directory name (ending in a slash) where S dump files are to be written.
3399 </p></blockquote></div>
3401 <p>By default, dump files are always written to <samp><span class="file">/tmp</span></samp>, which is fine
3402 when <code>ess-keep-dump-files</code> is <code>nil</code>. If you are keeping dump
3403 files, then you will probably want to keep them somewhere in your home
3404 directory, say <samp><span class="file">~/S-source</span></samp>. This could be achieved by including
3405 the following line in your <samp><span class="file">.emacs</span></samp> file:
3406 <a name="index-g_t_0040file_007b_002eemacs_007d-file-176"></a>
3407 <pre class="example"> (setq ess-source-directory (expand-file-name "~/S-source/"))
3408 </pre>
3409 <p>If you would prefer to keep your dump files in separate directories
3410 depending on the value of some variable, ESS provides a facility for
3411 this also. By setting <code>ess-source-directory</code> to a lambda
3412 expression which evaluates to a directory name, you have a great deal of
3413 flexibility in selecting the directory for a particular source file to
3414 appear in. The lambda expression is evaluated with the process buffer
3415 as the current buffer and so you can use the variables local to that
3416 buffer to make your choice. For example, the following expression
3417 causes source files to be saved in the subdirectory <samp><span class="file">Src</span></samp> of the
3418 directory the ESS process was run in.
3420 <pre class="example"> (setq ess-source-directory
3421 (lambda ()
3422 (concat ess-directory "Src/")))
3423 </pre>
3424 <p class="noindent"><a name="index-ess_002ddirectory-177"></a>(<code>ess-directory</code> is a buffer-local variable in process buffers
3425 which records the directory the ESS process was run from.) This is
3426 useful if you keep your dump files and you often edit objects with the
3427 same name in different ESS processes. Alternatively, if you often
3428 change your S working directory during an S session, you may
3429 like to keep dump files in some subdirectory of the directory pointed to
3430 by the first element of the current search list. This way you can edit
3431 objects of the same name in different directories during the one S
3432 session:
3433 <a name="index-search-list-178"></a><a name="index-working-directory-179"></a>
3434 <pre class="example"> (setq ess-source-directory
3435 (lambda ()
3436 (file-name-as-directory
3437 (expand-file-name (concat
3438 (car ess-search-list)
3439 "/.Src")))))
3440 </pre>
3441 <p><a name="index-ess_002dsearch_002dlist-180"></a>
3442 If the directory generated by the lambda function does not exist but can
3443 be created, you will be asked whether you wish to create the directory.
3444 If you choose not to, or the directory cannot be created, you will not
3445 be able to edit functions.
3447 <div class="node">
3448 <p><hr>
3449 <a name="Editing-R-documentation-files"></a>
3450 Next:&nbsp;<a rel="next" accesskey="n" href="#Help">Help</a>,
3451 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Editing">Editing</a>,
3452 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
3454 </div>
3456 <h2 class="chapter">8 Editing R documentation files</h2>
3458 <p>ESS also provides support for editing <dfn>R documentation</dfn> (&ldquo;Rd&rdquo;)
3459 files. R objects are documented in files written in Rd format, a
3460 simple markup language closely resembling (La)TeX, which can be
3461 processed into a variety of formats, including LaTeX, <acronym>HTML</acronym>,
3462 and plain text. Rd format is described in section &ldquo;Rd format&rdquo; of the
3463 &ldquo;Writing R Extensions&rdquo; manual in the R distribution.
3465 <p>Visiting an Rd file as characterized by its extension <samp><span class="file">Rd</span></samp> will
3466 activate Rd Mode, which provides several facilities for making editing R
3467 documentation files more convenient, by helping with indentation,
3468 insertions, even doing some of the typing for you (with Abbrev Mode),
3469 and by showing Rd keywords, strings, etc. in different faces (with
3470 Font Lock Mode).
3472 <p>Note that R also accepts Rd files with extension <samp><span class="file">rd</span></samp>; to activate
3473 <acronym>ESS[Rd]</acronym> support for this extension, you may need to add
3475 <pre class="example"> (add-to-list 'auto-mode-alist '("\\.rd\\'" . Rd-mode))
3476 </pre>
3477 <p class="noindent">to one of your Emacs startup files.
3479 <p>In Rd mode, the following special Emacs commands can be used in addition
3480 to the standard Emacs commands.
3482 <dl>
3483 <dt><kbd>C-h m</kbd><dd>Describe the features of Rd mode.
3485 <br><dt><kbd>LFD</kbd><dt><kbd>RET</kbd><dd>Reindent the current line, insert a newline and indent the new line
3486 (<code>reindent-then-newline-and-indent</code>). An abbrev before point is
3487 expanded if <code>abbrev-mode</code> is non-<code>nil</code>.
3489 <br><dt><kbd>TAB</kbd><dd>Indent current line based on its contents and on previous lines
3490 (<code>indent-according-to-mode</code>).
3492 <br><dt><kbd>C-c C-e</kbd><dd>Insert a &ldquo;skeleton&rdquo; with Rd markup for at least all mandatory entries
3493 in Rd files (<code>Rd-mode-insert-skeleton</code>). Note that many users
3494 might prefer to use the R function <code>prompt</code> on an existing R object
3495 to generate a non-empty Rd &ldquo;shell&rdquo; documenting the object (which
3496 already has all information filled in which can be obtained from the
3497 object).
3499 <br><dt><kbd>C-c C-f</kbd><dd>Insert &ldquo;font&rdquo; specifiers for some of the Rd markup commands markup
3500 available for emphasizing or quoting text, including markup for URLs and
3501 email addresses (<code>Rd-font</code>). <kbd>C-c C-f</kbd> is only a prefix; see
3502 e.g. <kbd>C-c C-f TAB</kbd> for the available bindings. Note that
3503 currently, not all of the Rd text markup as described in section
3504 &ldquo;Marking text&rdquo; of &ldquo;Writing R Extensions&rdquo; can be accessed via
3505 <kbd>C-c C-f</kbd>.
3507 <br><dt><kbd>C-c C-j</kbd><dd>Insert a suitably indented `<samp><span class="samp">\item{</span></samp>' on the next line
3508 (<code>Rd-mode-insert-item</code>).
3510 <br><dt><kbd>C-c C-p</kbd><dd>Preview a plain text version (&ldquo;help file&rdquo;, see <a href="#Help">Help</a>) generated
3511 from the Rd file (<code>Rd-preview-help</code>).
3512 </dl>
3514 <p>In addition, when editing Rd files one can interact with a running R
3515 process in a similar way as when editing R language files. E.g.,
3516 <kbd>C-c C-v</kbd> provides access to on-line help, and <kbd>C-c C-n</kbd> sends
3517 the current line to the R process for evaluation. This interaction is
3518 particularly useful when editing the examples in the Rd file. See
3519 <kbd>C-h m</kbd> for all available commands.
3521 <p>Rd mode also provides access to abbreviations for most of the Rd markup
3522 commands. Type <kbd>M-x list-abbrevs</kbd> with Abbrev mode turned on to
3523 list all available abbrevs. Note that all Rd abbrevs start with a grave
3524 accent.
3526 <p>Rd mode can be customized via the following variables.
3528 <dl>
3529 <dt><code>Rd-mode-hook</code><dd>Hook to be run when Rd mode is entered.
3530 <br><dt><code>Rd-indent-level</code><dd>The indentation of Rd code with respect to containing blocks. Default
3531 is 2.
3532 <br><dt><code>Rd-to-help-command</code><dd>The shell command used for converting Rd source to help text. Default
3533 is `<samp><span class="samp">R CMD Rd2txt</span></samp>'.
3534 </dl>
3536 <p>To automatically turn on the abbrev and font-lock features of Rd mode,
3537 add the following lines to one of your Emacs startup files:
3539 <pre class="example"> (add-hook 'Rd-mode-hook
3540 (lambda ()
3541 (abbrev-mode 1)
3542 (font-lock-mode 1)))
3543 </pre>
3544 <!-- node-name, next, previous, up -->
3545 <div class="node">
3546 <p><hr>
3547 <a name="Help"></a>
3548 Next:&nbsp;<a rel="next" accesskey="n" href="#ESS-for-SAS">ESS for SAS</a>,
3549 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Editing-R-documentation-files">Editing R documentation files</a>,
3550 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
3552 </div>
3554 <h2 class="chapter">9 Reading help files</h2>
3556 <p><a name="index-help-files-181"></a>
3557 ESS provides an easy-to-use facility for reading S help files from
3558 within Emacs. From within the ESS process buffer or any ESS edit
3559 buffer, typing <kbd>C-c C-v</kbd> (<code>ess-display-help-on-object</code>)
3560 <a name="index-ess_002ddisplay_002dhelp_002don_002dobject-182"></a>will prompt you for the name of an object for which you would like
3561 documentation. Completion is provided over all objects which have help
3562 files.
3564 <p>If the requested object has documentation, you will be popped into a
3565 buffer (named <code>*help(</code><var>obj-name</var><code>)*</code>) containing the help file.
3566 This buffer is placed in a special `S Help' mode which disables the
3567 usual editing commands but which provides a number of keys for paging
3568 through the help file:
3570 <ul>
3571 Help commands:
3573 <li><kbd>?</kbd> (<code>ess-describe-help-mode</code>) <br>
3574 <a name="index-ess_002ddescribe_002dhelp_002dmode-183"></a>Pops up a help buffer with a list of the commands available in S help
3575 mode.
3577 <li><kbd>h</kbd> (<code>ess-display-help-on-object</code>) <br>
3578 <a name="index-ess_002ddisplay_002dhelp_002don_002dobject-184"></a>Pop up a help buffer for a different object
3580 <p>Paging commands:
3582 <p><a name="index-paging-commands-in-help-buffers-185"></a><li><kbd>b</kbd> or <kbd>DEL</kbd> (<code>scroll-down</code>) <br>
3583 Move one page backwards through the help file.
3585 <li><kbd>SPC</kbd> (<code>scroll-up</code>) <br>
3586 Move one page forwards through the help file.
3588 <li><kbd>&gt;</kbd> (<code>beginning-of-buffer</code>) and <kbd>&lt;</kbd> (<code>end-of-buffer</code>)
3589 <br>
3590 Move to the beginning and end of the help file, respectively.
3592 <p>Section-based motion commands:
3594 <li><kbd>n</kbd> (<code>ess-skip-to-next-section</code>) and <kbd>p</kbd>
3595 (<code>ess-skip-to-previous-section</code>) <br> Move to the next and previous
3596 <a name="index-ess_002dskip_002dto_002dnext_002dsection-186"></a><a name="index-ess_002dskip_002dto_002dprevious_002dsection-187"></a>section header in the help file, respectively. A section header
3597 consists of a number of capitalized words, followed by a colon.
3599 <p>In addition, the <kbd>s</kbd> key followed by one of the following letters
3600 will jump to a particular section in the help file:
3601 <a name="index-ess_002dskip_002dto_002dhelp_002dsection-188"></a>
3602 <dl>
3603 <dt>`<samp><span class="samp">a</span></samp>'<dd>ARGUMENTS:
3605 <br><dt>`<samp><span class="samp">b</span></samp>'<dd>BACKGROUND:
3607 <br><dt>`<samp><span class="samp">B</span></samp>'<dd>BUGS:
3609 <br><dt>`<samp><span class="samp">d</span></samp>'<dd>DETAILS:
3611 <br><dt>`<samp><span class="samp">D</span></samp>'<dd>DESCRIPTION:
3613 <br><dt>`<samp><span class="samp">e</span></samp>'<dd>EXAMPLES:
3615 <br><dt>`<samp><span class="samp">n</span></samp>'<dd>NOTE:
3617 <br><dt>`<samp><span class="samp">o</span></samp>'<dd>OPTIONAL ARGUMENTS:
3619 <br><dt>`<samp><span class="samp">r</span></samp>'<dd>REQUIRED ARGUMENTS:
3621 <br><dt>`<samp><span class="samp">R</span></samp>'<dd>REFERENCES:
3623 <br><dt>`<samp><span class="samp">s</span></samp>'<dd>SIDE EFFECTS:
3625 <br><dt>`<samp><span class="samp">s</span></samp>'<dd>SEE ALSO:
3627 <br><dt>`<samp><span class="samp">u</span></samp>'<dd>USAGE:
3629 <br><dt>`<samp><span class="samp">v</span></samp>'<dd>VALUE:
3631 <br><dt>`<samp><span class="samp">&lt;</span></samp>'<dd>Jumps to beginning of file
3633 <br><dt>`<samp><span class="samp">&gt;</span></samp>'<dd>Jumps to end of file
3635 <br><dt>`<samp><span class="samp">?</span></samp>'<dd>Pops up a help buffer with a list of the defined section motion keys.
3636 </dl>
3638 <p>Miscellaneous:
3640 <li><kbd>l</kbd> (<code>ess-eval-line-and-step</code>) <br>
3641 <a name="index-ess_002deval_002dline_002dand_002dstep-189"></a>Evaluates the current line in the ESS process, and moves to the next
3642 line. Useful for running examples in help files.
3644 <li><kbd>r</kbd> (<code>ess-eval-region</code>) <br>
3645 <a name="index-ess_002deval_002dregion-190"></a>Send the contents of the current region to the ESS process. Useful
3646 for running examples in help files.
3648 <li><kbd>/</kbd> (<code>isearch-forward</code>) <br>
3649 Same as <kbd>C-s</kbd>.
3651 <p>Quit commands:
3653 <li><kbd>q</kbd> (<code>ess-switch-to-end-of-ESS</code>) <br>
3654 <a name="index-ess_002dswitch_002dto_002dend_002dof_002dESS-191"></a>Returns to the ESS process buffer in another window, leaving the
3655 help window visible.
3657 <li><kbd>k</kbd> (<code>kill-buffer</code>) <br>
3658 Kills the help buffer.
3660 <li><kbd>x</kbd> (<code>ess-kill-buffer-and-go</code>) <br>
3661 Return to the ESS process, killing this help buffer.
3662 </ul>
3664 <p>In addition, all of the ESS commands available in the edit buffers are
3665 also available in S help mode (see <a href="#Edit-buffer">Edit buffer</a>). Of course, the
3666 usual (non-editing) Emacs commands are available, and for convenience
3667 the digits and &lt;-&gt; act as prefix arguments.
3669 <p>If a help buffer already exists for an object for which help is
3670 requested, that buffer is popped to immediately; the ESS process is
3671 not consulted at all. If the contents of the help file have changed,
3672 you either need to kill the help buffer first, or pass a prefix argument
3673 (with <kbd>C-u</kbd>) to <code>ess-display-help-on-object</code>.
3675 <p>Help buffers are marked as temporary buffers in ESS, and are deleted
3676 when <code>ess-quit</code> or <code>ess-cleanup</code> are called.
3678 <p>Help buffers normally appear in another window within the current
3679 frame. If you wish help buffers to appear in their own frame (either
3680 one per help buffer, or one for all help buffers), you can customize the
3681 variable <code>ess-help-own-frame</code>.
3683 <p><a name="index-ess_002dquit-192"></a><a name="index-ess_002dcleanup-193"></a><a name="index-temporary-buffers-194"></a>
3684 <!-- node-name, next, previous, up -->
3685 <div class="node">
3686 <p><hr>
3687 <a name="ESS-for-SAS"></a>
3688 Next:&nbsp;<a rel="next" accesskey="n" href="#ESS-for-BUGS">ESS for BUGS</a>,
3689 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Help">Help</a>,
3690 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
3692 </div>
3694 <h2 class="chapter">10 ESS for SAS</h2>
3696 <ul class="menu">
3697 <li><a accesskey="1" href="#ESS_0028SAS_0029_002d_002dDesign-philosophy">ESS(SAS)--Design philosophy</a>
3698 <li><a accesskey="2" href="#ESS_0028SAS_0029_002d_002dEditing-files">ESS(SAS)--Editing files</a>
3699 <li><a accesskey="3" href="#ESS_0028SAS_0029_002d_002dTAB-key">ESS(SAS)--TAB key</a>
3700 <li><a accesskey="4" href="#ESS_0028SAS_0029_002d_002dBatch-SAS-processes">ESS(SAS)--Batch SAS processes</a>
3701 <li><a accesskey="5" href="#ESS_0028SAS_0029_002d_002dFunction-keys-for-batch-processing">ESS(SAS)--Function keys for batch processing</a>
3702 <li><a accesskey="6" href="#iESS_0028SAS_0029_002d_002dInteractive-SAS-processes">iESS(SAS)--Interactive SAS processes</a>
3703 <li><a accesskey="7" href="#iESS_0028SAS_0029_002d_002dCommon-problems">iESS(SAS)--Common problems</a>
3704 <li><a accesskey="8" href="#ESS_0028SAS_0029_002d_002dGraphics">ESS(SAS)--Graphics</a>
3705 <li><a accesskey="9" href="#ESS_0028SAS_0029_002d_002dWindows">ESS(SAS)--Windows</a>
3706 </ul>
3708 <p><acronym>ESS[SAS]</acronym> was designed for use with <acronym>SAS</acronym><!-- /@w -->. It is descended from emacs
3709 macros developed by John Sall for editing <acronym>SAS</acronym><!-- /@w --> programs and <code>SAS-mode</code> by
3710 Tom Cook. Those editing features and new advanced features are part of
3711 <acronym>ESS[SAS]</acronym>. The user interface of <acronym>ESS[SAS]</acronym> has similarities with <acronym>ESS[S]</acronym>
3712 and the <acronym>SAS</acronym><!-- /@w --> Display Manager.
3714 <!-- node-name, next, previous, up -->
3715 <div class="node">
3716 <p><hr>
3717 <a name="ESS(SAS)--Design-philosophy"></a>
3718 <a name="ESS_0028SAS_0029_002d_002dDesign-philosophy"></a>
3719 Next:&nbsp;<a rel="next" accesskey="n" href="#ESS_0028SAS_0029_002d_002dEditing-files">ESS(SAS)--Editing files</a>,
3720 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS-for-SAS">ESS for SAS</a>,
3721 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-SAS">ESS for SAS</a>
3723 </div>
3725 <h3 class="section">10.1 ESS(SAS)&ndash;Design philosophy</h3>
3727 <p><acronym>ESS[SAS]</acronym> was designed to aid the user in writing and maintaining <acronym>SAS</acronym><!-- /@w -->
3728 programs, such as <samp><var>foo</var><span class="file">.sas</span></samp>. Both interactive and batch
3729 submission of <acronym>SAS</acronym><!-- /@w --> programs is supported.
3731 <p><acronym>ESS[SAS]</acronym> was written with two primary goals.
3732 <ol type=1 start=1>
3733 <li>The emacs text editor provides a powerful and flexible development
3734 environment for programming languages. These features are a boon to all
3735 programmers and, with the help of <acronym>ESS[SAS]</acronym>, to <acronym>SAS</acronym><!-- /@w --> users as well.
3736 <li>Although a departure from <acronym>SAS</acronym><!-- /@w --> Display Manager, <acronym>ESS[SAS]</acronym> provides
3737 similar key definitions to give novice <acronym>ESS[SAS]</acronym> users a head start.
3738 Also, inconvenient <acronym>SAS</acronym><!-- /@w --> Display Manager features, like remote submission
3739 and syntax highlighting, are provided transparently; appealing to
3740 advanced <acronym>ESS[SAS]</acronym> users.
3741 </ol>
3743 <!-- node-name, next, previous, up -->
3744 <div class="node">
3745 <p><hr>
3746 <a name="ESS(SAS)--Editing-files"></a>
3747 <a name="ESS_0028SAS_0029_002d_002dEditing-files"></a>
3748 Next:&nbsp;<a rel="next" accesskey="n" href="#ESS_0028SAS_0029_002d_002dTAB-key">ESS(SAS)--TAB key</a>,
3749 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS_0028SAS_0029_002d_002dDesign-philosophy">ESS(SAS)--Design philosophy</a>,
3750 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-SAS">ESS for SAS</a>
3752 </div>
3754 <h3 class="section">10.2 ESS(SAS)&ndash;Editing files</h3>
3756 <p><acronym>ESS[SAS]</acronym> is the mode for editing <acronym>SAS</acronym><!-- /@w --> language files. This mode handles:
3758 <ul>
3759 <li>proper indenting, generated by both &lt;TAB&gt; and &lt;RET&gt;.
3760 <li>color and font choices based on syntax.
3761 <li>ability to save and submit the file you are working on as a batch
3762 <acronym>SAS</acronym><!-- /@w --> process with a single keypress and to continue editing while it is runs
3763 in the background.
3764 <li>capability of killing the batch <acronym>SAS</acronym><!-- /@w --> process through the <samp><span class="file">*shell*</span></samp> buffer or
3765 allow the <acronym>SAS</acronym><!-- /@w --> process to keep on running after you exit emacs.
3766 <li>single keypress navigation of <samp><span class="file">.sas</span></samp>, <samp><span class="file">.log</span></samp> and <samp><span class="file">.lst</span></samp> files
3767 (<samp><span class="file">.log</span></samp> and <samp><span class="file">.lst</span></samp> files are refreshed with each keypress).
3768 <li>ability to send the contents of an entire buffer, a highlighted region,
3769 or a single line to an interactive <acronym>SAS</acronym><!-- /@w --> process.
3770 <li>ability to switch between processes which would be the target of the
3771 buffer (for the above).
3772 </ul>
3774 <p><acronym>ESS[SAS]</acronym> is automatically turned on when editing a file with a <samp><span class="file">.sas</span></samp>
3775 suffix (or other extension, if specified via <code>auto-mode-alist</code>). The function
3776 keys can be enabled to use the same function keys that
3777 the <acronym>SAS</acronym><!-- /@w --> Display Manager does. The interactive capabilities of <acronym>ESS</acronym> require you
3778 to start an inferior <acronym>SAS</acronym><!-- /@w --> process with <kbd>M-x&nbsp;SAS</kbd><!-- /@w -->
3779 (See <a href="#iESS_0028SAS_0029_002d_002dInteractive-SAS-processes">iESS(SAS)&ndash;Interactive SAS processes</a>.)
3781 <p>At this writing, the indenting and syntax highlighting are generally
3782 correct. Known issues: for multiple line <code>*</code> or <code>%*</code> comments, only the
3783 first line is highlighted; for <samp><span class="file">.log</span></samp> files, only the first line of a
3784 <code>NOTE:</code>, <code>WARNING:</code> or <code>ERROR:</code> message is highlighted; unmatched
3785 single/double quotes in <code>CARDS</code> data lines are <strong>NOT</strong> ignored; in an
3786 iterative <code>DO</code> statement, <code>TO</code> and <code>BY</code> are not highlighted.
3788 <!-- node-name, next, previous, up -->
3789 <div class="node">
3790 <p><hr>
3791 <a name="ESS(SAS)--TAB-key"></a>
3792 <a name="ESS_0028SAS_0029_002d_002dTAB-key"></a>
3793 Next:&nbsp;<a rel="next" accesskey="n" href="#ESS_0028SAS_0029_002d_002dBatch-SAS-processes">ESS(SAS)--Batch SAS processes</a>,
3794 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS_0028SAS_0029_002d_002dEditing-files">ESS(SAS)--Editing files</a>,
3795 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-SAS">ESS for SAS</a>
3797 </div>
3799 <h3 class="section">10.3 ESS(SAS)&ndash;&lt;TAB&gt; key</h3>
3801 <p>Two options. The &lt;TAB&gt; key is bound by default to <code>sas-indent-line</code>. This
3802 function is used to syntactically indent <acronym>SAS</acronym><!-- /@w --> code so <code>PROC</code> and <code>RUN</code> are in
3803 the left margin, other statements are indented <code>sas-indent-width</code> spaces from the margin,
3804 continuation lines are indented <code>sas-indent-width</code> spaces in from the beginning column of
3805 that statement. This is the type of functionality that emacs provides
3806 in most programming language modes. This functionality is equivalent to
3807 uncommenting the following line in <samp><span class="file">ess-site.el</span></samp>:
3808 <pre class="example"> (setq ess-sas-edit-keys-toggle nil)
3809 </pre>
3810 <p><acronym>ESS</acronym> provides an alternate behavior for &lt;TAB&gt; that makes it behave
3811 as it does in <acronym>SAS</acronym><!-- /@w --> Display Manager, i.e. move the cursor to the next stop.
3812 The alternate behavior also provides a "TAB" backwards, <kbd>C-&lt;TAB&gt;</kbd><!-- /@w -->, that
3813 moves the cursor to the stop to the left and deletes any characters
3814 between them. This functionality is obtained by uncommenting the
3815 following line in <samp><span class="file">ess-site.el</span></samp>:
3816 <pre class="example"> (setq ess-sas-edit-keys-toggle t)
3817 </pre>
3818 <p>Under the alternate behavior, &lt;TAB&gt; is bound to <kbd>M-x&nbsp;tab-to-tab-stop</kbd><!-- /@w -->
3819 and the stops are defined by <code>ess-sas-tab-stop-list</code>.
3821 <!-- node-name, next, previous, up -->
3822 <div class="node">
3823 <p><hr>
3824 <a name="ESS(SAS)--Batch-SAS-processes"></a>
3825 <a name="ESS_0028SAS_0029_002d_002dBatch-SAS-processes"></a>
3826 Next:&nbsp;<a rel="next" accesskey="n" href="#ESS_0028SAS_0029_002d_002dFunction-keys-for-batch-processing">ESS(SAS)--Function keys for batch processing</a>,
3827 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS_0028SAS_0029_002d_002dTAB-key">ESS(SAS)--TAB key</a>,
3828 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-SAS">ESS for SAS</a>
3830 </div>
3832 <h3 class="section">10.4 ESS(SAS)&ndash;Batch SAS processes</h3>
3834 <p>Submission of a <acronym>SAS</acronym><!-- /@w --> batch job is dependent on your environment.
3835 <code>ess-sas-submit-method</code> is determined by your operating system and
3836 your shell. It defaults to <code>'sh</code> unless you are running Windows or
3837 Mac Classic. Under Windows, it will default to <code>'sh</code> if you are using
3838 a <acronym>UNIX</acronym>-imitating shell; otherwise <code>'ms-dos</code> for an <acronym>MS-DOS</acronym>
3839 shell. On Mac OS X, it will default to <code>'sh</code>, but under Mac Classic,
3840 it defaults to <code>'apple-script</code>. You will also set this to <code>'sh</code>
3841 if the <acronym>SAS</acronym><!-- /@w --> batch job needs to run on a remote machine rather than your
3842 local machine. This works transparently if you are editing the remote file
3843 via ange-ftp/EFS or tramp. Note that
3844 <code>ess-sas-shell-buffer-remote-init</code> is a Local Variable that defaults
3845 to <code>"ssh"</code> which will be used to open the buffer on the remote host
3846 and it is assumed that no password is necessary, i.e. you are using
3847 <code>ssh-agent</code>/<code>ssh-add</code> or the equivalent (see the discussion about
3848 Local Variables below if you need to change the default).
3850 <p>However, if you are editing the file locally and transferring it back and
3851 forth with Kermit, you need some additional steps. First, start Kermit
3852 locally before remotely logging in. Open a local copy of the file with the
3853 <code>ess-kermit-prefix</code> character prepended (the default is <code>"#"</code>).
3854 Execute the command <kbd>M-x&nbsp;ess-kermit-get</kbd><!-- /@w --> which automatically brings
3855 the contents of the remote file into your local copy. If you transfer
3856 files with Kermit manually in a <samp><span class="file">*shell*</span></samp> buffer, then note that the
3857 Kermit escape sequence is <kbd>C-q&nbsp;C-&nbsp;c</kbd><!-- /@w --> rather than <kbd>C-&nbsp;c</kbd><!-- /@w --> which
3858 it would be in an ordinary terminal application, i.e. not in an emacs
3859 buffer. Lastly, note that the remote Kermit command is specified by
3860 <code>ess-kermit-command</code>.
3862 <p>The command used by the <code>SUBMIT</code> function key (&lt;F3&gt; or &lt;F8&gt;)
3863 to submit a batch <acronym>SAS</acronym><!-- /@w --> job, whether local or remote, is
3864 <code>ess-sas-submit-command</code> which defaults to <code>sas-program</code>.
3865 <code>sas-program</code> is <code>"invoke SAS using program file"</code> for Mac
3866 Classic and <code>"sas"</code> otherwise. However, you may have to alter
3867 <code>ess-sas-submit-command</code> for a particular program, so it is defined as
3868 buffer-local. Conveniently, it can be set at the end of the program:
3869 <pre class="example"> endsas;
3870 Local variables:
3871 ess-sas-submit-command: "sas8"
3872 End:
3873 </pre>
3874 <p>The command line is also made of <code>ess-sas-submit-pre-command</code>,
3875 <code>ess-sas-submit-post-command</code> and <code>ess-sas-submit-command-options</code>
3876 (the last of which is also buffer-local).
3877 Here are some examples for your <samp><span class="file">~/.emacs</span></samp> or <samp><span class="file">~/.xemacs/init.el</span></samp>
3878 file (you may also use <kbd>M-x&nbsp;customize-variable</kbd><!-- /@w -->):
3879 <pre class="example"> ;'sh default
3880 (setq ess-sas-submit-pre-command "nohup")
3881 ;'sh default
3882 (setq ess-sas-submit-post-command "-rsasuser &amp;")
3883 ;'sh example
3884 (setq-default ess-sas-submit-command "/usr/local/sas/sas")
3885 ;'ms-dos default
3886 (setq ess-sas-submit-pre-command "start")
3887 ;'ms-dos default
3888 (setq ess-sas-submit-post-command "-rsasuser -icon")
3889 ;Windows example
3890 (setq-default ess-sas-submit-command "c:/progra~1/sas/sas.exe")
3891 ;Windows example
3892 (setq-default ess-sas-submit-command "c:\\progra~1\\sas\\sas.exe")
3893 </pre>
3894 <p>There is a built-in delay before a batch <acronym>SAS</acronym><!-- /@w --> job is submitted when using
3895 a <acronym>UNIX</acronym>-imitating shell under Windows. This is necessary in many cases
3896 since the shell might not be ready to receive a command. This delay is
3897 currently set high enough so as not to be a problem. But, there may be
3898 cases when it needs to be set higher, or could be set much lower to
3899 speed things up. You can over-ride the default in your <samp><span class="file">~/.emacs</span></samp> or <samp><span class="file">~/.xemacs/init.el</span></samp> file by:
3900 <pre class="example"> (setq ess-sleep-for 0.2)
3901 </pre>
3902 <p>For example, <code>(setq ess-sas-global-unix-keys t)</code> keys shown,
3903 <code>(setq ess-sas-global-pc-keys t)</code> in parentheses;
3904 <acronym>ESS[SAS]</acronym> function keys are presented in the next section.
3905 Open the file you want to work with <kbd>C-x&nbsp;C-f&nbsp;foo.sas</kbd><!-- /@w -->.
3906 <samp><var>foo</var><span class="file">.sas</span></samp> will be in <acronym>ESS[SAS]</acronym> mode. Edit as appropriate, then save and
3907 submit the batch <acronym>SAS</acronym><!-- /@w --> job.
3908 <pre class="example"> &lt;F3&gt; (&lt;F8&gt;)
3909 </pre>
3910 <p>The job runs in the <samp><span class="file">*shell*</span></samp> buffer while you continue to edit
3911 <samp><var>foo</var><span class="file">.sas</span></samp>. If <code>ess-sas-submit-method</code> is <code>'sh</code>, then the
3912 message buffer will display the shell notification when the
3913 job is complete. The <code>'sh</code> setting also allows you to
3914 terminate the <acronym>SAS</acronym><!-- /@w --> batch job before it is finished.
3915 <pre class="example"> &lt;F8&gt; (&lt;F3&gt;)
3916 </pre>
3917 <p>Terminating a <acronym>SAS</acronym><!-- /@w --> batch in the <samp><span class="file">*shell*</span></samp> buffer.
3918 <pre class="example"> kill <var>PID</var>
3919 </pre>
3920 <p>You may want to visit the <samp><span class="file">.log</span></samp> (whether the job is still running
3921 or it is finished) and check for error messages. The <samp><span class="file">.log</span></samp> will be
3922 refreshed and you will be placed in it's buffer. You will be
3923 taken to the first error message, if any.
3924 <pre class="example"> &lt;F5&gt; (&lt;F6&gt;)
3925 </pre>
3926 <p>Goto the next error message, if any.
3927 <pre class="example"> &lt;F5&gt; (&lt;F6&gt;)
3928 </pre>
3929 <p>Now, `<samp><span class="samp">refresh</span></samp>' the <samp><span class="file">.lst</span></samp> and go to it's buffer.
3930 <pre class="example"> &lt;F6&gt; (&lt;F7&gt;)
3931 </pre>
3932 <p>If you wish to make changes, go to the <samp><span class="file">.sas</span></samp> file with.
3933 <pre class="example"> &lt;F4&gt; (&lt;F5&gt;)
3934 </pre>
3935 <p>Make your editing changes and submit again.
3936 <pre class="example"> &lt;F3&gt; (&lt;F8&gt;)
3937 </pre>
3938 <!-- node-name, next, previous, up -->
3939 <div class="node">
3940 <p><hr>
3941 <a name="ESS(SAS)--Function-keys-for-batch-processing"></a>
3942 <a name="ESS_0028SAS_0029_002d_002dFunction-keys-for-batch-processing"></a>
3943 Next:&nbsp;<a rel="next" accesskey="n" href="#iESS_0028SAS_0029_002d_002dInteractive-SAS-processes">iESS(SAS)--Interactive SAS processes</a>,
3944 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS_0028SAS_0029_002d_002dBatch-SAS-processes">ESS(SAS)--Batch SAS processes</a>,
3945 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-SAS">ESS for SAS</a>
3947 </div>
3949 <h3 class="section">10.5 ESS(SAS)&ndash;Function keys for batch processing</h3>
3951 <p>The setup of function keys for <acronym>SAS</acronym><!-- /@w --> batch processing
3952 is unavoidably complex, but the usage of function keys is simple.
3953 There are five distinct options:
3955 <p>Option 1 (default). Function keys in <acronym>ESS[SAS]</acronym> are not bound to elisp
3956 commands. This is in accordance with the GNU Elisp Coding Standards
3957 (<acronym>GECS</acronym>) which do not allow function keys to be bound so that they are
3958 available to the user.
3960 <p>Options 2-5. Since <acronym>GECS</acronym> does not allow function keys to be bound by
3961 modes, these keys are often unused. So, <acronym>ESS[SAS]</acronym> provides users with
3962 the option of binding elisp commands to these keys. Users who are
3963 familiar with <acronym>SAS</acronym><!-- /@w --> will, most likely, want to duplicate the function key
3964 capabilities of the <acronym>SAS</acronym><!-- /@w --> Display Manager. There are four options (noted
3965 in parentheses).
3967 <ol type=a start=1>
3968 <li><acronym>SAS</acronym><!-- /@w --> Display Manager has different function key definitions for
3969 <acronym>UNIX</acronym> (2, 4) and Windows (3, 5); <acronym>ESS[SAS]</acronym> can use either.
3970 <li>The <acronym>ESS[SAS]</acronym> function key definitions can be active in all buffers
3971 (global: 4, 5) or limited (local: 2, 3) only to buffers with files that
3972 are associated with <acronym>ESS[SAS]</acronym> as specified in your <code>auto-mode-alist</code>.
3973 </ol>
3975 <p>The distinction between local and global is subtle. If you want the
3976 <acronym>ESS[SAS]</acronym> definitions to work when you are in the <samp><span class="file">*shell*</span></samp> buffer or when
3977 editing files other than the file extensions that <acronym>ESS[SAS]</acronym> recognizes,
3978 you will most likely want to use the global definitions. If you want
3979 your function keys to understand <acronym>SAS</acronym><!-- /@w --> batch commands when you are editing
3980 <acronym>SAS</acronym><!-- /@w --> files, and to behave normally when editing other files, then you
3981 will choose the local definitions. The option can be chosen by the
3982 person installing <acronym>ESS</acronym> for a site or by an individual.
3984 <ol type=a start=1>
3985 <li>For a site installation or an individual, uncomment <strong>ONLY ONE</strong> of the
3986 following lines in your <samp><span class="file">ess-site.el</span></samp>. <acronym>ESS[SAS]</acronym> function keys are
3987 available in <acronym>ESS[SAS]</acronym> if you uncomment either 2 or 3 and in all modes if
3988 you uncomment 4 or 5:
3989 <pre class="example"> ;;2; (setq ess-sas-local-unix-keys t)
3990 ;;3; (setq ess-sas-local-pc-keys t)
3991 ;;4; (setq ess-sas-global-unix-keys t)
3992 ;;5; (setq ess-sas-global-pc-keys t)
3993 </pre>
3994 <p>The names <code>-unix-</code> and <code>-pc-</code> have nothing to do with the operating system
3995 that you are running. Rather, they mimic the definitions that the <acronym>SAS</acronym><!-- /@w -->
3996 Display Manager uses by default on those platforms.
3998 <li>If your site installation has configured the keys contrary to your
3999 liking, then you must call the appropriate function.
4000 <pre class="example"> (load "ess-site") ;; local-unix-keys
4001 (ess-sas-global-pc-keys)
4002 </pre>
4003 </ol>
4005 <p>Finally, we get to what the function keys actually do. You may recognize
4006 some of the nicknames as <acronym>SAS</acronym><!-- /@w --> Display Manager commands (they are in all
4007 capitals).
4009 <p><table summary=""><tr align="left"><td valign="top"><acronym>UNIX</acronym> </td><td valign="top"><acronym>PC</acronym> </td><td valign="top">Nickname
4010 <br></td></tr><tr align="left"><td valign="top">&lt;F2&gt; </td><td valign="top">&lt;F2&gt; </td><td valign="top">`<samp><span class="samp">refresh</span></samp>'
4011 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4012 revert the current buffer with the file of the same
4013 name if the file is newer than the buffer
4014 <br></td></tr><tr align="left"><td valign="top">&lt;F3&gt; </td><td valign="top">&lt;F8&gt; </td><td valign="top"><code>SUBMIT</code>
4015 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4016 save the current <samp><span class="file">.sas</span></samp> file (which is either the <samp><span class="file">.sas</span></samp>
4017 file in the current buffer or the <samp><span class="file">.sas</span></samp> file associated
4018 with the <samp><span class="file">.lst</span></samp> or <samp><span class="file">.log</span></samp> file in the current buffer)
4019 and submit the file as a batch <acronym>SAS</acronym><!-- /@w --> job
4020 <br></td></tr><tr align="left"><td valign="top">&lt;F4&gt; </td><td valign="top">&lt;F5&gt; </td><td valign="top"><code>PROGRAM</code>
4021 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4022 switch buffer to <samp><span class="file">.sas</span></samp> file
4023 <br></td></tr><tr align="left"><td valign="top">&lt;F5&gt; </td><td valign="top">&lt;F6&gt; </td><td valign="top"><code>LOG</code>
4024 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4025 switch buffer to <samp><span class="file">.log</span></samp> file, `<samp><span class="samp">refresh</span></samp>' and goto next
4026 error message, if any
4027 <br></td></tr><tr align="left"><td valign="top">&lt;F6&gt; </td><td valign="top">&lt;F7&gt; </td><td valign="top"><code>OUTPUT</code>
4028 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4029 switch buffer to <samp><span class="file">.lst</span></samp> file and `<samp><span class="samp">refresh</span></samp>'
4030 <br></td></tr><tr align="left"><td valign="top">&lt;F7&gt; </td><td valign="top">&lt;F4&gt; </td><td valign="top">`<samp><span class="samp">filetype-1</span></samp>'
4031 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4032 switch buffer to `<samp><span class="samp">filetype-1</span></samp>' (defaults to <samp><span class="file">.txt</span></samp>) file
4033 and `<samp><span class="samp">refresh</span></samp>'
4034 <br></td></tr><tr align="left"><td valign="top">&lt;F8&gt; </td><td valign="top">&lt;F3&gt; </td><td valign="top">`<samp><span class="samp">shell</span></samp>'
4035 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4036 switch buffer to <samp><span class="file">*shell*</span></samp>
4037 <br></td></tr><tr align="left"><td valign="top">&lt;F9&gt; </td><td valign="top">&lt;F9&gt; </td><td valign="top"><code>VIEWTABLE</code>
4038 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4039 open an interactive <code>PROC FSEDIT</code> session on the <acronym>SAS</acronym><!-- /@w -->
4040 dataset near point
4041 <br></td></tr><tr align="left"><td valign="top">&lt;F10&gt; </td><td valign="top">&lt;F10&gt; </td><td valign="top">toggle-log
4042 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4043 toggle <acronym>ESS[SAS]</acronym> for <samp><span class="file">.log</span></samp> files; useful for certain
4044 debugging situations
4045 <br></td></tr><tr align="left"><td valign="top">&lt;F11&gt; </td><td valign="top">&lt;F11&gt; </td><td valign="top">`<samp><span class="samp">filetype-2</span></samp>'
4046 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4047 switch buffer to `<samp><span class="samp">filetype-2</span></samp>' (defaults to <samp><span class="file">.dat</span></samp>) file
4048 and `<samp><span class="samp">refresh</span></samp>'
4049 <br></td></tr><tr align="left"><td valign="top">&lt;F12&gt; </td><td valign="top">&lt;F12&gt; </td><td valign="top">viewgraph
4050 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4051 open a <code>GSASFILE</code> near point for viewing either in emacs
4052 or with an external viewer
4053 <br></td></tr><tr align="left"><td valign="top"><kbd>C-&lt;F1&gt;</kbd> </td><td valign="top"><kbd>C-&lt;F1&gt;</kbd> </td><td valign="top">rtf-portrait
4054 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4055 create an <span class="sc">MS RTF</span> portrait file from the current buffer
4056 with a file extension of <samp><span class="file">.rtf</span></samp>
4057 <br></td></tr><tr align="left"><td valign="top"><kbd>C-&lt;F2&gt;</kbd> </td><td valign="top"><kbd>C-&lt;F2&gt;</kbd> </td><td valign="top">rtf-landscape
4058 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4059 create an <span class="sc">MS RTF</span> landscape file from the current buffer
4060 with a file extension of <samp><span class="file">.rtf</span></samp>
4061 <br></td></tr><tr align="left"><td valign="top"><kbd>C-&lt;F3&gt;</kbd> </td><td valign="top"><kbd>C-&lt;F8&gt;</kbd> </td><td valign="top">submit-region
4062 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4063 write region to <samp><span class="file">ess-temp.sas</span></samp> and submit
4064 <br></td></tr><tr align="left"><td valign="top"><kbd>C-&lt;F5&gt;</kbd> </td><td valign="top"><kbd>C-&lt;F6&gt;</kbd> </td><td valign="top">append-to-log
4065 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4066 append <samp><span class="file">ess-temp.log</span></samp> to the current <samp><span class="file">.log</span></samp> file
4067 <br></td></tr><tr align="left"><td valign="top"><kbd>C-&lt;F6&gt;</kbd> </td><td valign="top"><kbd>C-&lt;F7&gt;</kbd> </td><td valign="top">append-to-output
4068 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4069 append <samp><span class="file">ess-temp.lst</span></samp> to the current <samp><span class="file">.lst</span></samp> file
4070 <br></td></tr><tr align="left"><td valign="top"><kbd>C-&lt;F9&gt;</kbd> </td><td valign="top"><kbd>C-&lt;F9&gt;</kbd> </td><td valign="top"><code>INSIGHT</code>
4071 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4072 open an interactive <code>PROC INSIGHT</code> session on the <acronym>SAS</acronym><!-- /@w -->
4073 dataset near point
4074 <br></td></tr><tr align="left"><td valign="top"><kbd>C-&lt;F10&gt;</kbd> </td><td valign="top"><kbd>C-&lt;F10&gt;</kbd> </td><td valign="top">toggle-listing
4075 <br></td></tr><tr align="left"><td valign="top"></td><td valign="top"></td><td valign="top">
4076 toggle <acronym>ESS[SAS]</acronym> for <samp><span class="file">.lst</span></samp> files; useful for toggling
4077 read-only
4078 <br></td></tr></table>
4080 <p><code>SUBMIT</code>, <code>PROGRAM</code>, <code>LOG</code> and <code>OUTPUT</code> need no further
4081 explanation since they mimic the <acronym>SAS</acronym><!-- /@w --> Display Manager commands and
4082 related function key definitions. However, six other keys have been
4083 provided for convenience and are described below.
4085 <p>`<samp><span class="samp">shell</span></samp>' switches you to the <samp><span class="file">*shell*</span></samp> buffer where you can
4086 interact with your operating system. This is especially helpful if you
4087 would like to kill a <acronym>SAS</acronym><!-- /@w --> batch job. You can specify a different buffer
4088 name to associate with a <acronym>SAS</acronym><!-- /@w --> batch job (besides <samp><span class="file">*shell*</span></samp>) with the
4089 buffer-local variable <code>ess-sas-shell-buffer</code>. This allows you to have
4090 multiple buffers running <acronym>SAS</acronym><!-- /@w --> batch jobs on multiple local/remote
4091 computers that may rely on different methods specified by the buffer-local
4092 variable <code>ess-sas-submit-method</code>.
4094 <p>&lt;F2&gt; performs the `<samp><span class="samp">refresh</span></samp>' operation on the current buffer.
4095 `<samp><span class="samp">refresh</span></samp>' compares the buffer's last modified date/time with the
4096 file's last modified date/time and replaces the buffer with the file if the
4097 file is newer. This is the same operation that is automatically performed
4098 when <code>LOG</code>, <code>OUTPUT</code>, `<samp><span class="samp">filetype-1</span></samp>' or &lt;F11&gt; are pressed.
4100 <p>`<samp><span class="samp">filetype-1</span></samp>' switches you to a file with the same file name as your <samp><span class="file">.sas</span></samp>
4101 file, but with a different extension (<samp><span class="file">.txt</span></samp> by default) and performs
4102 `<samp><span class="samp">refresh</span></samp>'. You can over-ride the default extension; for example in your
4103 <samp><span class="file">~/.emacs</span></samp> or <samp><span class="file">~/.xemacs/init.el</span></samp> file:
4104 <pre class="example"> (setq ess-sas-suffix-1 "csv") ; for example
4105 </pre>
4106 <p>&lt;F9&gt; will prompt you for the name of a permanent <acronym>SAS</acronym><!-- /@w --> dataset near
4107 point to be opened for viewing by <code>PROC FSEDIT</code>. You can control the
4108 <acronym>SAS</acronym><!-- /@w --> batch command-line with <code>ess-sas-data-view-submit-options</code>.
4109 For controlling the <acronym>SAS</acronym><!-- /@w --> batch commands, you have the global variables
4110 <code>ess-sas-data-view-libname</code> and
4111 <code>ess-sas-data-view-fsview-command</code> as well as the buffer-local
4112 variable <code>ess-sas-data-view-fsview-statement</code>. If you have your
4113 <acronym>SAS</acronym><!-- /@w --> <code>LIBNAME</code> defined in <samp><span class="file">~/autoexec.sas</span></samp>, then the defaults
4114 for these variables should be sufficient.
4116 <p>Similarly, <kbd>C-&lt;F9&gt;</kbd><!-- /@w --> will prompt you for the name of a permanent
4117 <acronym>SAS</acronym><!-- /@w --> dataset near point to be opened for viewing by <code>PROC INSIGHT</code>.
4118 You can control the <acronym>SAS</acronym><!-- /@w --> batch command-line with
4119 <code>ess-sas-data-view-submit-options</code>. For controlling the <acronym>SAS</acronym><!-- /@w --> batch
4120 commands, you have the global variables <code>ess-sas-data-view-libname</code>
4121 and <code>ess-sas-data-view-insight-command</code> as well as the buffer-local
4122 variable <code>ess-sas-data-view-insight-statement</code>.
4124 <p>&lt;F10&gt; toggles <acronym>ESS[SAS]</acronym> mode for <samp><span class="file">.log</span></samp> files which is off by default
4125 (technically, it is <code>SAS-log-mode</code>, but it looks the same). The syntax
4126 highlighting can be helpful in certain debugging situations, but large
4127 <samp><span class="file">.log</span></samp> files may take a long time to highlight.
4129 <p>&lt;F11&gt; is the same as `<samp><span class="samp">filetype-1</span></samp>' except it is <samp><span class="file">.dat</span></samp> by default.
4131 <p>&lt;F12&gt; will prompt you for the name of a <code>GSASFILE</code> near the point in <samp><span class="file">.log</span></samp> to
4132 be opened for viewing either with emacs or with an external viewer.
4133 Depending on your version of emacs and the operating system you are
4134 using, emacs may support <samp><span class="file">.gif</span></samp> and <samp><span class="file">.jpg</span></samp> files internally. You may need
4135 to change the following variables for your own situation.
4136 <code>ess-sas-graph-view-suffix-regexp</code> is a regular expression of supported
4137 file types defined via file name extensions.
4138 <code>ess-sas-graph-view-viewer-default</code> is the default external viewer for
4139 your platform. <code>ess-sas-graph-view-viewer-alist</code> is an alist of
4140 exceptions to the default; i.e. file types and their associated
4141 viewers which will be used rather than the default viewer.
4142 <pre class="example"> (setq ess-sas-graph-view-suffix-regexp (concat "[.]\\([eE]?[pP][sS]\\|"
4143 "[pP][dD][fF]\\|[gG][iI][fF]\\|[jJ][pP][eE]?[gG]\\|"
4144 "[tT][iI][fF][fF]?\\)")) ;; default
4145 (setq ess-sas-graph-view-viewer-default "kodakimg") ;; Windows default
4146 (setq ess-sas-graph-view-viewer-default "sdtimage") ;; Solaris default
4147 (setq ess-sas-graph-view-viewer-alist
4148 '(("[eE]?[pP][sS]" . "gv") ("[pP][dD][fF]" . "gv")) ;; default w/ gv
4149 </pre>
4150 <p><kbd>C-&lt;F2&gt;</kbd><!-- /@w --> produces US landscape by default, however, it can produce A4
4151 landscape (first line for "global" key mapping, second for "local"):
4152 <pre class="example"> (global-set-key [(control f2)] 'ess-sas-rtf-a4-landscape)
4153 (define-key sas-mode-local-map [(control f2)] 'ess-sas-rtf-a4-landscape)
4154 </pre>
4155 <!-- node-name, next, previous, up -->
4156 <div class="node">
4157 <p><hr>
4158 <a name="iESS(SAS)--Interactive-SAS-processes"></a>
4159 <a name="iESS_0028SAS_0029_002d_002dInteractive-SAS-processes"></a>
4160 Next:&nbsp;<a rel="next" accesskey="n" href="#iESS_0028SAS_0029_002d_002dCommon-problems">iESS(SAS)--Common problems</a>,
4161 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS_0028SAS_0029_002d_002dFunction-keys-for-batch-processing">ESS(SAS)--Function keys for batch processing</a>,
4162 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-SAS">ESS for SAS</a>
4164 </div>
4166 <h3 class="section">10.6 iESS(SAS)&ndash;Interactive SAS processes</h3>
4168 <p>Inferior <acronym>ESS</acronym> (i<acronym>ESS</acronym><!-- /@w -->) is the method for interfacing with interactive
4169 statistical processes (programs). i<acronym>ESS[SAS]</acronym><!-- /@w --> is what is needed for
4170 interactive <acronym>SAS</acronym><!-- /@w --> programming. i<acronym>ESS[SAS]</acronym><!-- /@w --> works best
4171 with the <acronym>SAS</acronym><!-- /@w --> command-line option settings
4172 <code>"-stdio -linesize 80 -noovp -nosyntaxcheck"</code>
4173 (the default of <code>inferior-SAS-args</code>).
4175 <pre class="display"> <code>-stdio</code>
4176 required to make the redirection of stdio work
4177 <code>-linesize 80</code>
4178 keeps output lines from folding on standard terminals
4179 <code>-noovp</code>
4180 prevents error messages from printing 3 times
4181 <code>-nosyntaxcheck</code>
4182 permits recovery after syntax errors
4183 </pre>
4184 <p>To start up i<acronym>ESS[SAS]</acronym><!-- /@w --> mode, use:
4185 <pre class="example"> <kbd>M-x&nbsp;SAS</kbd><!-- /@w -->
4186 </pre>
4187 <p>The <samp><span class="file">*SAS:1.log*</span></samp> buffer in <code>ESStr</code> mode corresponds to the file
4188 <samp><var>foo</var><span class="file">.log</span></samp> in <acronym>SAS</acronym><!-- /@w --> batch usage and to the `<samp><span class="samp">SAS: LOG</span></samp>' window in the
4189 <acronym>SAS</acronym><!-- /@w --> Display Manager. All commands submitted to <acronym>SAS</acronym><!-- /@w -->, informative
4190 messages, warnings, and errors appear here.
4192 <p>The <samp><span class="file">*SAS:1.lst*</span></samp> buffer in <code>ESSlst</code> mode corresponds to the file
4193 <samp><var>foo</var><span class="file">.lst</span></samp> in <acronym>SAS</acronym><!-- /@w --> batch usage and to the `<samp><span class="samp">SAS: OUTPUT</span></samp>' window in the
4194 <acronym>SAS</acronym><!-- /@w --> Display Manager. All printed output appears in this window.
4196 <p>The <samp><span class="file">*SAS:1*</span></samp> buffer exists solely as a communications buffer.
4197 The user should never use this buffer directly.
4198 Files are edited in the <samp><var>foo</var><span class="file">.sas</span></samp> buffer. The <kbd>C-c&nbsp;C-r</kbd><!-- /@w --> key in
4199 <acronym>ESS[SAS]</acronym> is the functional equivalent of bringing a file into the
4200 `<samp><span class="samp">SAS: PROGRAM EDITOR</span></samp>' window followed by <code>SUBMIT</code>.
4202 <p>For example, open the file you want to work with.
4203 <pre class="example"> <kbd>C-x&nbsp;C-f&nbsp;foo.sas</kbd><!-- /@w -->
4204 </pre>
4205 <p><samp><var>foo</var><span class="file">.sas</span></samp> will be in <acronym>ESS[SAS]</acronym> mode. Edit as appropriate, and then start
4206 up <acronym>SAS</acronym><!-- /@w --> with the cursor in the <samp><var>foo</var><span class="file">.sas</span></samp> buffer.
4207 <pre class="example"> <kbd>M-x&nbsp;SAS</kbd><!-- /@w -->
4208 </pre>
4209 <p>Four buffers will appear on screen:
4210 <p><table summary=""><tr align="left"><td valign="top">Buffer </td><td valign="top">Mode </td><td valign="top">Description
4211 <br></td></tr><tr align="left"><td valign="top"><samp><var>foo</var><span class="file">.sas</span></samp> </td><td valign="top"><code><acronym>ESS[SAS]</acronym></code> </td><td valign="top">your source file
4212 <br></td></tr><tr align="left"><td valign="top"><samp><span class="file">*SAS:1*</span></samp> </td><td valign="top"><code>i<acronym>ESS[SAS:1]</acronym><!-- /@w --></code> </td><td valign="top">i<acronym>ESS</acronym><!-- /@w --> communication buffer
4213 <br></td></tr><tr align="left"><td valign="top"><samp><span class="file">*SAS:1.log*</span></samp> </td><td valign="top"><code>Shell ESStr []</code> </td><td valign="top"><acronym>SAS</acronym><!-- /@w --> log information
4214 <br></td></tr><tr align="left"><td valign="top"><samp><span class="file">*SAS:1.lst*</span></samp> </td><td valign="top"><code>Shell ESSlst []</code> </td><td valign="top"><acronym>SAS</acronym><!-- /@w --> listing information
4215 <br></td></tr></table>
4216 If you would prefer each of the four buffers to appear in its
4217 own individual frame, you can arrange for that. Place the
4218 cursor in the buffer displaying <samp><var>foo</var><span class="file">.sas</span></samp>. Enter the
4219 sequence <kbd>C-c&nbsp;C-w</kbd><!-- /@w -->. The cursor will normally be in buffer
4220 <samp><var>foo</var><span class="file">.sas</span></samp>. If not, put it there and <kbd>C-x&nbsp;b&nbsp;</kbd><var>foo</var><kbd>.sas</kbd><!-- /@w -->.
4222 <p>Send regions, lines, or the entire file contents to <acronym>SAS</acronym><!-- /@w -->
4223 (regions are most useful: a highlighted region will normally
4224 begin with the keywords <code>DATA</code> or <code>PROC</code> and end with
4225 <code>RUN;</code>), <kbd>C-c&nbsp;C-r</kbd><!-- /@w -->.
4227 <p>Information appears in the log buffer, analysis results in the
4228 listing buffer. In case of errors, make the corrections in the
4229 <samp><var>foo</var><span class="file">.sas</span></samp> buffer and resubmit with another <kbd>C-c&nbsp;C-r</kbd><!-- /@w -->.
4231 <p>At the end of the session you may save the log and listing
4232 buffers with the usual <kbd>C-x&nbsp;C-s</kbd><!-- /@w --> commands. You will be prompted
4233 for a file name. Typically, the names <samp><var>foo</var><span class="file">.log</span></samp> and <samp><var>foo</var><span class="file">.lst</span></samp>
4234 will be used. You will almost certainly want to edit the saved
4235 files before including them in a report. The files are
4236 read-only by default. You can make them writable by the emacs
4237 command <kbd>C-x&nbsp;C-q</kbd><!-- /@w -->.
4239 <p>At the end of the session, the input file <samp><var>foo</var><span class="file">.sas</span></samp> will
4240 typically have been revised. You can save it. It can be used
4241 later as the beginning of another i<acronym>ESS[SAS]</acronym><!-- /@w --> session. It can
4242 also be used as a batch input file to <acronym>SAS</acronym><!-- /@w -->.
4244 <p>The <samp><span class="file">*SAS:1*</span></samp> buffer is strictly for <acronym>ESS</acronym> use. The user should
4245 never need to read it or write to it. Refer to the <samp><span class="file">.lst</span></samp> and
4246 <samp><span class="file">.log</span></samp> buffers for monitoring output!
4248 <p>Troubleshooting: See <a href="#iESS_0028SAS_0029_002d_002dCommon-problems">iESS(SAS)&ndash;Common problems</a>.
4250 <!-- node-name, next, previous, up -->
4251 <div class="node">
4252 <p><hr>
4253 <a name="iESS(SAS)--Common-problems"></a>
4254 <a name="iESS_0028SAS_0029_002d_002dCommon-problems"></a>
4255 Next:&nbsp;<a rel="next" accesskey="n" href="#ESS_0028SAS_0029_002d_002dGraphics">ESS(SAS)--Graphics</a>,
4256 Previous:&nbsp;<a rel="previous" accesskey="p" href="#iESS_0028SAS_0029_002d_002dInteractive-SAS-processes">iESS(SAS)--Interactive SAS processes</a>,
4257 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-SAS">ESS for SAS</a>
4259 </div>
4261 <h3 class="section">10.7 iESS(SAS)&ndash;Common problems</h3>
4263 <ol type=1 start=1>
4264 <li>i<acronym>ESS[SAS]</acronym><!-- /@w --> does not work on Windows. In order to run <acronym>SAS</acronym><!-- /@w --> inside
4265 an emacs buffer, it is necessary to start <acronym>SAS</acronym><!-- /@w --> with the <code>-stdio</code> option.
4266 <acronym>SAS</acronym><!-- /@w --> does not support the <code>-stdio</code> option on Windows.
4267 <li>If <kbd>M-x&nbsp;SAS</kbd><!-- /@w --> gives errors upon startup, check the following:
4268 <ul>
4269 <li>you are running Windows: see 1.
4270 <li><samp><span class="file">ess-sas-sh-command</span></samp> (from the <acronym>ESS</acronym> <samp><span class="file">etc</span></samp> directory) needs to be
4271 executable; too check, type <kbd>M-x&nbsp;dired</kbd><!-- /@w -->; if not, fix it as follows,
4272 type <kbd>M-:</kbd>, then at the minibuffer prompt `<samp><span class="samp">Eval:</span></samp>'<!-- /@w -->,
4273 type <code>(set-file-modes "ess-sas-sh-command" 493)</code>.
4274 <!-- (solution: @code{chmod ugo+rx ess-sas-sh-command}). -->
4275 <li><code>sas</code> isn't in your executable path; to verify, type
4276 <kbd>M-:</kbd> and at the minibuffer prompt `<samp><span class="samp">Eval:</span></samp>', type
4277 <code>(executable-find "sas")</code>
4278 </ul>
4279 <li><kbd>M-x&nbsp;SAS</kbd><!-- /@w --> starts <acronym>SAS</acronym><!-- /@w -->&nbsp;Display<!-- /@w --> Manager. Probably, the command <code>sas</code>
4280 on your system calls a shell script. In that case you will need to locate
4281 the real <code>sas</code> executable and link to it.
4282 You can execute the <acronym>UNIX</acronym> command:
4283 <pre class="example"> find / -name sas -print
4284 </pre>
4285 <p>Now place a soft link to the real <code>sas</code> executable in your <code>~/bin</code>
4286 directory, with for example
4287 <pre class="example"> cd ~/bin
4288 ln -s /usr/local/sas9/sas sas
4289 </pre>
4290 </ol>
4291 Check your <code>PATH</code> environment variable to confirm that
4292 <code>~/bin</code> appears before the directory in which the <code>sas</code>
4293 shell script appears.
4295 <!-- Specify the path to the real -->
4296 <!-- @code{sas} executable in @file{ess-sas-sh-command}, i.e.: -->
4297 <!-- @example -->
4298 <!-- /usr/local/sas9/sas $@@ </dev/tty 1>$stdout 2>$stderr -->
4299 <!-- @end example -->
4300 <!-- To find the @code{sas} executable, you can execute the @UNIX{} command: -->
4301 <!-- @example -->
4302 <!-- find / -name sas -print -->
4303 <!-- @end example -->
4304 <!-- @end enumerate -->
4305 <!-- node-name, next, previous, up -->
4306 <div class="node">
4307 <p><hr>
4308 <a name="ESS(SAS)--Graphics"></a>
4309 <a name="ESS_0028SAS_0029_002d_002dGraphics"></a>
4310 Next:&nbsp;<a rel="next" accesskey="n" href="#ESS_0028SAS_0029_002d_002dWindows">ESS(SAS)--Windows</a>,
4311 Previous:&nbsp;<a rel="previous" accesskey="p" href="#iESS_0028SAS_0029_002d_002dCommon-problems">iESS(SAS)--Common problems</a>,
4312 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-SAS">ESS for SAS</a>
4314 </div>
4316 <h3 class="section">10.8 ESS(SAS)&ndash;Graphics</h3>
4318 <p>Output from a <acronym>SAS/GRAPH</acronym><!-- /@w --> <code>PROC</code> can be displayed in a <acronym>SAS/GRAPH</acronym><!-- /@w -->
4319 window for <acronym>SAS</acronym><!-- /@w --> batch on Windows or for both <acronym>SAS</acronym><!-- /@w --> batch and interactive
4320 with XWindows on <acronym>UNIX</acronym>. If you need to create graphics files and view
4321 them with &lt;F12&gt;, then include the following (either in
4322 <samp><var>foo</var><span class="file">.sas</span></samp> or in <samp><span class="file">~/autoexec.sas</span></samp>):
4323 <pre class="example"> filename gsasfile 'graphics.ps';
4324 goptions device=ps gsfname=gsasfile gsfmode=append;
4325 </pre>
4326 <p><code>PROC PLOT</code> graphs can be viewed in the listing buffer. You may
4327 wish to control the vertical spacing to allow the entire plot
4328 to be visible on screen, for example:
4329 <pre class="example"> proc plot;
4330 plot a*b / vpos=25;
4331 run;
4332 </pre>
4333 <!-- node-name, next, previous, up -->
4334 <div class="node">
4335 <p><hr>
4336 <a name="ESS(SAS)--Windows"></a>
4337 <a name="ESS_0028SAS_0029_002d_002dWindows"></a>
4338 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS_0028SAS_0029_002d_002dGraphics">ESS(SAS)--Graphics</a>,
4339 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-SAS">ESS for SAS</a>
4341 </div>
4343 <h3 class="section">10.9 ESS(SAS)&ndash;Windows</h3>
4345 <ul>
4346 <li>i<acronym>ESS[SAS]</acronym><!-- /@w --> does not work on Windows. See <a href="#iESS_0028SAS_0029_002d_002dCommon-problems">iESS(SAS)&ndash;Common problems</a>.
4348 <li><acronym>ESS[SAS]</acronym> mode for editing <acronym>SAS</acronym><!-- /@w --> language files works very well.
4349 See <a href="#ESS_0028SAS_0029_002d_002dEditing-files">ESS(SAS)&ndash;Editing files</a>.
4351 <li>There are two execution options for <acronym>SAS</acronym><!-- /@w --> on Windows.
4352 You can use batch. See <a href="#ESS_0028SAS_0029_002d_002dBatch-SAS-processes">ESS(SAS)&ndash;Batch SAS processes</a>.
4354 <p>Or you can mark regions with the mouse and submit the code with
4355 `submit-region' or paste them into <acronym>SAS</acronym><!-- /@w --> Display Manager.
4357 </ul>
4359 <!-- Local Variables: -->
4360 <!-- TeX-master: "ess.texi" -->
4361 <!-- End: -->
4362 <!-- node-name, next, previous, up -->
4363 <div class="node">
4364 <p><hr>
4365 <a name="ESS-for-BUGS"></a>
4366 Next:&nbsp;<a rel="next" accesskey="n" href="#Miscellaneous">Miscellaneous</a>,
4367 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS-for-SAS">ESS for SAS</a>,
4368 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
4370 </div>
4372 <h2 class="chapter">11 ESS for BUGS</h2>
4374 <ul class="menu">
4375 <li><a accesskey="1" href="#ESS_0028BUGS_0029_002d_002dModel-files">ESS(BUGS)--Model files</a>
4376 <li><a accesskey="2" href="#ESS_0028BUGS_0029_002d_002dCommand-files">ESS(BUGS)--Command files</a>
4377 <li><a accesskey="3" href="#ESS_0028BUGS_0029_002d_002dLog-files">ESS(BUGS)--Log files</a>
4378 </ul>
4380 <p><acronym>ESS[BUGS]</acronym> was designed for use with BUGS software. It was developed by
4381 Rodney A. Sparapani and has some similarities with <acronym>ESS[SAS]</acronym>.
4382 ESS facilitates BUGS batch with <acronym>ESS[BUGS]</acronym>, the mode for files with the .bug
4383 extension. ESS provides 5 features. First, BUGS syntax is described to allow
4384 for proper fontification of statements, distributions, functions, commands and
4385 comments in BUGS model files, command files and log files. Second,
4386 ESS creates templates for the command file from the model file so that
4387 a BUGS batch process can be defined by a single file. Third, ESS
4388 provides a BUGS batch script that allows ESS to set BUGS batch
4389 parameters. Fourth, key sequences are defined to create a command
4390 file and submit a BUGS batch process. Lastly, interactive submission of BUGS
4391 commands is also supported.
4393 <!-- node-name, next, previous, up -->
4394 <div class="node">
4395 <p><hr>
4396 <a name="ESS(BUGS)--Model-files"></a>
4397 <a name="ESS_0028BUGS_0029_002d_002dModel-files"></a>
4398 Next:&nbsp;<a rel="next" accesskey="n" href="#ESS_0028BUGS_0029_002d_002dCommand-files">ESS(BUGS)--Command files</a>,
4399 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS-for-BUGS">ESS for BUGS</a>,
4400 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-BUGS">ESS for BUGS</a>
4402 </div>
4404 <h3 class="section">11.1 ESS[BUGS]&ndash;Model files</h3>
4406 <p>Model files (with the .bug extension) are edited in <acronym>ESS[BUGS]</acronym> mode. Two keys
4407 are bound for your use in <acronym>ESS[BUGS]</acronym>, F2 and F12. F2 performs the same action
4408 as it does in <acronym>ESS[SAS]</acronym>, See <a href="#ESS_0028SAS_0029_002d_002dFunction-keys-for-batch-processing">ESS(SAS)&ndash;Function keys for batch processing</a>.
4409 F12 performs the function
4410 ess-bugs-next-action which you will use a lot. Pressing F12 in an empty buffer
4411 for a model file will produce a template for you.
4413 <p><acronym>ESS[BUGS]</acronym> supports "replacement" variables. These variables are created as
4414 part of the template, i.e. with the first press of F12 in an empty buffer.
4415 They are named by
4416 all capitals and start with '%': %N, %DATA, %INIT, %MONITOR and %STATS.
4417 When you are finished editing your model file, pressing F12 will perform the
4418 necessary replacements and build your command file for you.
4420 <p>The %DATA variable appears in
4421 the line 'data in "%DATA";'. On the second press of F12, %DATA will be
4422 replaced by the model file name except it will have the .dat extension. If
4423 your data file is named something else, then change %DATA in the template to
4424 the appropriate file name and no replacement will occur.
4426 <p>The %INIT variable appears in
4427 the line 'inits in "%INIT";'. On the second press of F12, %INIT will be
4428 replaced by the model file name except it will have the .in extension. If
4429 your model will be generating it's own initial values, place a comment
4430 character, #, at the beginning of the line. Or, if your
4431 init file is named something else, then change %INIT in the template to the
4432 appropriate file name.
4434 <p>The %N variable appears in the line 'const N = 0;#%N'. Although it is commented,
4435 it is still active. Notice that later on in the template you have the line
4436 'for (i in 1:N)'. The BUGS constant N is the number of rows in
4437 your data file. When you press F12, the data file is read and the number of
4438 lines are counted (after %DATA is resolved, if necessary). The number of
4439 lines replace the zero in the 'const N = 0' statement.
4441 <p>The %MONITOR variable appears on a line by itself. Although it is commented,
4442 it is still active. This line is a list of variables that you want monitored.
4443 When you press F12, the appropriate statements are created in
4444 the command file to monitor the list of variables. If the line is blank, then
4445 the list is populated with the variables from the 'var' statement.
4447 <p>The %STATS variable is similar to the %MONITOR variable. It is a list of
4448 variables for which summary statistics will be calculated. When you press
4449 F12, the appropriate statements will be generated in your command file.
4451 <p>Please note that the %DATA and %INIT variables are only replaced on the second
4452 press of F12, but the actions for %N, %MONITOR and %STATS are performed on
4453 each press of F12 if you re-visit the model file.
4455 <!-- node-name, next, previous, up -->
4456 <div class="node">
4457 <p><hr>
4458 <a name="ESS(BUGS)--Command-files"></a>
4459 <a name="ESS_0028BUGS_0029_002d_002dCommand-files"></a>
4460 Next:&nbsp;<a rel="next" accesskey="n" href="#ESS_0028BUGS_0029_002d_002dLog-files">ESS(BUGS)--Log files</a>,
4461 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS_0028BUGS_0029_002d_002dModel-files">ESS(BUGS)--Model files</a>,
4462 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-BUGS">ESS for BUGS</a>
4464 </div>
4466 <h3 class="section">11.2 ESS[BUGS]&ndash;Command files</h3>
4468 <p>To avoid extension name collision, .bmd is used for BUGS command files. When
4469 you have finished editing your model file and press F12, a command file is
4470 created if one does not already exist. However, the command file was
4471 created, it recognizes two "replacement" variables: %MONITOR and %STATS.
4473 <p>Two %MONITOR variables appears on lines by themselves. Although they are
4474 commented, they are still active. Between them appears the necessary
4475 statements to monitor the list of variables specified in the model file. The
4476 behavior of the %STATS variable is similar.
4478 <p>When you are finished editing your command file, pressing F12 again will submit
4479 your command file as a batch job. Batch scripts are provided for both DOS and
4480 Unix in the etc sub-directory of the ESS distribution. The DOS script is
4481 called "BACKBUGS.BAT" and the Unix script is "backbugs". These scripts allow
4482 you to change the number of bins to use in the Griddy algorithm
4483 (Metropolis sampling). That is handled by the variable ess-bugs-default-bins
4484 which defaults to 32.
4486 <!-- node-name, next, previous, up -->
4487 <div class="node">
4488 <p><hr>
4489 <a name="ESS(BUGS)--Log-files"></a>
4490 <a name="ESS_0028BUGS_0029_002d_002dLog-files"></a>
4491 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS_0028BUGS_0029_002d_002dCommand-files">ESS(BUGS)--Command files</a>,
4492 Up:&nbsp;<a rel="up" accesskey="u" href="#ESS-for-BUGS">ESS for BUGS</a>
4494 </div>
4496 <h3 class="section">11.3 ESS[BUGS]&ndash;Log files</h3>
4498 <p>To avoid extension name collision, .bog is used for BUGS log files. The BUGS
4499 batch script provided with ESS creates the .bog file from the .log file when
4500 the batch process completes. If you need to look at the .log file while
4501 the batch process is running, it will not appear in <acronym>ESS[BUGS]</acronym> mode unless
4502 you modify the auto-mode-alist variable. If you have done so, then you
4503 may find F2 useful to refresh the .log if the batch process over-writes or
4504 appends it.
4506 <!-- node-name, next, previous, up -->
4507 <div class="node">
4508 <p><hr>
4509 <a name="Miscellaneous"></a>
4510 Next:&nbsp;<a rel="next" accesskey="n" href="#Mailing-lists_002fbug-reports">Mailing lists/bug reports</a>,
4511 Previous:&nbsp;<a rel="previous" accesskey="p" href="#ESS-for-BUGS">ESS for BUGS</a>,
4512 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
4514 </div>
4516 <h2 class="chapter">12 Other features of ESS</h2>
4518 <p>ESS has a few miscellaneous features, which didn't fit anywhere else.
4520 <ul class="menu">
4521 <li><a accesskey="1" href="#Highlighting">Highlighting</a>: Syntactic highlighting of buffers
4522 <li><a accesskey="2" href="#Parens">Parens</a>: Parenthesis matching
4523 <li><a accesskey="3" href="#Graphics">Graphics</a>: Using graphics with ESS
4524 <li><a accesskey="4" href="#Imenu">Imenu</a>: Support for Imenu in ESS
4525 <li><a accesskey="5" href="#Toolbar">Toolbar</a>: Support for toolbar in ESS
4526 <li><a accesskey="6" href="#TAGS">TAGS</a>: Using TAGS for S files
4527 <li><a accesskey="7" href="#Rdired">Rdired</a>: Directory editor for R objects
4528 </ul>
4530 <!-- node-name, next, previous, up -->
4531 <div class="node">
4532 <p><hr>
4533 <a name="Highlighting"></a>
4534 Next:&nbsp;<a rel="next" accesskey="n" href="#Parens">Parens</a>,
4535 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Miscellaneous">Miscellaneous</a>,
4536 Up:&nbsp;<a rel="up" accesskey="u" href="#Miscellaneous">Miscellaneous</a>
4538 </div>
4540 <h3 class="section">12.1 Syntactic highlighting of buffers</h3>
4542 <p>ESS provides Font-Lock (see <a href="emacs.html#Faces">Using Multiple Typefaces</a>) patterns for Inferior S Mode, S
4543 Mode, and S Transcript Mode buffers.
4544 <a name="index-Font_002dlock-mode-195"></a><a name="index-highlighting-196"></a>
4545 To activate highlighting, you need to turn on Font Lock mode in the
4546 appropriate buffers. This can be done on a per-buffer basis with
4547 <kbd>M-x font-lock-mode</kbd>, or may be done by adding
4548 <code>turn-on-font-lock</code> to <code>inferior-ess-mode-hook</code>,
4549 <code>ess-mode-hook</code> and <code>ess-transcript-mode-hook</code>. Your systems
4550 administrator may have done this for you in <samp><span class="file">ess-site.el</span></samp>
4551 (see <a href="#Customization">Customization</a>).
4553 <p>The font-lock patterns are defined in three variables, which you may
4554 modify if desired:
4556 <div class="defun">
4557 &mdash; Variable: <b>inferior-ess-font-lock-keywords</b><var><a name="index-inferior_002dess_002dfont_002dlock_002dkeywords-197"></a></var><br>
4558 <blockquote><p>Font-lock patterns for Inferior ESS Mode. The default value
4559 highlights prompts, inputs, assignments, output messages, vector and
4560 matrix labels, and literals such as `<samp><span class="samp">NA</span></samp>' and <code>TRUE</code>.
4561 </p></blockquote></div>
4563 <div class="defun">
4564 &mdash; Variable: <b>ess-mode-font-lock-keywords</b><var><a name="index-ess_002dmode_002dfont_002dlock_002dkeywords-198"></a></var><br>
4565 <blockquote><p>Font-lock patterns for ESS programming mode. The default value
4566 highlights function names, literals, assignments, source functions and
4567 reserved words.
4568 </p></blockquote></div>
4570 <div class="defun">
4571 &mdash; Variable: <b>ess-trans-font-lock-keywords</b><var><a name="index-ess_002dtrans_002dfont_002dlock_002dkeywords-199"></a></var><br>
4572 <blockquote><p>Font-lock patterns for ESS Transcript Mode. The default value
4573 highlights the same patterns as in Inferior ESS Mode.
4574 </p></blockquote></div>
4576 <!-- node-name, next, previous, up -->
4577 <div class="node">
4578 <p><hr>
4579 <a name="Parens"></a>
4580 Next:&nbsp;<a rel="next" accesskey="n" href="#Graphics">Graphics</a>,
4581 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Highlighting">Highlighting</a>,
4582 Up:&nbsp;<a rel="up" accesskey="u" href="#Miscellaneous">Miscellaneous</a>
4584 </div>
4586 <h3 class="section">12.2 Parenthesis matching</h3>
4588 <p>Emacs and XEmacs have facilities for highlighting the parenthesis
4589 matching the parenthesis at point. This feature is very useful when
4590 trying to examine which parentheses match each other. This highlighting
4591 also indicates when parentheses are not matching. Depending on what
4592 version of emacs you use, one of the following should work in your
4593 initialisation file:
4595 <pre class="example"> (paren-set-mode 'paren) ;for XEmacs
4596 (show-paren-mode t) ;for Emacs
4597 </pre>
4598 <!-- node-name, next, previous, up -->
4599 <div class="node">
4600 <p><hr>
4601 <a name="Graphics"></a>
4602 Next:&nbsp;<a rel="next" accesskey="n" href="#Imenu">Imenu</a>,
4603 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Parens">Parens</a>,
4604 Up:&nbsp;<a rel="up" accesskey="u" href="#Miscellaneous">Miscellaneous</a>
4606 </div>
4608 <h3 class="section">12.3 Using graphics with ESS</h3>
4610 <p><a name="index-graphics-200"></a>One of the main features of the <code>S</code> package is its ability to
4611 generate high-resolution graphics plots, and ESS provides a number of
4612 features for dealing with such plots.
4614 <ul class="menu">
4615 <li><a accesskey="1" href="#printer">printer</a>: The printer() graphics driver
4616 <li><a accesskey="2" href="#X11">X11</a>: The X11() (and other X-windows based) driver
4617 <li><a accesskey="3" href="#winjava">winjava</a>: Java Graphics Device
4618 </ul>
4620 <!-- node-name, next, previous, up -->
4621 <div class="node">
4622 <p><hr>
4623 <a name="printer"></a>
4624 Next:&nbsp;<a rel="next" accesskey="n" href="#X11">X11</a>,
4625 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Graphics">Graphics</a>,
4626 Up:&nbsp;<a rel="up" accesskey="u" href="#Graphics">Graphics</a>
4628 </div>
4630 <h4 class="subsection">12.3.1 Using ESS with the <code>printer()</code> driver</h4>
4632 <p>This is the simplest (and least desirable) method of using graphics
4633 within ESS. S's <code>printer()</code> device driver produces crude character
4634 based plots which can be contained within the ESS process buffer
4635 itself. To start using character graphics, issue the S command
4636 <pre class="example"> printer(width=79)
4637 </pre>
4638 <p><a name="index-printer_0028_0029-201"></a>(the <code>width=79</code> argument prevents Emacs line-wrapping at column
4639 80 on an 80-column terminal. Use a different value for a terminal with
4640 a different number of columns.) Plotting commands do not generate
4641 graphics immediately, but are stored until the <code>show()</code> command
4642 is issued, which displays the current figure.
4644 <!-- node-name, next, previous, up -->
4645 <div class="node">
4646 <p><hr>
4647 <a name="X11"></a>
4648 Next:&nbsp;<a rel="next" accesskey="n" href="#winjava">winjava</a>,
4649 Previous:&nbsp;<a rel="previous" accesskey="p" href="#printer">printer</a>,
4650 Up:&nbsp;<a rel="up" accesskey="u" href="#Graphics">Graphics</a>
4652 </div>
4654 <h4 class="subsection">12.3.2 Using ESS with windowing devices</h4>
4656 <p><a name="index-X-windows-202"></a>Of course, the ideal way to use graphics with ESS is to use a windowing
4657 system. Under X11, this requires that the DISPLAY environment
4658 variable be appropriately set, which may not always be the case within
4659 your Emacs process. ESS provides a facility for setting the value of
4660 DISPLAY before the ESS process is started if the variable
4661 <code>ess-ask-about-display</code>
4662 <a name="index-ess_002dask_002dabout_002ddisplay-203"></a>is non-<code>nil</code>.
4664 <!-- node-name, next, previous, up -->
4665 <div class="node">
4666 <p><hr>
4667 <a name="winjava"></a>
4668 Previous:&nbsp;<a rel="previous" accesskey="p" href="#X11">X11</a>,
4669 Up:&nbsp;<a rel="up" accesskey="u" href="#Graphics">Graphics</a>
4671 </div>
4673 <h4 class="subsection">12.3.3 Java Graphics Device</h4>
4675 <p><a name="index-winjava-204"></a>
4676 S+6.1 and newer on Windows contains a java library that supports graphics. Send
4677 the commands:
4679 <pre class="example"> library(winjava)
4680 java.graph()
4681 </pre>
4682 <p class="noindent">to start the graphics driver. This allows you to use ESS for both
4683 interaction and graphics within S-PLUS. (Thanks to Tim Hesterberg for
4684 this information.)
4686 <!-- node-name, next, previous, up -->
4687 <div class="node">
4688 <p><hr>
4689 <a name="Imenu"></a>
4690 Next:&nbsp;<a rel="next" accesskey="n" href="#Toolbar">Toolbar</a>,
4691 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Graphics">Graphics</a>,
4692 Up:&nbsp;<a rel="up" accesskey="u" href="#Miscellaneous">Miscellaneous</a>
4694 </div>
4696 <h3 class="section">12.4 Imenu</h3>
4698 <p>Imenu is an Emacs tool for providing mode-specific buffer indexes. In
4699 some of the ESS editing modes (currently SAS and S), support for Imenu
4700 is provided. For example, in S mode buffers, the menubar should display
4701 an item called "Imenu-S". Within this menubar you will then be offered
4702 bookmarks to particular parts of your source file (such as the starting
4703 point of each function definition).
4705 <p>Imenu works by searching your buffer for lines that match what ESS
4706 thinks is the beginning of a suitable entry, e.g. the beginning of a
4707 function definition. To examine the regular expression that ESS uses,
4708 check the value of <code>imenu-generic-expression</code>. This value is set
4709 by various ESS variables such as <code>ess-imenu-S-generic-expression</code>.
4711 <!-- node-name, next, previous, up -->
4712 <div class="node">
4713 <p><hr>
4714 <a name="Toolbar"></a>
4715 Next:&nbsp;<a rel="next" accesskey="n" href="#TAGS">TAGS</a>,
4716 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Imenu">Imenu</a>,
4717 Up:&nbsp;<a rel="up" accesskey="u" href="#Miscellaneous">Miscellaneous</a>
4719 </div>
4721 <h3 class="section">12.5 Toolbar</h3>
4723 <p>The R and S editing modes have support for a toolbar. This toolbar
4724 provides icons to act as shortcuts for starting new S/R processes, or
4725 for evaluating regions of your source buffers. The toolbar should be
4726 present if your emacs can display images. See <a href="#Customization">Customization</a>, for ways
4727 to change the toolbar.
4729 <!-- node-name, next, previous, up -->
4730 <div class="node">
4731 <p><hr>
4732 <a name="TAGS"></a>
4733 Next:&nbsp;<a rel="next" accesskey="n" href="#Rdired">Rdired</a>,
4734 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Toolbar">Toolbar</a>,
4735 Up:&nbsp;<a rel="up" accesskey="u" href="#Miscellaneous">Miscellaneous</a>
4737 </div>
4739 <h3 class="section">12.6 TAGS</h3>
4741 <p>The Emacs tags facility can be used to navigate around your files
4742 containing definitions of S functions. This facility is independent of
4743 ESS usage, but is written here since ESS users may wish to take
4744 advantage of TAGS facility. Read more about emacs tags in an emacs
4745 manual.
4747 <p>Etags, the program that generates the TAGS file, does not yet know the
4748 syntax to recognise function definitions in S files. Hence, you will
4749 need to provide a regexp that matches your function definitions. Here
4750 is an example call (broken over two lines; type as one line) that should
4751 be appropriate.
4753 <pre class="example"> etags --language=none
4754 --regex='/\([^ \t]+\)[ \t]*&lt;-[ \t]*function/\1/' *.R
4755 </pre>
4756 <p>This will find entries in your source file of the form:
4758 <pre class="example"> some.name &lt;- function
4759 </pre>
4760 <p>with the function name starting in column 0. Windows users may need to
4761 change the single quotes to double quotes.
4763 <!-- node-name, next, previous, up -->
4764 <div class="node">
4765 <p><hr>
4766 <a name="Rdired"></a>
4767 Previous:&nbsp;<a rel="previous" accesskey="p" href="#TAGS">TAGS</a>,
4768 Up:&nbsp;<a rel="up" accesskey="u" href="#Miscellaneous">Miscellaneous</a>
4770 </div>
4772 <h3 class="section">12.7 Rdired</h3>
4774 <p>Ess-rdired provides a dired-like buffer for viewing, editing and
4775 plotting objects in your current R session. If you are used to using
4776 the dired (directory editor) facility in Emacs, this mode gives you
4777 similar functionality for R objects.
4779 <p>To get started, first make sure you can load ess-rdired. Add the
4780 following to your .emacs and then restart emacs.
4781 <pre class="example"> (autoload 'ess-rdired "ess-rdired"
4782 "View *R* objects in a dired-like buffer." t)
4783 </pre>
4784 <p>Start an R session with <kbd>M-x R</kbd> and then store a few
4785 variables, such as:
4787 <pre class="example"> s &lt;- sin(seq(from=0, to=8*pi, length=100))
4788 x &lt;- c(1, 4, 9)
4789 y &lt;- rnorm(20)
4790 z &lt;- TRUE
4791 </pre>
4792 <p>Then use <kbd>M-x ess-rdired</kbd> to create a buffer listing the
4793 objects in your current environment and display it in a new window:
4794 <pre class="example"> mode length
4795 s numeric 100
4796 x numeric 3
4797 y numeric 20
4798 z logical 1
4799 </pre>
4800 <p>Type <kbd>C-h m</kbd> or <kbd>?</kbd> to get a list of the keybindings for this
4801 mode. For example, with your point on the line of a variable, `p' will
4802 plot the object, `v' will view it, and `d' will mark the object for
4803 deletion (`x' will actually perform the deletion).
4805 <!-- node-name, next, previous, up@chapter Using S4 -->
4806 <div class="node">
4807 <p><hr>
4808 <a name="Mailing-lists%2fbug-reports"></a>
4809 <a name="Mailing-lists_002fbug-reports"></a>
4810 Next:&nbsp;<a rel="next" accesskey="n" href="#Customization">Customization</a>,
4811 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Miscellaneous">Miscellaneous</a>,
4812 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
4814 </div>
4816 <h2 class="chapter">13 Bugs and Bug Reporting, Mailing Lists</h2>
4818 <ul class="menu">
4819 <li><a accesskey="1" href="#Bugs">Bugs</a>
4820 <li><a accesskey="2" href="#Reporting-Bugs">Reporting Bugs</a>
4821 <li><a accesskey="3" href="#Mailing-Lists">Mailing Lists</a>
4822 </ul>
4824 <div class="node">
4825 <p><hr>
4826 <a name="Bugs"></a>
4827 Next:&nbsp;<a rel="next" accesskey="n" href="#Reporting-Bugs">Reporting Bugs</a>,
4828 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Mailing-lists_002fbug-reports">Mailing lists/bug reports</a>,
4829 Up:&nbsp;<a rel="up" accesskey="u" href="#Mailing-lists_002fbug-reports">Mailing lists/bug reports</a>
4831 </div>
4833 <h3 class="section">13.1 Bugs</h3>
4835 <p><a name="index-bugs-205"></a>
4837 <ul>
4838 <li>Commands like <code>ess-display-help-on-object</code> and list completion
4839 cannot be used while the user is entering a multi-line command. The
4840 only real fix in this situation is to use another ESS process.
4842 <li>The <code>ess-eval-</code> commands can leave point in the ESS process
4843 buffer in the wrong place when point is at the same position as the last
4844 process output. This proves difficult to fix, in general, as we need to
4845 consider all <em>windows</em> with <code>window-point</code> at the right place.
4847 <li>It's possible to clear the modification flag (say, by saving the buffer)
4848 with the edit buffer not having been loaded into S.
4850 <li>Backup files can sometimes be left behind, even when
4851 <code>ess-keep-dump-files</code> is <code>nil</code>.
4853 <li>Passing an incomplete S expression to <code>ess-execute</code> causes ESS
4854 to hang.
4856 <li>The function-based commands don't always work as expected on functions
4857 whose body is not a parenthesized or compound expression, and don't even
4858 recognize anonymous functions (i.e. functions not assigned to any
4859 variable).
4861 <li>Multi-line commands could be handled better by the command history
4862 mechanism.
4863 </ul>
4865 <!-- node-name, next, previous, up -->
4866 <div class="node">
4867 <p><hr>
4868 <a name="Reporting-Bugs"></a>
4869 Next:&nbsp;<a rel="next" accesskey="n" href="#Mailing-Lists">Mailing Lists</a>,
4870 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Bugs">Bugs</a>,
4871 Up:&nbsp;<a rel="up" accesskey="u" href="#Mailing-lists_002fbug-reports">Mailing lists/bug reports</a>
4873 </div>
4875 <h3 class="section">13.2 Reporting Bugs</h3>
4877 <p><a name="index-Bug-reports-206"></a><a name="index-ess_002dsubmit_002dbug_002dreport-207"></a>
4879 <p>Please send bug reports, suggestions etc. to
4880 <a href="mailto:ESS-bugs@stat.math.ethz.ch">ESS-bugs@stat.math.ethz.ch</a>
4882 <p>The easiest way to do this is within Emacs by typing
4884 <p><kbd>M-x ess-submit-bug-report</kbd>
4886 <p>This also gives the maintainers valuable information about your
4887 installation which may help us to identify or even fix the bug.
4889 <p>If Emacs reports an error, backtraces can help us debug the problem.
4890 Type "M-x set-variable RET debug-on-error RET t RET". Then run the
4891 command that causes the error and you should see a *Backtrace* buffer
4892 containing debug information; send us that buffer.
4894 <p>Note that comments, suggestions, words of praise and large cash
4895 donations are also more than welcome.
4897 <!-- node-name, next, previous, up -->
4898 <div class="node">
4899 <p><hr>
4900 <a name="Mailing-Lists"></a>
4901 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Reporting-Bugs">Reporting Bugs</a>,
4902 Up:&nbsp;<a rel="up" accesskey="u" href="#Mailing-lists_002fbug-reports">Mailing lists/bug reports</a>
4904 </div>
4906 <h3 class="section">13.3 Mailing Lists</h3>
4908 <p>There is a mailing list for discussions and announcements relating to
4909 ESS. Join the list by sending an e-mail with "subscribe ess-help" (or
4910 "help") in the body to <a href="mailto:ess-help-request@stat.math.ethz.ch">ess-help-request@stat.math.ethz.ch</a>;
4911 contributions to the list may be mailed to
4912 <a href="mailto:ess-help@stat.math.ethz.ch">ess-help@stat.math.ethz.ch</a>. Rest assured, this is a fairly
4913 low-volume mailing list.
4915 <p>The purposes of the mailing list include
4917 <ul>
4918 <li> helping users of ESS to get along with it.
4919 <li> discussing aspects of using ESS on Emacs and XEmacs.
4920 <li> suggestions for improvements.
4921 <li> announcements of new releases of ESS.
4922 <li> posting small patches to ESS.
4923 </ul>
4925 <!-- _not_yet_ @node Help OS, Installation, Help for Statistical Packages, Top -->
4926 <!-- _not_yet_ @comment node-name, next, previous, up -->
4927 <!-- _not_yet_ @chapter Help, arranged by Operating System -->
4928 <!-- _not_yet_ -->
4929 <!-- _not_yet_ @menu -->
4930 <!-- _not_yet_ * Unix installation:: -->
4931 <!-- _not_yet_ * Microsoft Windows installation:: -->
4932 <!-- _not_yet_ * System dependent:: Other variables you may need to change -->
4933 <!-- _not_yet_ @end menu -->
4934 <!-- node-name, next, previous, up -->
4935 <div class="node">
4936 <p><hr>
4937 <a name="Customization"></a>
4938 Next:&nbsp;<a rel="next" accesskey="n" href="#Key-Index">Key Index</a>,
4939 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Mailing-lists_002fbug-reports">Mailing lists/bug reports</a>,
4940 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
4942 </div>
4944 <h2 class="appendix">Appendix A Customizing ESS</h2>
4946 <p><a name="index-customization-208"></a>
4947 ESS can be easily customized to your taste simply by including the
4948 appropriate lines in your <samp><span class="file">.emacs</span></samp> file. There are numerous
4949 variables which affect the behavior of ESS in certain situations which
4950 can be modified to your liking. Keybindings may be set or changed to
4951 your preferences, and for per-buffer customizations hooks are also
4952 available.
4954 <p>Most of these variables can be viewed and set using the Custom facility
4955 within Emacs. Type <kbd>M-x customize-group RET ess RET</kbd> to see all the
4956 ESS variables that can be customized. Variables are grouped by subject
4957 to make it easy to find related variables.
4959 <!-- Stephen deleted incomplete variable list Wed 25 Aug 2004. -->
4960 <div class="node">
4961 <p><hr>
4962 <a name="Key-Index"></a>
4963 Next:&nbsp;<a rel="next" accesskey="n" href="#Concept-Index">Concept Index</a>,
4964 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Customization">Customization</a>,
4965 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
4967 </div>
4969 <h2 class="unnumbered">Key (Character) Index</h2>
4971 <ul class="index-ky" compact>
4972 </ul><!-- @node Command Index, Concept Index, Key Index, Top -->
4973 <!-- @unnumbered Command and Function Index -->
4974 <!-- @printindex fn -->
4975 <!-- node-name, next, previous, up -->
4976 <div class="node">
4977 <p><hr>
4978 <a name="Concept-Index"></a>
4979 Next:&nbsp;<a rel="next" accesskey="n" href="#Variable-and-command-index">Variable and command index</a>,
4980 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Key-Index">Key Index</a>,
4981 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
4983 </div>
4985 <h2 class="unnumbered">Concept Index</h2>
4989 <ul class="index-cp" compact>
4990 <li><a href="#index-g_t_0040file_007b_002eemacs_007d-file-176"><samp><span class="file">.emacs</span></samp> file</a>: <a href="#Source-Directories">Source Directories</a></li>
4991 <li><a href="#index-g_t_0040file_007b_002eemacs_007d-file-159"><samp><span class="file">.emacs</span></samp> file</a>: <a href="#Indenting">Indenting</a></li>
4992 <li><a href="#index-aborting-S-commands-111">aborting S commands</a>: <a href="#Other">Other</a></li>
4993 <li><a href="#index-aborting-the-ESS-process-116">aborting the ESS process</a>: <a href="#Other">Other</a></li>
4994 <li><a href="#index-arguments-to-S-program-31">arguments to S program</a>: <a href="#Customizing-startup">Customizing startup</a></li>
4995 <li><a href="#index-authors-7">authors</a>: <a href="#Credits">Credits</a></li>
4996 <li><a href="#index-autosaving-171">autosaving</a>: <a href="#Source-Files">Source Files</a></li>
4997 <li><a href="#index-Bug-reports-206">Bug reports</a>: <a href="#Reporting-Bugs">Reporting Bugs</a></li>
4998 <li><a href="#index-bugs-205">bugs</a>: <a href="#Bugs">Bugs</a></li>
4999 <li><a href="#index-cleaning-up-104">cleaning up</a>: <a href="#Hot-keys">Hot keys</a></li>
5000 <li><a href="#index-comint-6">comint</a>: <a href="#Credits">Credits</a></li>
5001 <li><a href="#index-command-history-72">command history</a>: <a href="#Command-History">Command History</a></li>
5002 <li><a href="#index-command_002dline-completion-41">command-line completion</a>: <a href="#Completion">Completion</a></li>
5003 <li><a href="#index-command_002dline-editing-35">command-line editing</a>: <a href="#Command_002dline-editing">Command-line editing</a></li>
5004 <li><a href="#index-commands-33">commands</a>: <a href="#Entering-commands">Entering commands</a></li>
5005 <li><a href="#index-comments-168">comments</a>: <a href="#Source-Files">Source Files</a></li>
5006 <li><a href="#index-comments-in-S-154">comments in S</a>: <a href="#Indenting">Indenting</a></li>
5007 <li><a href="#index-completion-in-edit-buffer-162">completion in edit buffer</a>: <a href="#Other-edit-buffer-commands">Other edit buffer commands</a></li>
5008 <li><a href="#index-completion-of-object-names-40">completion of object names</a>: <a href="#Completion">Completion</a></li>
5009 <li><a href="#index-completion-on-file-names-49">completion on file names</a>: <a href="#Completion">Completion</a></li>
5010 <li><a href="#index-completion-on-lists-48">completion on lists</a>: <a href="#Completion">Completion</a></li>
5011 <li><a href="#index-completion_002c-when-prompted-for-object-names-125">completion, when prompted for object names</a>: <a href="#Edit-buffer">Edit buffer</a></li>
5012 <li><a href="#index-creating-new-objects-126">creating new objects</a>: <a href="#Edit-buffer">Edit buffer</a></li>
5013 <li><a href="#index-credits-8">credits</a>: <a href="#Credits">Credits</a></li>
5014 <li><a href="#index-customization-208">customization</a>: <a href="#Customization">Customization</a></li>
5015 <li><a href="#index-data-frames-45">data frames</a>: <a href="#Completion">Completion</a></li>
5016 <li><a href="#index-debugging-S-functions-152">debugging S functions</a>: <a href="#Evaluating-code">Evaluating code</a></li>
5017 <li><a href="#index-deleting-output-59">deleting output</a>: <a href="#Last-command">Last command</a></li>
5018 <li><a href="#index-directories-16">directories</a>: <a href="#Starting-up">Starting up</a></li>
5019 <li><a href="#index-dump-file-directories-174">dump file directories</a>: <a href="#Source-Directories">Source Directories</a></li>
5020 <li><a href="#index-dump-file-names-172">dump file names</a>: <a href="#Source-Directories">Source Directories</a></li>
5021 <li><a href="#index-dump-files-165">dump files</a>: <a href="#Source-Files">Source Files</a></li>
5022 <li><a href="#index-dump-files-129">dump files</a>: <a href="#Edit-buffer">Edit buffer</a></li>
5023 <li><a href="#index-echoing-commands-when-evaluating-139">echoing commands when evaluating</a>: <a href="#Evaluating-code">Evaluating code</a></li>
5024 <li><a href="#index-edit-buffer-123">edit buffer</a>: <a href="#Edit-buffer">Edit buffer</a></li>
5025 <li><a href="#index-editing-commands-73">editing commands</a>: <a href="#Command-History">Command History</a></li>
5026 <li><a href="#index-editing-functions-122">editing functions</a>: <a href="#Editing">Editing</a></li>
5027 <li><a href="#index-editing-transcripts-70">editing transcripts</a>: <a href="#Saving-transcripts">Saving transcripts</a></li>
5028 <li><a href="#index-emacsclient-109">emacsclient</a>: <a href="#Emacsclient">Emacsclient</a></li>
5029 <li><a href="#index-entering-commands-32">entering commands</a>: <a href="#Entering-commands">Entering commands</a></li>
5030 <li><a href="#index-errors-134">errors</a>: <a href="#Error-Checking">Error Checking</a></li>
5031 <li><a href="#index-ESS-process-buffer-17">ESS process buffer</a>: <a href="#Starting-up">Starting up</a></li>
5032 <li><a href="#index-ESS-process-directory-13">ESS process directory</a>: <a href="#Starting-up">Starting up</a></li>
5033 <li><a href="#index-evaluating-code-with-echoed-commands-140">evaluating code with echoed commands</a>: <a href="#Evaluating-code">Evaluating code</a></li>
5034 <li><a href="#index-evaluating-S-expressions-141">evaluating S expressions</a>: <a href="#Evaluating-code">Evaluating code</a></li>
5035 <li><a href="#index-Font_002dlock-mode-195">Font-lock mode</a>: <a href="#Highlighting">Highlighting</a></li>
5036 <li><a href="#index-formatting-source-code-158">formatting source code</a>: <a href="#Indenting">Indenting</a></li>
5037 <li><a href="#index-graphics-200">graphics</a>: <a href="#Graphics">Graphics</a></li>
5038 <li><a href="#index-help-files-181">help files</a>: <a href="#Help">Help</a></li>
5039 <li><a href="#index-highlighting-196">highlighting</a>: <a href="#Highlighting">Highlighting</a></li>
5040 <li><a href="#index-historic-backups-170">historic backups</a>: <a href="#Source-Files">Source Files</a></li>
5041 <li><a href="#index-hot-keys-93">hot keys</a>: <a href="#Hot-keys">Hot keys</a></li>
5042 <li><a href="#index-indenting-157">indenting</a>: <a href="#Indenting">Indenting</a></li>
5043 <li><a href="#index-installation-9">installation</a>: <a href="#Installation">Installation</a></li>
5044 <li><a href="#index-interactive-use-of-S-2">interactive use of S</a>: <a href="#Introduction">Introduction</a></li>
5045 <li><a href="#index-interrupting-S-commands-112">interrupting S commands</a>: <a href="#Other">Other</a></li>
5046 <li><a href="#index-introduction-1">introduction</a>: <a href="#Introduction">Introduction</a></li>
5047 <li><a href="#index-keyboard-short-cuts-94">keyboard short cuts</a>: <a href="#Hot-keys">Hot keys</a></li>
5048 <li><a href="#index-killing-temporary-buffers-106">killing temporary buffers</a>: <a href="#Hot-keys">Hot keys</a></li>
5049 <li><a href="#index-killing-the-ESS-process-100">killing the ESS process</a>: <a href="#Hot-keys">Hot keys</a></li>
5050 <li><a href="#index-lists_002c-completion-on-47">lists, completion on</a>: <a href="#Completion">Completion</a></li>
5051 <li><a href="#index-motion-in-transcript-mode-119">motion in transcript mode</a>: <a href="#Transcript-Mode">Transcript Mode</a></li>
5052 <li><a href="#index-multi_002dline-commands_002c-resubmitting-67">multi-line commands, resubmitting</a>: <a href="#Transcript-resubmit">Transcript resubmit</a></li>
5053 <li><a href="#index-Multiple-ESS-processes-19">Multiple ESS processes</a>: <a href="#Multiple-ESS-processes">Multiple ESS processes</a></li>
5054 <li><a href="#index-new-objects_002c-creating-127">new objects, creating</a>: <a href="#Edit-buffer">Edit buffer</a></li>
5055 <li><a href="#index-objects-86">objects</a>: <a href="#Hot-keys">Hot keys</a></li>
5056 <li><a href="#index-pages-in-the-process-buffer-54">pages in the process buffer</a>: <a href="#Transcript">Transcript</a></li>
5057 <li><a href="#index-paging-commands-in-help-buffers-185">paging commands in help buffers</a>: <a href="#Help">Help</a></li>
5058 <li><a href="#index-paragraphs-in-the-process-buffer-53">paragraphs in the process buffer</a>: <a href="#Transcript">Transcript</a></li>
5059 <li><a href="#index-parsing-errors-135">parsing errors</a>: <a href="#Error-Checking">Error Checking</a></li>
5060 <li><a href="#index-process-buffer-18">process buffer</a>: <a href="#Starting-up">Starting up</a></li>
5061 <li><a href="#index-process-names-20">process names</a>: <a href="#Multiple-ESS-processes">Multiple ESS processes</a></li>
5062 <li><a href="#index-programming-in-S-5">programming in S</a>: <a href="#Introduction">Introduction</a></li>
5063 <li><a href="#index-project-work-in-S-169">project work in S</a>: <a href="#Source-Files">Source Files</a></li>
5064 <li><a href="#index-quitting-from-ESS-99">quitting from ESS</a>: <a href="#Hot-keys">Hot keys</a></li>
5065 <li><a href="#index-re_002dexecuting-commands-74">re-executing commands</a>: <a href="#Command-History">Command History</a></li>
5066 <li><a href="#index-reading-long-command-outputs-56">reading long command outputs</a>: <a href="#Last-command">Last command</a></li>
5067 <li><a href="#index-Remote-Computers-22">Remote Computers</a>: <a href="#ESS-processes-on-Remote-Computers">ESS processes on Remote Computers</a></li>
5068 <li><a href="#index-reverting-function-definitions-130">reverting function definitions</a>: <a href="#Edit-buffer">Edit buffer</a></li>
5069 <li><a href="#index-running-S-11">running S</a>: <a href="#Starting-up">Starting up</a></li>
5070 <li><a href="#index-search-list-178">search list</a>: <a href="#Source-Directories">Source Directories</a></li>
5071 <li><a href="#index-search-list-90">search list</a>: <a href="#Hot-keys">Hot keys</a></li>
5072 <li><a href="#index-sending-input-34">sending input</a>: <a href="#Entering-commands">Entering commands</a></li>
5073 <li><a href="#index-starting-directory-14">starting directory</a>: <a href="#Starting-up">Starting up</a></li>
5074 <li><a href="#index-starting-ESS-10">starting ESS</a>: <a href="#Starting-up">Starting up</a></li>
5075 <li><a href="#index-stepping-through-code-151">stepping through code</a>: <a href="#Evaluating-code">Evaluating code</a></li>
5076 <li><a href="#index-STERM-107">STERM</a>: <a href="#Statistical-Process-running-in-ESS_003f">Statistical Process running in ESS?</a></li>
5077 <li><a href="#index-tcsh-43">tcsh</a>: <a href="#Completion">Completion</a></li>
5078 <li><a href="#index-temporary-buffers-194">temporary buffers</a>: <a href="#Help">Help</a></li>
5079 <li><a href="#index-temporary-buffers_002c-killing-105">temporary buffers, killing</a>: <a href="#Hot-keys">Hot keys</a></li>
5080 <li><a href="#index-transcript-52">transcript</a>: <a href="#Transcript">Transcript</a></li>
5081 <li><a href="#index-transcript-file-29">transcript file</a>: <a href="#Customizing-startup">Customizing startup</a></li>
5082 <li><a href="#index-transcript-file-names-69">transcript file names</a>: <a href="#Saving-transcripts">Saving transcripts</a></li>
5083 <li><a href="#index-transcript-mode-motion-118">transcript mode motion</a>: <a href="#Transcript-Mode">Transcript Mode</a></li>
5084 <li><a href="#index-transcripts-of-S-sessions-4">transcripts of S sessions</a>: <a href="#Introduction">Introduction</a></li>
5085 <li><a href="#index-using-S-interactively-3">using S interactively</a>: <a href="#Introduction">Introduction</a></li>
5086 <li><a href="#index-winjava-204">winjava</a>: <a href="#winjava">winjava</a></li>
5087 <li><a href="#index-working-directory-179">working directory</a>: <a href="#Source-Directories">Source Directories</a></li>
5088 <li><a href="#index-working-directory-15">working directory</a>: <a href="#Starting-up">Starting up</a></li>
5089 <li><a href="#index-X-windows-202">X windows</a>: <a href="#X11">X11</a></li>
5090 </ul><div class="node">
5091 <p><hr>
5092 <a name="Variable-and-command-index"></a>
5093 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Concept-Index">Concept Index</a>,
5094 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
5096 </div>
5098 <h2 class="unnumbered">Variable and command index</h2>
5102 <ul class="index-vr" compact>
5103 <li><a href="#index-attach_0028_0029-96"><code>attach()</code></a>: <a href="#Hot-keys">Hot keys</a></li>
5104 <li><a href="#index-backward_002dkill_002dword-37"><code>backward-kill-word</code></a>: <a href="#Command_002dline-editing">Command-line editing</a></li>
5105 <li><a href="#index-comint_002dbackward_002dmatching_002dinput-62"><code>comint-backward-matching-input</code></a>: <a href="#Process-buffer-motion">Process buffer motion</a></li>
5106 <li><a href="#index-comint_002dbol-39"><code>comint-bol</code></a>: <a href="#Command_002dline-editing">Command-line editing</a></li>
5107 <li><a href="#index-comint_002dcopy_002dold_002dinput-65"><code>comint-copy-old-input</code></a>: <a href="#Transcript-resubmit">Transcript resubmit</a></li>
5108 <li><a href="#index-comint_002ddelimiter_002dargument_002dlist-82"><code>comint-delimiter-argument-list</code></a>: <a href="#History-expansion">History expansion</a></li>
5109 <li><a href="#index-comint_002ddynamic_002dcomplete-42"><code>comint-dynamic-complete</code></a>: <a href="#Completion">Completion</a></li>
5110 <li><a href="#index-comint_002dforward_002dmatching_002dinput-63"><code>comint-forward-matching-input</code></a>: <a href="#Process-buffer-motion">Process buffer motion</a></li>
5111 <li><a href="#index-comint_002dinput_002dring_002dsize-75"><code>comint-input-ring-size</code></a>: <a href="#Command-History">Command History</a></li>
5112 <li><a href="#index-comint_002dinterrupt_002dsubjob-110"><code>comint-interrupt-subjob</code></a>: <a href="#Other">Other</a></li>
5113 <li><a href="#index-comint_002dkill_002dinput-38"><code>comint-kill-input</code></a>: <a href="#Command_002dline-editing">Command-line editing</a></li>
5114 <li><a href="#index-comint_002dkill_002doutput-58"><code>comint-kill-output</code></a>: <a href="#Last-command">Last command</a></li>
5115 <li><a href="#index-comint_002dnext_002dinput-77"><code>comint-next-input</code></a>: <a href="#Command-History">Command History</a></li>
5116 <li><a href="#index-comint_002dnext_002dinput-61"><code>comint-next-input</code></a>: <a href="#Process-buffer-motion">Process buffer motion</a></li>
5117 <li><a href="#index-comint_002dnext_002dmatching_002dinput-79"><code>comint-next-matching-input</code></a>: <a href="#Command-History">Command History</a></li>
5118 <li><a href="#index-comint_002dnext_002dmatching_002dinput_002dfrom_002dinput-81"><code>comint-next-matching-input-from-input</code></a>: <a href="#Command-History">Command History</a></li>
5119 <li><a href="#index-comint_002dprevious_002dinput-76"><code>comint-previous-input</code></a>: <a href="#Command-History">Command History</a></li>
5120 <li><a href="#index-comint_002dprevious_002dinput-60"><code>comint-previous-input</code></a>: <a href="#Process-buffer-motion">Process buffer motion</a></li>
5121 <li><a href="#index-comint_002dprevious_002dmatching_002dinput-78"><code>comint-previous-matching-input</code></a>: <a href="#Command-History">Command History</a></li>
5122 <li><a href="#index-comint_002dprevious_002dmatching_002dinput_002dfrom_002dinput-80"><code>comint-previous-matching-input-from-input</code></a>: <a href="#Command-History">Command History</a></li>
5123 <li><a href="#index-comint_002dshow_002dmaximum_002doutput-55"><code>comint-show-maximum-output</code></a>: <a href="#Last-command">Last command</a></li>
5124 <li><a href="#index-comint_002dshow_002doutput-57"><code>comint-show-output</code></a>: <a href="#Last-command">Last command</a></li>
5125 <li><a href="#index-comint_002dstop_002dsubjob-114"><code>comint-stop-subjob</code></a>: <a href="#Other">Other</a></li>
5126 <li><a href="#index-comment_002dcolumn-155"><code>comment-column</code></a>: <a href="#Indenting">Indenting</a></li>
5127 <li><a href="#index-dump_0028_0029-131"><code>dump()</code></a>: <a href="#Edit-buffer">Edit buffer</a></li>
5128 <li><a href="#index-ess_002dabort-113"><code>ess-abort</code></a>: <a href="#Other">Other</a></li>
5129 <li><a href="#index-ess_002dask_002dabout_002ddisplay-203"><code>ess-ask-about-display</code></a>: <a href="#X11">X11</a></li>
5130 <li><a href="#index-ess_002dask_002dabout_002dtransfile-68"><code>ess-ask-about-transfile</code></a>: <a href="#Saving-transcripts">Saving transcripts</a></li>
5131 <li><a href="#index-ess_002dask_002dabout_002dtransfile-28"><code>ess-ask-about-transfile</code></a>: <a href="#Customizing-startup">Customizing startup</a></li>
5132 <li><a href="#index-ess_002dask_002dfor_002dess_002ddirectory-26"><code>ess-ask-for-ess-directory</code></a>: <a href="#Customizing-startup">Customizing startup</a></li>
5133 <li><a href="#index-ess_002dbeginning_002dof_002dfunction-160"><code>ess-beginning-of-function</code></a>: <a href="#Other-edit-buffer-commands">Other edit buffer commands</a></li>
5134 <li><a href="#index-ess_002dchange_002dsp_002dregexp-50"><code>ess-change-sp-regexp</code></a>: <a href="#Completion-details">Completion details</a></li>
5135 <li><a href="#index-ess_002dcleanup-193"><code>ess-cleanup</code></a>: <a href="#Help">Help</a></li>
5136 <li><a href="#index-ess_002dcleanup-103"><code>ess-cleanup</code></a>: <a href="#Hot-keys">Hot keys</a></li>
5137 <li><a href="#index-ess_002ddelete_002ddump_002dfiles-166"><code>ess-delete-dump-files</code></a>: <a href="#Source-Files">Source Files</a></li>
5138 <li><a href="#index-ess_002ddescribe_002dhelp_002dmode-183"><code>ess-describe-help-mode</code></a>: <a href="#Help">Help</a></li>
5139 <li><a href="#index-ess_002ddirectory-177"><code>ess-directory</code></a>: <a href="#Source-Directories">Source Directories</a></li>
5140 <li><a href="#index-ess_002ddirectory-27"><code>ess-directory</code></a>: <a href="#Customizing-startup">Customizing startup</a></li>
5141 <li><a href="#index-ess_002ddisplay_002dhelp_002don_002dobject-182"><code>ess-display-help-on-object</code></a>: <a href="#Help">Help</a></li>
5142 <li><a href="#index-ess_002ddump_002dfilename_002dtemplate-173"><code>ess-dump-filename-template</code></a>: <a href="#Source-Directories">Source Directories</a></li>
5143 <li><a href="#index-ess_002ddump_002dobject_002dinto_002dedit_002dbuffer-124"><code>ess-dump-object-into-edit-buffer</code></a>: <a href="#Edit-buffer">Edit buffer</a></li>
5144 <li><a href="#index-ess_002ddump_002dobject_002dinto_002dedit_002dbuffer-117"><code>ess-dump-object-into-edit-buffer</code></a>: <a href="#Other">Other</a></li>
5145 <li><a href="#index-ESS_002delsewhere-24"><code>ESS-elsewhere</code></a>: <a href="#ESS-processes-on-Remote-Computers">ESS processes on Remote Computers</a></li>
5146 <li><a href="#index-ess_002dend_002dof_002dfunction-161"><code>ess-end-of-function</code></a>: <a href="#Other-edit-buffer-commands">Other edit buffer commands</a></li>
5147 <li><a href="#index-ess_002deval_002dbuffer-148"><code>ess-eval-buffer</code></a>: <a href="#Evaluating-code">Evaluating code</a></li>
5148 <li><a href="#index-ess_002deval_002dfunction-144"><code>ess-eval-function</code></a>: <a href="#Evaluating-code">Evaluating code</a></li>
5149 <li><a href="#index-ess_002deval_002dfunction_002dand_002dgo-145"><code>ess-eval-function-and-go</code></a>: <a href="#Evaluating-code">Evaluating code</a></li>
5150 <li><a href="#index-ess_002deval_002dline-142"><code>ess-eval-line</code></a>: <a href="#Evaluating-code">Evaluating code</a></li>
5151 <li><a href="#index-ess_002deval_002dline_002dand_002dgo-143"><code>ess-eval-line-and-go</code></a>: <a href="#Evaluating-code">Evaluating code</a></li>
5152 <li><a href="#index-ess_002deval_002dline_002dand_002dstep-189"><code>ess-eval-line-and-step</code></a>: <a href="#Help">Help</a></li>
5153 <li><a href="#index-ess_002deval_002dline_002dand_002dstep-150"><code>ess-eval-line-and-step</code></a>: <a href="#Evaluating-code">Evaluating code</a></li>
5154 <li><a href="#index-ess_002deval_002dregion-190"><code>ess-eval-region</code></a>: <a href="#Help">Help</a></li>
5155 <li><a href="#index-ess_002deval_002dregion-146"><code>ess-eval-region</code></a>: <a href="#Evaluating-code">Evaluating code</a></li>
5156 <li><a href="#index-ess_002deval_002dregion_002dand_002dgo-147"><code>ess-eval-region-and-go</code></a>: <a href="#Evaluating-code">Evaluating code</a></li>
5157 <li><a href="#index-ess_002deval_002dvisibly_002dp-137"><code>ess-eval-visibly-p</code></a>: <a href="#Evaluating-code">Evaluating code</a></li>
5158 <li><a href="#index-ess_002dexecute-92"><code>ess-execute</code></a>: <a href="#Hot-keys">Hot keys</a></li>
5159 <li><a href="#index-ess_002dexecute_002dattach-95"><code>ess-execute-attach</code></a>: <a href="#Hot-keys">Hot keys</a></li>
5160 <li><a href="#index-ess_002dexecute_002din_002dprocess_002dbuffer-83"><code>ess-execute-in-process-buffer</code></a>: <a href="#Hot-keys">Hot keys</a></li>
5161 <li><a href="#index-ess_002dexecute_002din_002dtb-153"><code>ess-execute-in-tb</code></a>: <a href="#Evaluating-code">Evaluating code</a></li>
5162 <li><a href="#index-ess_002dexecute_002dobjects-84"><code>ess-execute-objects</code></a>: <a href="#Hot-keys">Hot keys</a></li>
5163 <li><a href="#index-ess_002dexecute_002dsearch-88"><code>ess-execute-search</code></a>: <a href="#Hot-keys">Hot keys</a></li>
5164 <li><a href="#index-ess_002dfancy_002dcomments-156"><code>ess-fancy-comments</code></a>: <a href="#Indenting">Indenting</a></li>
5165 <li><a href="#index-ess_002dfunction_002dtemplate-128"><code>ess-function-template</code></a>: <a href="#Edit-buffer">Edit buffer</a></li>
5166 <li><a href="#index-ess_002dkeep_002ddump_002dfiles-167"><code>ess-keep-dump-files</code></a>: <a href="#Source-Files">Source Files</a></li>
5167 <li><a href="#index-ess_002dlist_002dobject_002dcompletions-46"><code>ess-list-object-completions</code></a>: <a href="#Completion">Completion</a></li>
5168 <li><a href="#index-ess_002dload_002dfile-132"><code>ess-load-file</code></a>: <a href="#Loading">Loading</a></li>
5169 <li><a href="#index-ess_002dload_002dfile-97"><code>ess-load-file</code></a>: <a href="#Hot-keys">Hot keys</a></li>
5170 <li><a href="#index-ess_002dmode_002dfont_002dlock_002dkeywords-198"><code>ess-mode-font-lock-keywords</code></a>: <a href="#Highlighting">Highlighting</a></li>
5171 <li><a href="#index-ess_002dparse_002derrors-136"><code>ess-parse-errors</code></a>: <a href="#Error-Checking">Error Checking</a></li>
5172 <li><a href="#index-ess_002dparse_002derrors-98"><code>ess-parse-errors</code></a>: <a href="#Hot-keys">Hot keys</a></li>
5173 <li><a href="#index-ess_002dquit-192"><code>ess-quit</code></a>: <a href="#Help">Help</a></li>
5174 <li><a href="#index-ess_002dquit-115"><code>ess-quit</code></a>: <a href="#Other">Other</a></li>
5175 <li><a href="#index-ess_002dremote-23"><code>ess-remote</code></a>: <a href="#ESS-processes-on-Remote-Computers">ESS processes on Remote Computers</a></li>
5176 <li><a href="#index-ess_002drequest_002da_002dprocess-21"><code>ess-request-a-process</code></a>: <a href="#Multiple-ESS-processes">Multiple ESS processes</a></li>
5177 <li><a href="#index-ess_002dresynch-51"><code>ess-resynch</code></a>: <a href="#Completion-details">Completion details</a></li>
5178 <li><a href="#index-ess_002dsearch_002dlist-180"><code>ess-search-list</code></a>: <a href="#Source-Directories">Source Directories</a></li>
5179 <li><a href="#index-ess_002dskip_002dto_002dhelp_002dsection-188"><code>ess-skip-to-help-section</code></a>: <a href="#Help">Help</a></li>
5180 <li><a href="#index-ess_002dskip_002dto_002dnext_002dsection-186"><code>ess-skip-to-next-section</code></a>: <a href="#Help">Help</a></li>
5181 <li><a href="#index-ess_002dskip_002dto_002dprevious_002dsection-187"><code>ess-skip-to-previous-section</code></a>: <a href="#Help">Help</a></li>
5182 <li><a href="#index-ess_002dsource_002ddirectory-175"><code>ess-source-directory</code></a>: <a href="#Source-Directories">Source Directories</a></li>
5183 <li><a href="#index-ess_002dsubmit_002dbug_002dreport-207"><code>ess-submit-bug-report</code></a>: <a href="#Reporting-Bugs">Reporting Bugs</a></li>
5184 <li><a href="#index-ess_002dswitch_002dto_002dend_002dof_002dESS-191"><code>ess-switch-to-end-of-ESS</code></a>: <a href="#Help">Help</a></li>
5185 <li><a href="#index-ess_002dswitch_002dto_002dend_002dof_002dESS-163"><code>ess-switch-to-end-of-ESS</code></a>: <a href="#Other-edit-buffer-commands">Other edit buffer commands</a></li>
5186 <li><a href="#index-ess_002dswitch_002dto_002dESS-164"><code>ess-switch-to-ESS</code></a>: <a href="#Other-edit-buffer-commands">Other edit buffer commands</a></li>
5187 <li><a href="#index-ess_002dtrans_002dfont_002dlock_002dkeywords-199"><code>ess-trans-font-lock-keywords</code></a>: <a href="#Highlighting">Highlighting</a></li>
5188 <li><a href="#index-ess_002dtranscript_002dclean_002dregion-71"><code>ess-transcript-clean-region</code></a>: <a href="#Saving-transcripts">Saving transcripts</a></li>
5189 <li><a href="#index-ess_002dtranscript_002dcopy_002dcommand-121"><code>ess-transcript-copy-command</code></a>: <a href="#Resubmit">Resubmit</a></li>
5190 <li><a href="#index-ess_002dtranscript_002dsend_002dcommand-120"><code>ess-transcript-send-command</code></a>: <a href="#Resubmit">Resubmit</a></li>
5191 <li><a href="#index-ess_002dtranscript_002dsend_002dcommand_002dand_002dmove-66"><code>ess-transcript-send-command-and-move</code></a>: <a href="#Transcript-resubmit">Transcript resubmit</a></li>
5192 <li><a href="#index-exit_0028_0029-102"><code>exit()</code></a>: <a href="#Hot-keys">Hot keys</a></li>
5193 <li><a href="#index-inferior_002dess_002dfont_002dlock_002dkeywords-197"><code>inferior-ess-font-lock-keywords</code></a>: <a href="#Highlighting">Highlighting</a></li>
5194 <li><a href="#index-inferior_002dess_002dprogram-30"><code>inferior-ess-program</code></a>: <a href="#Customizing-startup">Customizing startup</a></li>
5195 <li><a href="#index-inferior_002dess_002dsend_002dinput-64"><code>inferior-ess-send-input</code></a>: <a href="#Transcript-resubmit">Transcript resubmit</a></li>
5196 <li><a href="#index-inferior_002dess_002dsend_002dinput-36"><code>inferior-ess-send-input</code></a>: <a href="#Command_002dline-editing">Command-line editing</a></li>
5197 <li><a href="#index-objects_0028_0029-85"><code>objects()</code></a>: <a href="#Hot-keys">Hot keys</a></li>
5198 <li><a href="#index-printer_0028_0029-201"><code>printer()</code></a>: <a href="#printer">printer</a></li>
5199 <li><a href="#index-q_0028_0029-101"><code>q()</code></a>: <a href="#Hot-keys">Hot keys</a></li>
5200 <li><a href="#index-S-12"><code>S</code></a>: <a href="#Starting-up">Starting up</a></li>
5201 <li><a href="#index-S_002belsewhere-25"><code>S+elsewhere</code></a>: <a href="#ESS-processes-on-Remote-Computers">ESS processes on Remote Computers</a></li>
5202 <li><a href="#index-search_0028_0029-89"><code>search()</code></a>: <a href="#Hot-keys">Hot keys</a></li>
5203 <li><a href="#index-search_0028_0029-44"><code>search()</code></a>: <a href="#Completion">Completion</a></li>
5204 <li><a href="#index-source_0028_0029-138"><code>source()</code></a>: <a href="#Evaluating-code">Evaluating code</a></li>
5205 <li><a href="#index-source_0028_0029-133"><code>source()</code></a>: <a href="#Loading">Loading</a></li>
5206 <li><a href="#index-STERM-108"><code>STERM</code></a>: <a href="#Statistical-Process-running-in-ESS_003f">Statistical Process running in ESS?</a></li>
5207 </ul>
5208 <div class="contents">
5209 <h2>Table of Contents</h2>
5210 <ul>
5211 <li><a name="toc_Top" href="#Top">ESS: Emacs Speaks Statistics</a>
5212 <li><a name="toc_Introduction" href="#Introduction">1 Introduction to ESS</a>
5213 <ul>
5214 <li><a href="#Features">1.1 Why should I use ESS?</a>
5215 <li><a href="#New-features">1.2 New features in ESS</a>
5216 <li><a href="#Credits">1.3 Authors of and contributors to ESS</a>
5217 <li><a href="#Latest-version">1.4 Getting the latest version of ESS</a>
5218 <li><a href="#Manual">1.5 How to read this manual</a>
5219 </li></ul>
5220 <li><a name="toc_Installation" href="#Installation">2 Installing ESS on your system</a>
5221 <ul>
5222 <li><a href="#Unix-installation">2.1 Unix installation</a>
5223 <li><a href="#Microsoft-Windows-installation">2.2 Microsoft Windows installation</a>
5224 <li><a href="#Requirements">2.3 Requirements</a>
5225 </li></ul>
5226 <li><a name="toc_Interactive-ESS" href="#Interactive-ESS">3 Interacting with statistical programs</a>
5227 <ul>
5228 <li><a href="#Starting-up">3.1 Starting an ESS process</a>
5229 <li><a href="#Multiple-ESS-processes">3.2 Running more than one ESS process</a>
5230 <li><a href="#ESS-processes-on-Remote-Computers">3.3 ESS processes on Remote Computers</a>
5231 <li><a href="#S_002belsewhere-and-ESS_002delsewhere">3.4 S+elsewhere and ESS-elsewhere</a>
5232 <li><a href="#Customizing-startup">3.5 Changing the startup actions</a>
5233 </li></ul>
5234 <li><a name="toc_Entering-commands" href="#Entering-commands">4 Interacting with the ESS process</a>
5235 <ul>
5236 <li><a href="#Command_002dline-editing">4.1 Entering commands and fixing mistakes</a>
5237 <li><a href="#Completion">4.2 Completion of object names</a>
5238 <li><a href="#Completion-details">4.3 Completion details</a>
5239 <li><a href="#Transcript">4.4 Manipulating the transcript</a>
5240 <ul>
5241 <li><a href="#Last-command">4.4.1 Manipulating the output from the last command</a>
5242 <li><a href="#Process-buffer-motion">4.4.2 Viewing older commands</a>
5243 <li><a href="#Transcript-resubmit">4.4.3 Re-submitting commands from the transcript</a>
5244 <li><a href="#Saving-transcripts">4.4.4 Keeping a record of your S session</a>
5245 </li></ul>
5246 <li><a href="#Command-History">4.5 Command History</a>
5247 <li><a href="#History-expansion">4.6 References to historical commands</a>
5248 <li><a href="#Hot-keys">4.7 Hot keys for common commands</a>
5249 <li><a href="#Statistical-Process-running-in-ESS_003f">4.8 Is the Statistical Process running under ESS?</a>
5250 <li><a href="#Emacsclient">4.9 Using emacsclient</a>
5251 <li><a href="#Other">4.10 Other commands provided by inferior-ESS</a>
5252 </li></ul>
5253 <li><a name="toc_Transcript-Mode" href="#Transcript-Mode">5 Manipulating saved transcript files</a>
5254 <ul>
5255 <li><a href="#Resubmit">5.1 Resubmitting commands from the transcript file</a>
5256 <li><a href="#Clean">5.2 Cleaning transcript files</a>
5257 </li></ul>
5258 <li><a name="toc_ESS-for-the-S-family" href="#ESS-for-the-S-family">6 ESS for the S family</a>
5259 <ul>
5260 <li><a href="#ESS_0028S_0029_002d_002dEditing-files">6.1 ESS[S]&ndash;Editing files</a>
5261 <li><a href="#iESS_0028S_0029_002d_002dInferior-ESS-processes">6.2 iESS[S]&ndash;Inferior ESS processes</a>
5262 <li><a href="#ESS_002dhelp_002d_002dassistance-with-viewing-help">6.3 ESS-help&ndash;assistance with viewing help</a>
5263 <li><a href="#Philosophies-for-using-ESS_0028S_0029">6.4 Philosophies for using ESS[S]</a>
5264 <li><a href="#Scenarios-for-use-_0028possibilities_002d_002dbased-on-actual-usage_0029">6.5 Scenarios for use (possibilities&ndash;based on actual usage)</a>
5265 <li><a href="#Customization-Examples-and-Solutions-to-Problems">6.6 Customization Examples and Solutions to Problems</a>
5266 </li></ul>
5267 <li><a name="toc_Editing" href="#Editing">7 Editing S functions</a>
5268 <ul>
5269 <li><a href="#Edit-buffer">7.1 Creating or modifying S objects</a>
5270 <li><a href="#Loading">7.2 Loading source files into the ESS process</a>
5271 <li><a href="#Error-Checking">7.3 Detecting errors in source files</a>
5272 <li><a href="#Evaluating-code">7.4 Sending code to the ESS process</a>
5273 <li><a href="#Indenting">7.5 Indenting and formatting S code</a>
5274 <li><a href="#Other-edit-buffer-commands">7.6 Commands for motion, completion and more</a>
5275 <li><a href="#Source-Files">7.7 Maintaining S source files</a>
5276 <li><a href="#Source-Directories">7.8 Names and locations of dump files</a>
5277 </li></ul>
5278 <li><a name="toc_Editing-R-documentation-files" href="#Editing-R-documentation-files">8 Editing R documentation files</a>
5279 <li><a name="toc_Help" href="#Help">9 Reading help files</a>
5280 <li><a name="toc_ESS-for-SAS" href="#ESS-for-SAS">10 ESS for SAS</a>
5281 <ul>
5282 <li><a href="#ESS_0028SAS_0029_002d_002dDesign-philosophy">10.1 ESS(SAS)&ndash;Design philosophy</a>
5283 <li><a href="#ESS_0028SAS_0029_002d_002dEditing-files">10.2 ESS(SAS)&ndash;Editing files</a>
5284 <li><a href="#ESS_0028SAS_0029_002d_002dTAB-key">10.3 ESS(SAS)&ndash;&lt;TAB&gt; key</a>
5285 <li><a href="#ESS_0028SAS_0029_002d_002dBatch-SAS-processes">10.4 ESS(SAS)&ndash;Batch SAS processes</a>
5286 <li><a href="#ESS_0028SAS_0029_002d_002dFunction-keys-for-batch-processing">10.5 ESS(SAS)&ndash;Function keys for batch processing</a>
5287 <li><a href="#iESS_0028SAS_0029_002d_002dInteractive-SAS-processes">10.6 iESS(SAS)&ndash;Interactive SAS processes</a>
5288 <li><a href="#iESS_0028SAS_0029_002d_002dCommon-problems">10.7 iESS(SAS)&ndash;Common problems</a>
5289 <li><a href="#ESS_0028SAS_0029_002d_002dGraphics">10.8 ESS(SAS)&ndash;Graphics</a>
5290 <li><a href="#ESS_0028SAS_0029_002d_002dWindows">10.9 ESS(SAS)&ndash;Windows</a>
5291 </li></ul>
5292 <li><a name="toc_ESS-for-BUGS" href="#ESS-for-BUGS">11 ESS for BUGS</a>
5293 <ul>
5294 <li><a href="#ESS_0028BUGS_0029_002d_002dModel-files">11.1 ESS[BUGS]&ndash;Model files</a>
5295 <li><a href="#ESS_0028BUGS_0029_002d_002dCommand-files">11.2 ESS[BUGS]&ndash;Command files</a>
5296 <li><a href="#ESS_0028BUGS_0029_002d_002dLog-files">11.3 ESS[BUGS]&ndash;Log files</a>
5297 </li></ul>
5298 <li><a name="toc_Miscellaneous" href="#Miscellaneous">12 Other features of ESS</a>
5299 <ul>
5300 <li><a href="#Highlighting">12.1 Syntactic highlighting of buffers</a>
5301 <li><a href="#Parens">12.2 Parenthesis matching</a>
5302 <li><a href="#Graphics">12.3 Using graphics with ESS</a>
5303 <ul>
5304 <li><a href="#printer">12.3.1 Using ESS with the <code>printer()</code> driver</a>
5305 <li><a href="#X11">12.3.2 Using ESS with windowing devices</a>
5306 <li><a href="#winjava">12.3.3 Java Graphics Device</a>
5307 </li></ul>
5308 <li><a href="#Imenu">12.4 Imenu</a>
5309 <li><a href="#Toolbar">12.5 Toolbar</a>
5310 <li><a href="#TAGS">12.6 TAGS</a>
5311 <li><a href="#Rdired">12.7 Rdired</a>
5312 </li></ul>
5313 <li><a name="toc_Mailing-lists_002fbug-reports" href="#Mailing-lists_002fbug-reports">13 Bugs and Bug Reporting, Mailing Lists</a>
5314 <ul>
5315 <li><a href="#Bugs">13.1 Bugs</a>
5316 <li><a href="#Reporting-Bugs">13.2 Reporting Bugs</a>
5317 <li><a href="#Mailing-Lists">13.3 Mailing Lists</a>
5318 </li></ul>
5319 <li><a name="toc_Customization" href="#Customization">Appendix A Customizing ESS</a>
5320 <li><a name="toc_Key-Index" href="#Key-Index">Key (Character) Index</a>
5321 <li><a name="toc_Concept-Index" href="#Concept-Index">Concept Index</a>
5322 <li><a name="toc_Variable-and-command-index" href="#Variable-and-command-index">Variable and command index</a>
5323 </li></ul>
5324 </div>
5326 <div class="footnote">
5327 <hr>
5328 <a name="texinfo-footnotes-in-document"></a><h4>Footnotes</h4><p class="footnote"><small>[<a name="fn-1" href="#fnd-1">1</a>]</small>
5329 require the files.el patch to revert-buffer for the Local Variables
5330 updating problem</p>
5332 <p class="footnote"><small>[<a name="fn-2" href="#fnd-2">2</a>]</small> The variable <code>ess-change-sp-regexp</code> is a regular
5333 expression matching commands which change the search list. You will
5334 need to modify this variable if you have defined custom commands (other
5335 than <code>attach</code>, <code>detach</code>, <code>collection</code> or <code>library</code>)
5336 which modify the search list.</p>
5338 <p><hr></div>
5340 </body></html>