User manual
Chapter 4: Interacting with the ESS process 25
4 Interacting with the ESS process
The primary function of the ESS package is to provide an easy-to-use front end to the S
interpreter. This is achieved by running the S process from within an Emacs buffer, called
hereafter inferior buffer, which has an active inferior-ess-mode. The features of Inferior
S mode are similar to those provided by the standard Emacs shell mode (see Section “Shell
Mode” in The Gnu Emacs Reference Manual). Command-line completion of S objects and
a number of ‘hot keys’ for commonly-used S commands are also provided for ease of typing.
4.1 Entering commands and fixing mistakes
Sending a command to the ESS process is as simple as typing it in and pressing the RETURN
key:
[Command]inferior-ess-send-input
RET Send the command on the current line to the ESS process.
If you make a typing error before pressing RET all the usual Emacs editing commands are
available to correct it (see Section “Basic editing commands” in The GNU Emacs Reference
Manual). Once the command has been corrected you can press RETURN (even if the cursor
is not at the end of the line) to send the corrected command to the ESS process.
Emacs provides some other commands which are useful for fixing mistakes:
C-c C-w backward-kill-word Deletes the previous word (such as an object name) on
the command line.
C-c C-u comint-kill-input Deletes everything from the prompt to point. Use this to
abandon a command you have not yet sent to the ESS process.
C-c C-a comint-bol Move to the beginning of the line, and then skip forwards past the
prompt, if any.
See Section “Shell Mode” in The Gnu Emacs Reference Manual, for other commands
relevant to entering input.
4.2 Manipulating the transcript
Most of the time, the cursor spends most of its time at the bottom of the ESS process buffer,
entering commands. However all the input and output from the current (and previous) ESS
sessions is stored in the process buffer (we call this the transcript) and often we want to move
back up through the buffer, to look at the output from previous commands for example.
Within the process buffer, a paragraph is defined as the prompt, the command after the
prompt, and the output from the command. Thus M-{ and M-} move you backwards and
forwards, respectively, through commands in the transcript. A particularly useful command
is M-h (mark-paragraph) which will allow you to mark a command and its entire output
(for deletion, perhaps). For more information about paragraph commands, see Section
“Paragraphs” in The GNU Emacs Reference Manual.
If an ESS process finishes and you restart it in the same process buffer, the output from
the new ESS process appears after the output from the first ESS process separated by a
form-feed (‘^L’) character. Thus pages in the ESS process buffer correspond to ESS sessions.










