[ESS] Prevent Emacs from Killing R Window

Charles C. Berry cberry at tajo.ucsd.edu
Wed Mar 4 03:48:19 CET 2009

On Tue, 3 Mar 2009, Aric Gregson wrote:

> Just wondering if there is a way to get ESS to require a confirmation
> prior to killing a buffer that is running R? I just lost 3 hours of
> workspace by hitting the wrong key combination. Fortunately, the work
> is scripted, but this is very inconvenient.

Yes. 'Disabling' the command. In the emacs info:

57.4.10 Disabling Commands

Disabling a command means that invoking it interactively asks for
confirmation from the user.  The purpose of disabling a command is to
prevent users from executing it by accident; we do this for commands
that might be confusing to the uninitiated.

Attempting to invoke a disabled command interactively in Emacs
displays a window containing the command's name, its documentation, and
some instructions on what to do immediately; then Emacs asks for input
saying whether to execute the command as requested, enable it and
execute it, or cancel.  If you decide to enable the command, you must
then answer another question--whether to do this permanently, or just
for the current session.  (Enabling permanently works by automatically
editing your `.emacs' file.)  You can also type `!' to enable _all_
commands, for the current session only.


You can make a command disabled either by editing the `.emacs' file
directly, or with the command `M-x disable-command', which edits the
`.emacs' file for you.  Likewise, `M-x enable-command' edits `.emacs'
to enable a command permanently.  *Note Init File::.


I disable a bunch of commands that have keystrokes that my clumsy fingers 
often inadvertently type.



> Thanks for any suggestions.
> aric
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901

More information about the ESS-help mailing list