4

Emacs 24.3 had a nice way of inserting text into rectangles:

  1. Select rectangle.

  2. C-x r t <string-to-be-inserted> RET

This doesn't seem to work in Emacs 24.4. I tried rectangle-mark-mode using C-x SPC. I could managed to insert a yanked rectangle, but how does one insert fresh text into the rectangle?

Thanks in advance!

12
  • 1
    I'm on Emacs 24.4 and C-x r t works fine for me for inserting fresh text. Start Emacs via emacs -Q (which will keep your personal configuration from being loaded) and try again. Does it work?
    – itsjeyd
    Commented Feb 27, 2015 at 12:24
  • @itsjeyd... thanks! emacs -q seems to have the keys working fine... I wonder what has been causing issues in my .emacs file. Nevertheless, I would be interested to know how it could be done through rectangle-mark-mode.
    – deejay
    Commented Feb 27, 2015 at 13:12
  • rectangle-mark-mode is a fairly young feature; it was introduced in Emacs 24.4. The NEWS file says: "New command C-x SPC (rectangle-mark-mode) makes a rectangular region. Most commands are still unaware of it, but kill/yank do work on the rectangle." Based on this I assume what you are trying to do is not possible (yet) with rectangle-mark-mode. You might want to look into cua-mode (built-in) or multiple-cursors.
    – itsjeyd
    Commented Feb 27, 2015 at 13:27
  • As for debugging your .emacs file, the following method can help you identify problematic code quickly: Recursively bisect your .emacs: Comment out half of it and restart Emacs. If you can reproduce the problem, the code that's causing it is in the portion of your init-file that's not commented out (and vice versa). Repeat the process for the portion of the code that you know is causing the issue: Comment out half of it, restart, check for problem. Keep going until you've narrowed the problem down to a few lines; this shouldn't take too long.
    – itsjeyd
    Commented Feb 27, 2015 at 13:33
  • (contd.) If you can't figure out why the code you've isolated is causing the issue, add it to your question so we can have a look at it.
    – itsjeyd
    Commented Feb 27, 2015 at 13:34

1 Answer 1

8

C-x r t should still work in 24.4 just as in 24.3.

You can get the same functionality from C-x SPC by hitting C-t after you've selected the rectangle of interest.

1
  • Excellent! That works out of the box! Thanks dude!
    – deejay
    Commented Mar 2, 2015 at 9:11

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.