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 8748261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:29:40+00:00 2026-06-13T12:29:40+00:00

I often encounter situations in editing text or code where I want to insert

  • 0

I often encounter situations in editing text or code where I want to insert a rectangle of spaces to align things, but I don’t know exactly the number of spaces to insert.

For example, consider the following (very much contrived) snippet:

void *var = (void *)typedVar;
void *otherVar = voidStarOtherVar;
int intVar = x*y;
int intVar2 = y*z;

In default C-mode, M-x align results in this, which is better:

void *var      = (void *)typedVar;
void *otherVar = voidStarOtherVar;
int   intVar   = x*y;
int   intVar2  = y*z;

However, suppose my desired alignment (for some reason) is this:

void *var      = (void *)typedVar;
void *otherVar =         voidStarOtherVar;
int   intVar   =         x*y;
int   intVar2  =         y*z;

The only way I know to do that is with M-x string-rectangle on the bottom three lines, and type in the exact number of spaces.

However, I don’t want to count the number of characters in (void *) before typing in the spaces, thus it would be nice to have an “interactive” rectangle string insert. For example, I type a space in this interactive mode, and I see it reflected immediately in the text. I enter another space, and it is inserted. In this way I can interactively align the text to my desired position.

Is there a built-in way to accomplish this? Or, failing that, can I create this functionality somehow?

  • 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-06-13T12:29:41+00:00Added an answer on June 13, 2026 at 12:29 pm

    Open rectangle may be useful for your example:

    C-x r o' Insert blank space to fill the space of the region-rectangle
    (
    open-rectangle’). This pushes the previous contents of the
    region-rectangle to the right.

    So you mark the desired rectangle, and this function will push content to the right of the rectangle.

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

Sidebar

Related Questions

Couple of examples that I encounter quite often. Indenting some code E.g. I want
I often encounter EDI messages in various plain text formats, for example the format:
When working with text in Flash, I often encounter the following problem: http://www.aino.se/media/i/subpixel.png This
When working on code from multiple authors, I often encounter the issue of curly-brace
I don't use T4 templates often; usually when I do it is editing those
When using Visual Studio I often encounter situations when the IDE freezes while performing
Looking back at my past projects I often encounter this one: A client or
In employing Domain Driven design I often encounter an issue regarding the various perspective
I'm currently doing some oracle sql analysis and often encounter valid sql statement that
In one form or another I encounter the following question often (posed, here, in

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.