[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7. Other features of ESS

ESS has a few miscellaneous features, which didn't fit anywhere else.

7.1 Syntactic highlighting of buffers  
7.2 Using graphics with ESS  
7.3 Object Completion  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.1 Syntactic highlighting of buffers

ESS provides Font-Lock (see section `Using Multiple Typefaces' in The Gnu Emacs Reference Manual) patterns for Inferior S Mode, S Mode, and S Transcript Mode buffers.

To activate the highlighting, you need to turn on Font Lock mode in the appropriate buffers. This can be done on a per-buffer basis with M-x font-lock-mode, or may be done by adding turn-on-font-lock to inferior-ess-mode-hook, ess-mode-hook and ess-transcript-mode-hook (see section B.2 Customizing ESS with hooks). Your systems administrator may have done this for you in `ess-site.el' (see section B. Customizing ESS).

The font-lock patterns are defined in three variables, which you may modify if desired:

Variable: ess-inf-font-lock-keywords
Font-lock patterns for Inferior ESS Mode. The default value highlights prompts, inputs, assignments, output messages, vector and matrix labels, and literals such as `NA' and TRUE.

Variable: ESS-font-lock-keywords
Font-lock patterns for ESS programming mode. The default value highlights function names, literals, assignments, source functions and reserved words.

Variable: ess-trans-font-lock-keywords
Font-lock patterns for ESS Transcript Mode. The default value highlights the same stuff as in Inferior ESS Mode.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.2 Using graphics with ESS

One of the main features of the S package is its ability to generate high-resolution graphics plots, and ESS provides a number of features for dealing with such plots.

7.2.1 Using ESS with the printer() driver  The printer() graphics driver
7.2.2 Using ESS with windowing devices  The X11() (and other X-windows based) driver


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.2.1 Using ESS with the printer() driver

This is the simplest (and least desirable) method of using graphics within ESS. S's printer() device driver produces crude character based plots which can be contained within the ESS process buffer itself. To start using character graphics, issue the S command
 
printer(width=79)
(the width=79 argument prevents Emacs line-wrapping at column 80 on an 80-column terminal. Use a different value for a terminal with a different number of columns.) Plotting commands do not generate graphics immediately, but are stored until the show() command is issued, which displays the current figure.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.2.2 Using ESS with windowing devices

Of course, the ideal way to use graphics with ESS is to use a windowing system. Under X windows, this requires that the DISPLAY environment variable be appropriately set, which may not always be the case within your Emacs process. ESS provides a facility for setting the value of DISPLAY before the ESS process is started if the variable ess-ask-about-display is non-nil. See section B. Customizing ESS, for details of this variable, and see section 2. Starting the ESS process for information on how to set the value of DISPLAY when beginning an S session.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.3 Object Completion

If you are running S-PLUS or R, you might consider installing the database files. From within (X)Emacs, "C-x d" to the directory containing ESS. Now:

M-x S+3

(get S-PLUS running. once you have reached the SPLUS 3.x prompt, do:)

M-x ess-create-object-name-db

(this will create the file: ess-s+3-namedb.el; if it isn't in the ESS directory, move it there).

Then, completions will be autoloaded and will not be regenerated for every session.

For R:

M-x R

(get R running. once you have reached the R prompt, do:)

M-x ess-create-object-name-db

(this will create the file: ess-r-namedb.el; if it isn't in the ESS directory, move it there).


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Camm Maguire on March, 4 2002 using texi2html