In this example:

enter image description here

If I add for example '0.5' where the cursor is, instead of adding '0.5' while moving the remaining text to the right, Emacs will delete the part '}{ckt1}' while adding '0.5'. Is it possible to avoid it so that when the cursor is in that position and I type 0.5 the result be just '[width=0.5]{ckt1}'?

  • 2
    What you're describing is not normal behaviour. It should do what you want by default. Can you reproduce the problem after starting emacs with emacs -Q?
    – Tyler
    Commented Dec 14, 2017 at 18:54

1 Answer 1


Hit the <insert> key to toggle inserting vs overwriting.

C-h k <insert> tells you:

<insert> runs the command overwrite-mode, which is an interactive compiled Lisp function in simple.el.

It is bound to insertchar, insert.

(overwrite-mode &optional ARG)

Toggle Overwrite mode.

With a prefix argument ARG, enable Overwrite mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil.

When Overwrite mode is enabled, printing characters typed in replace existing text on a one-for-one basis, rather than pushing it to the right. At the end of a line, such characters extend the line. Before a tab, such characters insert until the tab is filled in. M-x quoted-insert still inserts characters in overwrite mode; this is supposed to make it easier to insert characters when necessary.

See the Emacs manual, node Minor Modes.

  • This does not work for me. There is no change if I press <insert>, and <Esc>-x overwrite-mode does not work either. It keeps on overwriting. I recently changed to zsh, not sure if that could cause this problem..
    – oddvarsen
    Commented May 20, 2020 at 7:54
  • I've rebound <insert> to another key in Xmodmap. My computer doesn't have an <insert> key. Yet somehow, emacs magically switches to overwrite mode every now and then. Something else is causing the bug.
    – Zendel
    Commented Apr 1, 2021 at 13:15
  • @Zendel: What does C-h w overwrite-mode tell you? It should tell you of any keys that are bound to that command. If none are bound to it then bisect your init file to find out what code you load might be invoking the command.
    – Drew
    Commented Apr 1, 2021 at 15:17
  • It tells me that it's mapped to the <insert> key. A key that has been disabled in Xmodmap. I suppose there could be a bug in X11. But really, it would be wonderful to just disable to behaviour in emacs period. Just tell emacs: NO!
    – Zendel
    Commented Apr 7, 2021 at 23:24
  • It sounds like Emacs is still seeing that key. I can't speak to what Xmodmap does or should do. Hopefully someone else can speak to that.
    – Drew
    Commented Apr 8, 2021 at 0:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.