3
<!-- Created by texi2html 1.56k from ess.texi on 6 August 2002 -->
5
<TITLE>ESS -- Emacs Speaks Statistics - Interacting with the ESS process</TITLE>
8
Go to the <A HREF="ess_1.html">first</A>, <A HREF="ess_5.html">previous</A>, <A HREF="ess_7.html">next</A>, <A HREF="ess_16.html">last</A> section, <A HREF="ess_toc.html">table of contents</A>.
12
<H1><A NAME="SEC35" HREF="ess_toc.html#TOC35">Interacting with the <B>ESS</B> process</A></H1>
20
The primary function of the ESS package is to provide an easy-to-use
21
front end to the <B>S</B> interpreter. This is achieved by running the S
22
process from within an Emacs buffer, so that the Emacs editing commands
23
are available to correct mistakes in commands, etc. The features of
24
Inferior <B>S</B> mode are similar to those provided by the standard Emacs
25
shell mode (see section `Shell Mode' in <CITE>The Gnu Emacs Reference Manual</CITE>). Command-line completion of <B>S</B> objects and a number of `hot
26
keys' for commonly-used <B>S</B> commands are also provided for ease of
32
<LI><A HREF="ess_6.html#SEC36">Command-line editing</A>: Entering commands and fixing mistakes
33
<LI><A HREF="ess_6.html#SEC37">Completion</A>: Completion of object names
34
<LI><A HREF="ess_6.html#SEC38">Completion details</A>: Advanced completion concepts
35
<LI><A HREF="ess_6.html#SEC39">Transcript</A>: Manipulating the transcript
36
<LI><A HREF="ess_6.html#SEC44">Command History</A>: Command History
37
<LI><A HREF="ess_6.html#SEC45">History expansion</A>: References to historical commands
38
<LI><A HREF="ess_6.html#SEC46">Hot keys</A>: Hot keys for common commands
39
<LI><A HREF="ess_6.html#SEC47">Statistical Process running in ESS?</A>
40
<LI><A HREF="ess_6.html#SEC48">Other</A>: Other commands provided by inferior-ESS
45
<H2><A NAME="SEC36" HREF="ess_toc.html#TOC36">Entering commands and fixing mistakes</A></H2>
51
Sending a command to the <B>ESS</B> process is as simple as typing it in
52
and pressing the <KBD>RETURN</KBD> key:
59
<KBD>RET</KBD> (<CODE>inferior-ess-send-input</CODE>) <BR>
61
Send the command on the current line to the <B>ESS</B> process.
65
If you make a typing error before pressing <KBD>RET</KBD> all the usual Emacs
66
editing commands are available to correct it (see section `Basic editing commands' in <CITE>The GNU Emacs Reference Manual</CITE>). Once the
67
command has been corrected you can press <KBD>RETURN</KBD> (even if the
68
cursor is not at the end of the line) to send the corrected command to
69
the <B>ESS</B> process.
73
ESS provides some other commands which are useful for fixing mistakes:
80
<KBD>C-c C-w</KBD> (<CODE>backward-kill-word</CODE>) <BR>
82
Deletes the previous word (such as an object name) on the command line.
86
<KBD>C-c C-u</KBD> (<CODE>comint-kill-input</CODE>) <BR>
88
Deletes everything from the prompt to point. Use this to abandon a
89
command you have not yet sent to the <B>ESS</B> process.
93
<KBD>C-c C-a</KBD> (<CODE>comint-bol</CODE>) <BR>
95
Move to the beginning of the line, and then skip forwards past the
100
See section `Shell Mode' in <CITE>The Gnu Emacs Reference Manual</CITE>, for other
101
commands relevant to entering input.
106
<H2><A NAME="SEC37" HREF="ess_toc.html#TOC37">Completion of object names</A></H2>
113
In the process buffer, the <KBD>TAB</KBD> key is for completion, similar to
114
that provided by Shell Mode for filenames. In Inferior <B>S</B> mode,
115
pressing the <KBD>TAB</KBD> key when the cursor is following the first few
116
characters of an object name <EM>completes</EM> the object name; if the
117
cursor is following a file name <KBD>TAB</KBD> completes the file name.
124
<KBD>TAB</KBD> (<CODE>comint-dynamic-complete</CODE>) <BR>
126
Complete the <B>S</B> object name or filename before point.
130
When the cursor is just after a partially-completed object name,
131
pressing <KBD>TAB</KBD> provides completion in a similar fashion to
134
except that completion is performed over all known <B>S</B> object names
135
instead of file names. ESS maintains a list of all objects known to S
136
at any given time, which basically consists of all objects (functions
137
and datasets) in every attached directory listed by the <CODE>search()</CODE>
140
along with the component objects of attached data frames
142
(if your version of <B>S</B> supports them).
146
For example, consider the three functions (available in Splus version
147
3.0) called <CODE>binomplot()</CODE>, <CODE>binom.test()</CODE> and
148
<CODE>binomial()</CODE>. Typing <KBD>bin TAB</KBD> after the <B>S</B> prompt will
149
insert the characters <SAMP>`om'</SAMP>, completing the longest prefix
150
(<SAMP>`binom'</SAMP>) which distinguishes these three commands. Pressing
151
<KBD>TAB</KBD> once more provides a list of the three commands which have
152
this prefix, allowing you to add more characters (say, <SAMP>`.'</SAMP>) which
153
specify the function you desire. After entering more characters
154
pressing <KBD>TAB</KBD> yet again will complete the object name up to
155
uniqueness, etc. If you just wish to see what completions exist without
156
adding any extra characters, type <KBD>M-?</KBD>.
163
<KBD>M-?</KBD> (<CODE>ess-list-object-name-completions</CODE>) <BR>
165
List all possible completions of the object name at point.
169
ESS also provides completion over the components of named lists accessed
170
using the <SAMP>`$'</SAMP> notation, to any level of nested lists. This feature
171
is particularly useful for checking what components of a list object
172
exist while partway through entering a command: simply type the object
173
name and <SAMP>`$'</SAMP> and press <KBD>TAB</KBD> to see the names of existing list
174
components for that object.
181
Completion is also provided over file names, which is particularly
182
useful when using <B>S</B> functions such as <CODE>get()</CODE> or <CODE>scan()</CODE>
183
which require fully expanded file names. Whenever the cursor is within
184
an <B>S</B> string, pressing <KBD>TAB</KBD> completes the file name before
185
point, and also expands any <SAMP>`~'</SAMP> or environment variable references.
189
If the cursor is not in a string and does not follow a (partial) object
190
name, the <KBD>TAB</KBD> key has a third use: it expands history references.
191
See section <A HREF="ess_6.html#SEC45">References to historical commands</A>.
196
<H2><A NAME="SEC38" HREF="ess_toc.html#TOC38">Completion details</A></H2>
199
ESS automatically keeps track of any objects added or deleted to the
200
system (such as new objects created, or directories added to the search
201
list) to make completion as accurate as possible. Whenever ESS notices
202
that search list has changed
204
<A NAME="DOCF2" HREF="ess_foot.html#FOOT2">(2)</A> when you attach a directory or data
205
frame, the objects associated with it immediately become available for a
206
completion; when it is detached completion is no longer available on
211
To maintain a list of accessible objects for completion, ESS needs to
212
determine which objects are contained in each directory or data frame on
213
the search list. This is done at the start of each <B>S</B> session, by
214
running the <CODE>objects()</CODE> command on every element of the search
215
list. On some systems, however, this can be rather slow; it's doubly
216
frustrating when you consider that most of the directories on the search
217
list are the standard <B>S</B> libraries, which never change anyway! When
218
ESS was installed, a database of the standard object names should have
219
been created which should speed up this process at the start of an S
220
session; if it has not been created you will get a warning like
221
`S-namedb.el does not exist'. See section <A HREF="ess_2.html#SEC7">Installing ESS on your system</A>, for information on
222
how to create this database.
226
Efficiency in completion is gained by maintaining a cache of objects
227
currently known to S; when a new object becomes available or is deleted,
228
only one component of the cache corresponding to the associated
229
directory needs to be refreshed. If ESS ever becomes confused about
230
what objects are available for completion (such as when if refuses to
231
complete an object you <STRONG>know</STRONG> is there), the command <KBD>M-x
234
forces the <EM>entire</EM> cache to be refreshed, which should fix the
240
<H2><A NAME="SEC39" HREF="ess_toc.html#TOC39">Manipulating the transcript</A></H2>
243
Most of the time, the cursor spends most of its time at the bottom of
244
the <B>ESS</B> process buffer, entering commands. However all the input
245
and output from the current (and previous) <B>ESS</B> sessions is stored in
246
the process buffer (we call this the transcript) and often we want to
248
move back up through the buffer, to look at the output from previous
249
commands for example.
253
Within the process buffer, a paragraph
255
is defined as the prompt, the command after the prompt, and the output
256
from the command. Thus <KBD>M-{</KBD> and <KBD>M-}</KBD> move you backwards and
257
forwards, respectively, through commands in the transcript. A
258
particularly useful command is <KBD>M-h</KBD> (<CODE>mark-paragraph</CODE>) which
259
will allow you to mark a command and its entire output (for deletion,
260
perhaps). For more information about paragraph commands,
261
see section `Paragraphs' in <CITE>The GNU Emacs Reference Manual</CITE>.
265
If an ESS process finishes and you restart it in the same process
266
buffer, the output from the new ESS process appears after the output
267
from the first ESS process separated by a form-feed (<SAMP>`^L'</SAMP>)
268
character. Thus pages in the ESS
270
process buffer correspond to ESS sessions. Thus, for example, you may
271
use <KBD>C-x [</KBD> and <KBD>C-x ]</KBD> to move backward and forwards through
272
ESS sessions in a single ESS process buffer. For more information about
273
page commands, see section `Pages' in <CITE>The GNU Emacs Reference Manual</CITE>.
278
<LI><A HREF="ess_6.html#SEC40">Last command</A>: Manipulating the output from the last command
279
<LI><A HREF="ess_6.html#SEC41">Process buffer motion</A>: Viewing more historic commands
280
<LI><A HREF="ess_6.html#SEC42">Transcript resubmit</A>: Re-submitting commands from the transcript
281
<LI><A HREF="ess_6.html#SEC43">Saving transcripts</A>: Keeping a record of your <B>S</B> session
286
<H3><A NAME="SEC40" HREF="ess_toc.html#TOC40">Manipulating the output from the last command</A></H3>
289
Viewing the output of the command you have just entered is a common
290
occurrence and ESS provides a number of facilities for doing this.
291
Whenever a command produces a longish output, it is possible that the
292
window will scroll, leaving the next prompt near the middle of the
293
window. The first part of the command output may have scrolled off the
294
top of the window, even though the entire output would fit in the window
295
if the prompt were near the bottom of the window. If this happens, you
303
<KBD>C-c C-e</KBD> (<CODE>comint-show-maximum-output</CODE>) <BR>
305
Move to the end of the buffer, and place cursor on bottom line of
310
to make more of the last output visible. (To make this happen
311
automatically for all inputs, set the variable
312
<CODE>comint-scroll-to-bottom-on-input</CODE> to <CODE>t</CODE>; for information on
313
this and other options for handling process input and output
314
see section `Shell Mode Options' in <CITE>The GNU Emacs Reference Manual</CITE>.)
318
If the first part of the output is still obscured, use
324
<KBD>C-c C-r</KBD> (<CODE>comint-show-output</CODE>) <BR>
326
Moves cursor to the previous command line and and places it at the top
331
to view it. Finally, if you want to discard the last command output
339
<KBD>C-c C-o</KBD> (<CODE>comint-kill-output</CODE>) <BR>
342
Deletes everything from the last command to the current prompt.
346
to delete it. Use this command judiciously to keep your transcript to a
347
more manageable size.
352
<H3><A NAME="SEC41" HREF="ess_toc.html#TOC41">Viewing more historic commands</A></H3>
355
If you want to view the output from more historic commands than the
356
previous command, commands are also provided to move backwards and
357
forwards through previously entered commands in the process buffer:
364
<KBD>C-c C-p</KBD> (<CODE>comint-previous-input</CODE>) <BR>
366
Moves point to the preceding command in the process buffer.
370
<KBD>C-c C-n</KBD> (<CODE>comint-next-input</CODE>) <BR>
372
Moves point to the next command in the process buffer.
376
Note that these two commands are analogous to <KBD>C-p</KBD> and <KBD>C-n</KBD>
377
but apply to command lines rather than text lines. And just like
378
<KBD>C-p</KBD> and <KBD>C-n</KBD>, passing a prefix argument to these commands
379
means to move to the <VAR>ARG</VAR>'th next (or previous) command. (These
380
commands are also discussed in section `Shell History Copying' in <CITE>The GNU Emacs Reference Manual</CITE>.)
384
There are also two similar commands (not bound to any keys by default)
385
which move to preceding or succeeding commands, but which first prompt
386
for a regular expression (see section `Syntax of Regular Expression' in <CITE>The GNU Emacs Reference Manual</CITE>), and then moves to
387
the next (previous) command matching the pattern.
392
<DT><U>Command:</U> <B>comint-backward-matching-input</B> <I>regexp arg</I>
393
<DD><A NAME="IDX79"></A>
394
<DT><U>Command:</U> <B>comint-forward-matching-input</B> <I>regexp arg</I>
395
<DD><A NAME="IDX80"></A>
396
Search backward (forward) through the transcript buffer for the
397
<VAR>arg</VAR>'th previous (next) command matching <VAR>regexp</VAR>. <VAR>arg</VAR>
398
is the prefix argument; <VAR>regexp</VAR> is prompted for in the minibuffer.
404
<H3><A NAME="SEC42" HREF="ess_toc.html#TOC42">Re-submitting commands from the transcript</A></H3>
407
When moving through the transcript, you may wish to re-execute some of
408
the commands you find there. ESS provides three commands to do this;
409
these commands may be used whenever the cursor is within a command line
410
in the transcript (if the cursor is within some command <EM>output</EM>,
411
an error is signaled). Note all three commands involve the <KBD>RETURN</KBD>
419
<KBD>RET</KBD> (<CODE>inferior-ess-send-input</CODE>) <BR>
421
Copy the command under the cursor to the current command line, and
426
<KBD>C-c RET</KBD> (<CODE>comint-copy-old-input</CODE>) <BR>
428
Copy the command under the cursor to the current command line, but don't
429
execute it. Leaves the cursor on the command line so that the copied
430
command may be edited.
434
<KBD>M-RET</KBD> (<CODE>ess-transcript-send-command-and-move</CODE>) <BR>
436
Copy the command under the cursor to the current command line, and
437
execute it. Moves the cursor to the following command.
441
When the cursor is not after the current prompt, the <KBD>RETURN</KBD> key
442
has a slightly different behavior than usual. Pressing <KBD>RET</KBD> on any
443
line containing a command that you entered (i.e. a line beginning with a
444
prompt) sends that command to the <B>ESS</B> process once again. If you
445
wish to edit the command before executing it, use <KBD>C-c RET</KBD> instead;
446
it copies the command to the current prompt but does not execute it,
447
allowing you to edit it before submitting it.
451
These two commands leave the cursor at the new command line, allowing
452
you to continue with interactive use of S. If you wish to resubmit a
453
series of commands from the transcript, consider using <KBD>M-RET</KBD>
454
instead, which leaves the cursor at the command line following the one
455
you re-submitted. Thus by using <KBD>M-RET</KBD> repeatedly, you can
456
re-submit a whole series of commands.
460
These commands work even if if the current line is a continuation line
461
(i.e. the prompt is <SAMP>`+'</SAMP> instead of <SAMP>`>'</SAMP>) -- in this case all
462
the lines that form the multi-line command are concatenated together and
463
the resulting command is sent to the <B>ESS</B> process (currently this is
464
the only way to resubmit a multi-line command to the <B>ESS</B> process in
465
one go). If the current line does
467
not begin with a prompt, an error is signaled. This feature, coupled
468
with the command-based motion commands described above, could be used as
469
a primitive history mechanism. ESS provides a more sophisticated
470
mechanism, however, which is described in section <A HREF="ess_6.html#SEC44">Command History</A>.
475
<H3><A NAME="SEC43" HREF="ess_toc.html#TOC43">Keeping a record of your <B>S</B> session</A></H3>
478
To keep a record of your <B>S</B> session in a disk file, use the Emacs
479
command <KBD>C-x C-w</KBD> (<CODE>write-file</CODE>) to attach a file to the
480
<B>ESS</B> process buffer. The name of the process buffer will (probably)
481
change to the name of the file, but this is not a problem. You can
482
still use <B>S</B> as usual; just remember to save the file before you quit
483
Emacs with <KBD>C-x C-s</KBD>. You can make ESS prompt you for a filename in
484
which to save the transcript every time you start <B>S</B> by setting the
487
<CODE>ess-ask-about-transfile</CODE> to <CODE>t</CODE>; see section <A HREF="ess_3.html#SEC16">Changing the startup actions</A>.
489
We recommend you save your transcripts with filenames that end in
490
<SAMP>`.St'</SAMP>. There is a special mode (ESS transcript mode ---
491
see section <A HREF="ess_9.html#SEC59">Manipulating saved transcript files</A>) for editing transcript files which is
492
automatically selected for files with this suffix.
497
S transcripts can get very large, so some judicious editing is
498
appropriate if you are saving it in a file. Use <KBD>C-c C-o</KBD> whenever
499
a command produces excessively long output (printing large arrays, for
500
example). Delete erroneous commands (and the resulting error messages
501
or other output) by moving to the command (or its output) and typing
502
<KBD>M-h C-w</KBD>. Also, remember that <KBD>C-c C-e</KBD> (and other hot keys)
503
may be used for commands whose output you do not wish to appear in the
504
transcript. These suggestions are appropriate even if you are not
505
saving your transcript to disk, since the larger the transcript, the
506
more memory your Emacs process will use on the host machine.
510
Finally, if it is your intention to produce <B>S</B> source code (suitable
511
for using with <CODE>source()</CODE> or inclusion in an <B>S</B> function) from a
512
transcript, then the command <KBD>M-x ess-clean-region</KBD> may be of use.
514
This command works in any Emacs buffer, and removes all prompts and
515
command output from an ESS transcript within the current region, leaving
516
only the commands. Don't forget to remove any erroneous commands first!
521
<H2><A NAME="SEC44" HREF="ess_toc.html#TOC44">Command History</A></H2>
529
ESS provides easy-to-use facilities for re-executing or editing previous
530
commands. An input history of the last few commands is maintained (by
531
default the last 50 commands are stored, although this can be changed by
532
setting the variable <CODE>comint-input-ring-size</CODE> in
534
<CODE>inferior-ess-mode-hook</CODE>.) The simplest history commands simply
535
select the next and previous commands in the input history:
542
<KBD>M-p</KBD> (<CODE>comint-previous-input</CODE>) <BR>
544
Select the previous command in the input history.
548
<KBD>M-n</KBD> (<CODE>comint-next-input</CODE>) <BR>
550
Select the next command in the input history.
554
For example, pressing <KBD>M-p</KBD> once will re-enter the last command into
555
the process buffer after the prompt but does not send it to the <B>ESS</B>
556
process, thus allowing editing or correction of the command before the
557
<B>ESS</B> process sees it. Once corrections have been made, press
558
<KBD>RET</KBD> to send the edited command to the <B>ESS</B> process.
562
If you want to select a particular command from the history by matching
563
it against a regular expression (see section `Syntax of Regular Expression' in <CITE>The GNU Emacs Reference Manual</CITE>), to search for a
564
particular variable name for example, these commands are also available:
571
<KBD>M-r</KBD> (<CODE>comint-previous-matching-input</CODE>) <BR>
573
Prompt for a regular expression, and search backwards through the input
574
history for a command matching the expression.
578
<KBD>M-s</KBD> (<CODE>comint-next-matching-input</CODE>) <BR>
580
Prompt for a regular expression, and search backwards through the input
581
history for a command matching the expression.
585
A common type of search is to find the last command that began with a
586
particular sequence of characters; the following two commands provide an
594
<KBD>A-M-r</KBD> (<CODE>comint-previous-matching-input-from-input</CODE>) <BR>
596
Select the previous command in the history which matches the string
601
<KBD>A-M-s</KBD> (<CODE>comint-next-matching-input-from-input</CODE>) <BR>
603
Select the next command in the history which matches the string typed so
608
Instead of prompting for a regular expression to match against, as they
609
instead select commands starting with those characters already entered.
610
For instance, if you wanted to re-execute the last <CODE>attach()</CODE>
611
command, you may only need to type <KBD>att</KBD> and then <KBD>A-M-r</KBD> and
612
<KBD>RET</KBD>. (Note: you may not have an <KBD>ALT</KBD> key on your keyboard,
613
in which case it may be a good idea to bind these commands to some other
618
See section `Shell History Ring' in <CITE>The GNU Emacs Reference Manual</CITE>, for a more detailed discussion of the history mechanism.
623
<H2><A NAME="SEC45" HREF="ess_toc.html#TOC45">References to historical commands</A></H2>
626
Instead of searching through the command history using the command
627
described in the previous section, you can alternatively refer to a
628
historical command directly using a notation very similar to that used
629
in <CODE>csh</CODE>. History references are introduced by a <SAMP>`!'</SAMP> or
630
<SAMP>`^'</SAMP> character and have meanings as follows:
635
<DT><SAMP>`!!'</SAMP>
637
The immediately previous command
639
<DT><SAMP>`!-<VAR>N</VAR>'</SAMP>
641
The <VAR>N</VAR>th previous command
643
<DT><SAMP>`!text'</SAMP>
645
The last command beginning with the string <SAMP>`text'</SAMP>
647
<DT><SAMP>`!?text'</SAMP>
649
The last command containing the string <SAMP>`text'</SAMP>
653
In addition, you may follow the reference with a <EM>word designator</EM>
654
to select particular <EM>words</EM> of the input. A word is defined as a
655
sequence of characters separated by whitespace. (You can modify this
656
definition by setting the value of <CODE>comint-delimiter-argument-list</CODE>
657
to a list of characters that are allowed to separate words and
659
themselves form words.) Words are numbered beginning with zero. The
660
word designator usually begins with a <SAMP>`:'</SAMP> (colon) character;
661
however it may be omitted if the word reference begins with a <SAMP>`^'</SAMP>,
662
<SAMP>`$'</SAMP>, <SAMP>`*'</SAMP> or <SAMP>`-'</SAMP>. If the word is to be selected from the
663
previous command, the second <SAMP>`!'</SAMP> character can be omitted from the
664
event specification. For instance, <SAMP>`!!:1'</SAMP> and <SAMP>`!:1'</SAMP> both
665
refer to the first word of the previous command, while <SAMP>`!!$'</SAMP> and
666
<SAMP>`!$'</SAMP> both refer to the last word in the previous command. The
667
format of word designators is as follows:
674
The zeroth word (i.e. the first one on the command line)
676
<DT><SAMP>`<VAR>n</VAR>'</SAMP>
678
The <VAR>n</VAR>th word, where <VAR>n</VAR> is a number
682
The first word (i.e. the second one on the command line)
688
<DT><SAMP>`<VAR>x</VAR>-<VAR>y</VAR>'</SAMP>
690
A range of words; <SAMP>`-<VAR>y</VAR>'</SAMP> abbreviates <SAMP>`0-<VAR>y</VAR>'</SAMP>
694
All the words except the zeroth word, or nothing if the command had just
695
one word (the zeroth)
697
<DT><SAMP>`<VAR>x</VAR>*'</SAMP>
699
Abbreviates <VAR>x</VAR>-$
701
<DT><SAMP>`<VAR>x</VAR>-'</SAMP>
703
Like <SAMP>`<VAR>x</VAR>*'</SAMP>, but omitting the last word
707
In addition, you may surround the entire reference except for the first
708
<SAMP>`!'</SAMP> by braces to allow it to be followed by other (non-whitespace)
709
characters (which will be appended to the expanded reference).
713
Finally, ESS also provides quick substitution; a reference like
714
<SAMP>`^old^new^'</SAMP> means "the last command, but with the first occurrence
715
of the string <SAMP>`old'</SAMP> replaced with the string <SAMP>`new'</SAMP>" (the last
716
<SAMP>`^'</SAMP> is optional). Similarly, <SAMP>`^old^'</SAMP> means "the last
717
command, with the first occurrence of the string <SAMP>`old'</SAMP> deleted"
718
(again, the last <SAMP>`^'</SAMP> is optional).
722
To convert a history reference as described above to an input suitable
723
for S, you need to <EM>expand</EM> the history reference, using the
724
<KBD>TAB</KBD> key. For this to work, the cursor must be preceded by a space
725
(otherwise it would try to complete an object name) and not be within a
726
string (otherwise it would try to complete a filename). So to expand
727
the history reference, type <KBD>SPC TAB</KBD>. This will convert the
728
history reference into an <B>S</B> command from the history, which you can
729
then edit or press <KBD>RET</KBD> to execute.
733
For example, to execute the last command that referenced the variable
734
<CODE>data</CODE>, type <KBD>!?data SPC TAB RET</KBD>.
739
<H2><A NAME="SEC46" HREF="ess_toc.html#TOC46">Hot keys for common commands</A></H2>
742
ESS provides a number of commands for executing the commonly used
743
functions. These commands below are basically information-gaining
744
commands (such as <CODE>objects()</CODE> or <CODE>search()</CODE>) which tend to
745
clutter up your transcript and for this reason some of the hot keys
746
display their output in a temporary buffer instead of the process buffer
747
by default. This behavior is controlled by the variable
748
<CODE>ess-execute-in-process-buffer</CODE> which, if
749
<A NAME="IDX100"></A>
750
non-<CODE>nil</CODE>, means that these commands will produce their output in
751
the process buffer instead. In any case, passing a prefix argument to
752
the commands (with <KBD>C-u</KBD>) will reverse the meaning of
753
<CODE>ess-execute-in-process-buffer</CODE> for that command, i.e. the output
754
will be displayed in the process buffer if it usually goes to a
755
temporary buffer, and vice-versa. These are the hot keys that behave in
763
<KBD>C-c C-x</KBD> (<CODE>ess-execute-objects</CODE>) <BR>
764
<A NAME="IDX101"></A>
765
Sends the <CODE>objects()</CODE>
766
<A NAME="IDX102"></A>
767
command to the <B>ESS</B> process. A prefix argument specifies the
768
position on the search list (use a negative argument to toggle
769
<CODE>es-execute-in-process-buffer</CODE> as well). A quick way to see what
770
objects are in your working directory.
771
<A NAME="IDX103"></A>
772
<A NAME="IDX104"></A>
776
<KBD>C-c C-s</KBD> (<CODE>ess-execute-search</CODE>) <BR>
777
<A NAME="IDX105"></A>
778
Sends the <CODE>search()</CODE>
779
<A NAME="IDX106"></A>
780
command to the ESS process.
781
<A NAME="IDX107"></A>
782
<A NAME="IDX108"></A>
786
<KBD>C-c C-e</KBD> (<CODE>ess-execute</CODE>) <BR>
787
<A NAME="IDX109"></A>
788
Prompt for an ESS expression, and evaluate it.
792
<CODE>ess-execute</CODE> may seem pointless when you could just type the
793
command in anyway, but it proves useful for `spot' calculations which
794
would otherwise clutter your transcript, or for evaluating an expression
795
while partway through entering a command. You can also use this command
796
to generate new hot keys using the Emacs keyboard macro facilities;
797
see section `Keyboard Macros' in <CITE>The GNU Emacs Reference Manual</CITE>.
798
<A NAME="IDX110"></A>
799
<A NAME="IDX111"></A>
803
The following hot keys do not use <CODE>ess-execute-in-process-buffer</CODE>
804
to decide where to display the output -- they either always display in
805
the process buffer or in a separate buffer, as indicated:
812
<KBD>C-c C-a</KBD> (<CODE>ess-execute-attach</CODE>) <BR>
813
<A NAME="IDX112"></A>
814
Prompts for a directory to attach to the ESS process with the
815
<CODE>attach()</CODE> command.
816
<A NAME="IDX113"></A>
817
If a numeric prefix argument is given it is used as the position on the
818
search list to attach the directory; otherwise the <B>S</B> default of 2 is
819
used. The <CODE>attach()</CODE> command actually executed appears in the
824
<KBD>C-c C-l</KBD> (<CODE>ess-load-file</CODE>) <BR>
825
<A NAME="IDX114"></A>
826
Prompts for a file to load into the <B>ESS</B> process using
827
<CODE>source()</CODE>. If there is an error during loading, you can jump to
828
the error in the file with <KBD>C-x `</KBD> (<CODE>ess-parse-errors</CODE>).
829
<A NAME="IDX115"></A>
830
See section <A HREF="ess_7.html#SEC52">Detecting errors in source files</A>, for more details.
834
<KBD>C-c C-v</KBD> (<CODE>ess-display-help-on-object</CODE>) <BR> Pops up a help
835
buffer for an <B>S</B> object or function. See section <A HREF="ess_8.html#SEC58">Reading help files in ESS</A> for more
840
<KBD>C-c C-q</KBD> (<CODE>ess-quit</CODE>) <BR>
841
<A NAME="IDX116"></A>
842
<A NAME="IDX117"></A>
843
Sends the <CODE>q()</CODE>
844
<A NAME="IDX118"></A>
845
command to the <B>ESS</B> process (or <CODE>(exit)</CODE>
846
<A NAME="IDX119"></A>
847
to the <B>XLS</B> process), and cleans up any temporary buffers (such as
848
help buffers or edit buffers) you may have created along the way. Use
849
this command when you have finished your <B>S</B> session instead of simply
850
typing <CODE>q()</CODE> yourself, otherwise you will need to issue the command
851
<KBD>M-x ess-cleanup</KBD>
852
<A NAME="IDX120"></A>
853
<A NAME="IDX121"></A>
854
<A NAME="IDX122"></A>
855
<A NAME="IDX123"></A>
856
command explicitly to make sure that all the files that need to be saved
857
have been saved, and that all the temporary buffers have been killed.
862
<H2><A NAME="SEC47" HREF="ess_toc.html#TOC47">Is the Statistical Process running under ESS?</A></H2>
865
<A NAME="IDX124"></A>
866
<A NAME="IDX125"></A>
867
For the S languages (S, S-Plus, R) ESS sets an option in the current
868
process that programs in the language can check to determine the
869
environment in which they are currently running.
874
<CODE>options(STERM="iESS")</CODE> for S language processes running in an
875
inferior <CODE>iESS[S]</CODE> or <CODE>iESS[R]</CODE> buffer.
880
<CODE>options(STERM="ddeESS")</CODE> for independent S-Plus for Windows
881
processes running in the GUI and communicating with ESS via
882
the DDE (Microsoft Dynamic Data Exchange) protocol through a
883
<CODE>ddeESS[S]</CODE> buffer.
887
Other values of <CODE>options()$STERM</CODE> that we recommend are:
892
<LI><CODE>length</CODE>: Fixed length xterm or telnet window.
894
<LI><CODE>scrollable</CODE>: Unlimited length xterm or telnet window.
896
<LI><CODE>server</CODE>: S-Plus Stat Server.
898
<LI><CODE>BATCH</CODE>: BATCH.
900
<LI><CODE>Rgui</CODE>: R GUI.
902
<LI><CODE>Commands</CODE>: S-Plus GUI without DDE interface to ESS.
907
Additional values may be recommended in the future as new interaction
908
protocols are created. Unlike the values <CODE>iESS</CODE> and <CODE>ddeESS</CODE>,
909
ESS can't set these other values since the S language program is not
910
under the control of ESS.
915
<H2><A NAME="SEC48" HREF="ess_toc.html#TOC48">Other commands provided by inferior-ESS</A></H2>
918
The following commands are also provided in the process buffer:
925
<KBD>C-c C-c</KBD> (<CODE>comint-interrupt-subjob</CODE>) <BR>
926
<A NAME="IDX126"></A>
927
Sends a Control-C signal to the <B>ESS</B> process. This has the effect of
928
<A NAME="IDX127"></A>
929
<A NAME="IDX128"></A>
930
aborting the current command.
934
<KBD>C-c C-z</KBD> (<CODE>ess-abort</CODE>) <BR>
935
<A NAME="IDX129"></A>
936
<A NAME="IDX130"></A>
937
Sends a STOP signal to the <B>ESS</B> process, killing it immediately.
938
It's not a good idea to use this, in general: Neither <CODE>q()</CODE> nor
939
<CODE>.Last</CODE> will be executed and device drivers will not finish
940
cleanly. This command is provided as a safety to
941
<CODE>comint-stop-subjob</CODE>, which is usually bound to <KBD>C-c C-z</KBD>. If
942
you want to quit from S, use <KBD>C-c C-q</KBD> (<CODE>ess-quit</CODE>) instead.
943
<A NAME="IDX131"></A>
944
<A NAME="IDX132"></A>
948
<KBD>C-c C-d</KBD> (<CODE>ess-dump-object-into-edit-buffer</CODE>) <BR>
949
<A NAME="IDX133"></A>
950
Prompts for an object to be edited in an edit buffer. See section <A HREF="ess_7.html#SEC49">Editing <B>S</B> functions</A>.
954
Other commands available is Inferior <B>S</B> mode are discussed in
955
section `Shell Mode' in <CITE>The Gnu Emacs Reference Manual</CITE>.
959
Go to the <A HREF="ess_1.html">first</A>, <A HREF="ess_5.html">previous</A>, <A HREF="ess_7.html">next</A>, <A HREF="ess_16.html">last</A> section, <A HREF="ess_toc.html">table of contents</A>.