3

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}'?

Drew
  • 75,699
  • 9
  • 109
  • 225
João Pedro
  • 185
  • 6
  • 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 Dec 14 '17 at 18:54

1 Answers1

5

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.

Drew
  • 75,699
  • 9
  • 109
  • 225
  • This does not work for me. There is no change if I press ``, and `-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 May 20 '20 at 07:54
  • I've rebound to another key in Xmodmap. My computer doesn't have an key. Yet somehow, emacs magically switches to overwrite mode every now and then. Something else is causing the bug. – Zendel Apr 01 '21 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 Apr 01 '21 at 15:17
  • It tells me that it's mapped to the 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 Apr 07 '21 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 Apr 08 '21 at 00:08