User manual

Chapter 7: Editing objects and functions 40
(defun myindent-ess-hook ()
(setq ess-indent-level 4))
(add-hook ’ess-mode-hook ’myindent-ess-hook)
In the rare case that you’d like to add an entire new indentation style of your own, copy
the definition of ess-own-style-list to a new variable and ensure that the last line of
the :set declaration calls ess-add-style with a unique name for your style (e.g. ’MINE).
Finally, add (setq ess-default-style ’MINE) to use your new style.
7.5 Commands for motion, completion and more
A number of commands are provided to move across function definitions in the edit buffer:
[Command]ess-goto-beginning-of-function-or-para
ESC C-a aka C-M-a If inside a function go to the beginning of it, otherwise go to the
beginning of paragraph.
[Command]ess-goto-end-of-function-or-para
ESC C-e aka C-M-e Move point to the end of the function containing point.
[Command]ess-mark-function
ESC C-h aka C-M-h Place point at the beginning of the S function containing point,
and mark at the end.
Don’t forget the usual Emacs commands for moving over balanced expressions and paren-
theses: See Section “Lists and Sexps” in The GNU Emacs Reference Manual.
Completion is provided in the edit buffer in a similar fashion to the process buffer: TAB
first indents, and if there is nothing to indent, completes the object or file name; M-? lists
file completions. See See Chapter 9 [Completion], page 46, for more.
Finally, C-c C-z (ess-switch-to-inferior-or-script-buffer) returns you to the
iESS process buffer, if done from a script buffer, placing point at the end of the buffer.
If this is done from the iESS process buffer, point is taken to the script buffer.
In addition some commands available in the process buffer are also available in the script
buffer. You can still read help files with C-c C-v, edit another function with C-c C-e C-d
and of course C-c C-l can be used to load a source file into S.
7.6 Maintaining S source files
Every edit buffer in ESS is associated with a dump file on disk. Dump files are created
whenever you type C-c C-e C-d (ess-dump-object-into-edit-buffer), and may either
be deleted after use, or kept as a backup file or as a means of keeping several versions of an
S function.
[User Option]ess-delete-dump-files
If non-nil, dump files created with C-c C-e C-d are deleted immediately after they
are created by the ess-process.
Since immediately after S dumps an object’s definition to a disk file the source code
on disk corresponds exactly to S’s idea of the object’s definition, the disk file isn’t needed;
deleting it now has the advantage that if you don’t modify the file (say, because you just