~ubuntu-branches/ubuntu/edgy/ess/edgy

« back to all changes in this revision

Viewing changes to doc/html/ess.html

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2005-03-22 13:48:07 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050322134807-9mpmbb799jugf248
Tags: 5.2.6-1
* New upstream release
* chmod -R u+w on orig source

Show diffs side-by-side

added added

removed removed

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