Prevent Emacs from Killing R Window

View: New views
5 Messages — Rating Filter:   Alert me  

Prevent Emacs from Killing R Window

by Aric Gregson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

Thanks for any suggestions.

aric

______________________________________________
ESS-help@... mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help

Re: Prevent Emacs from Killing R Window

by leon-9 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2009-03-03 23:11 +0000, 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.
>
> Thanks for any suggestions.
>
> aric

emacs-lock.el in emacs/lisp directory does what you want. But generally
you don't need it. My Emacs asks me before killing any process or
unsaved file.

Best,
--
.:  Leo  :.  [ sdl.web AT gmail.com ]  .: I use Emacs :.

______________________________________________
ESS-help@... mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help

Re: Prevent Emacs from Killing R Window

by Charles C. Berry :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

HTH,

Chuck

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

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

______________________________________________
ESS-help@... mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help

Re: Prevent Emacs from Killing R Window

by Aric Gregson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--On March 3, 2009 6:48:19 PM -0800 "Charles C. Berry"
<cberry@...> wrote:

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

Thanks very much. I'll look into the Disable command as I have the same
issue. It is most inconvenient to accidentally close your R session.

Aric

______________________________________________
ESS-help@... mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help

Re: Prevent Emacs from Killing R Window

by Ottorino-Luca Pantani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Aric Gregson ha scritto:
> 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.
> Thanks for any suggestions.
> aric
Hi Aric,
quite the same situation here.

When I kill the R buffer (C-x-k), emacs asks if I really want to.
If I kill the R buffer through the button on the toolbar, emacs kill it
without asking.
And this is very inconvenient, since you do not always check in which
window the cursor is.
As indicated by Leo and Chrales, I tried to play with emacs-lock.el, but
it seems ineffective on the behaviour of that "white X on red field"
button.
Any idea ?


--
Ottorino-Luca Pantani, Università di Firenze
Dip. Scienza del Suolo e Nutrizione della Pianta
P.zle Cascine 28 50144 Firenze Italia
Tel 39 055 3288 202 (348 lab) Fax 39 055 333 273
OLPantani@...  http://www4.unifi.it/dssnp/

______________________________________________
ESS-help@... mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help