diff --git a/qe.c b/qe.c index df1bb8d..58b04f2 100644 --- a/qe.c +++ b/qe.c @@ -1349,9 +1349,12 @@ void do_quote(EditState *s, int argval) put_status(s, "Quote: "); } -void do_insert(EditState *s) +void do_overwrite_mode(EditState *s, int argval) { - s->insert = !s->insert; + if (argval == NO_ARG) + s->insert = !s->insert; + else + s->insert = !argval; } void do_tab(EditState *s, int argval) diff --git a/qe.h b/qe.h index a6d263c..3d3bb04 100644 --- a/qe.h +++ b/qe.h @@ -1668,7 +1668,7 @@ void do_scroll_up_down(EditState *s, int dir); void perform_scroll_up_down(EditState *s, int h); void do_center_cursor(EditState *s); void do_quote(EditState *s, int argval); -void do_insert(EditState *s); +void do_overwrite_mode(EditState *s, int argval); // should take argval void do_set_mark(EditState *s); void do_mark_whole_buffer(EditState *s); diff --git a/qeconfig.h b/qeconfig.h index 6e848fd..afe135d 100644 --- a/qeconfig.h +++ b/qeconfig.h @@ -2,7 +2,7 @@ * QEmacs, tiny but powerful multimode editor * * Copyright (c) 2000,2001 Fabrice Bellard. - * Copyright (c) 2000-2008 Charlie Gordon. + * Copyright (c) 2000-2014 Charlie Gordon. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -56,8 +56,10 @@ static CmdDef basic_commands[] = { "beginning-of-line", do_bol) CMD0( KEY_CTRL('e'), KEY_END, "end-of-line", do_eol) - CMD0( KEY_INSERT, KEY_NONE, - "overwrite-mode", do_insert) + CMD2( KEY_INSERT, KEY_NONE, + "overwrite-mode", do_overwrite_mode, ESi, "ui") + CMD3( KEY_NONE, KEY_NONE, + "insert-mode", do_overwrite_mode, ESi, 0, "v") /* deletion commands should be allowed in read only buffers, * they should merely copy the data to the kill ring */ CMD2( KEY_CTRL('d'), KEY_DELETE,