Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6942791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:04:15+00:00 2026-05-27T13:04:15+00:00

In Emacs, I sometimes want to kill or copy a rectangle of text such

  • 0

In Emacs, I sometimes want to kill or copy a rectangle of text such as this one:

XX first line
XX second line is longer
XX 3rd line short

I want to copy the three lines without the leading “XX” on every line. However, it is impossible to mark both corners of the required rectangle, because the first and third lines do not reach to the right edge of the rectangle that I’m after. So how would I copy the three lines above without the leading “XX” in emacs?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:04:15+00:00Added an answer on May 27, 2026 at 1:04 pm

    Start marking the rectangle from the first line and when you are at the end of the 3d line then just type spaces until the line is long enough. That’s what I usually do.

    After copying you can type M-\ (delete-horizontal-space) to remove the added spaces.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sometimes I'd like to copy only the visible text from an outline-mode buffer in
Sometimes I launch emacs from the command line with 2 files, as follows: emacs
I think this is one of those vi vs. emacs type of questions, but
I am a fervent user of Emacs, but i switch sometimes on Sublime Text
Emacs seems to save synchronously, i.e. the interface locks up during a save. This
In emacs, after an operation such as comment-region , the selected region is automatically
I am just starting out in in Emacs. Sometimes I'll be experimenting with something
I've been getting my hands wet with emacs lisp, and one thing that trips
I sometimes want to make small edits to small file from within the shell
This is a follow up to How do I bind latexmk to one key

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.