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

  • Home
  • SEARCH
  • 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 4622646
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:52:22+00:00 2026-05-22T02:52:22+00:00

How do you tell emacs to indent the current continued line (e.g. after a

  • 0

How do you tell emacs to indent the current continued line (e.g. after a dot or indirection operator) one level deeper than the previous one? Arguments about which one is prettier are irrelevant here since this is the style we use at my work, so I don’t really have a choice.

I’m guessing it’s an offset (maybe statement-cont?), but I’m not sure how to do it dynamically like that…

Kind of related: How to control indentation after an open parenthesis in Emacs

Have

#include <stdio.h>

struct thing {
    int the_first_piece_of_data;
};

struct stuff {
    struct thing the_first_thing_in_this_stuff;
    struct thing *pointer_to_the_first_thing_in_this_stuff;
};

int main(int argc, char *argv[])
{
    struct stuff some_stuff_to_work_with;
    struct stuff *pointer_to_stuff = &some_stuff_to_work_with;
    some_stuff_to_work_with.
        pointer_to_the_first_thing_in_this_stuff =
        &(some_stuff_to_work_with.
          the_first_thing_in_this_stuff);

    some_stuff_to_work_with.
        the_first_thing_in_this_stuff.
        the_first_piece_of_data = 42;

    printf("The piece of data is => %d\n",
           some_stuff_to_work_with.
           the_first_thing_in_this_stuff.
           the_first_piece_of_data);

    pointer_to_stuff->
        pointer_to_the_first_thing_in_this_stuff->
        the_first_piece_of_data++;

    printf("The piece of data is => %d\n",
           pointer_to_stuff->
           pointer_to_the_first_thing_in_this_stuff->
           the_first_piece_of_data);

    return 0;
}

Want

#include <stdio.h>

struct thing {
    int the_first_piece_of_data;
};

struct stuff {
    struct thing the_first_thing_in_this_stuff;
    struct thing *pointer_to_the_first_thing_in_this_stuff;
};

int main(int argc, char *argv[])
{
    struct stuff some_stuff_to_work_with;
    struct stuff *pointer_to_stuff = &some_stuff_to_work_with;
    some_stuff_to_work_with.
        pointer_to_the_first_thing_in_this_stuff =
            &(some_stuff_to_work_with. /*exra indent*/
              the_first_thing_in_this_stuff);

    some_stuff_to_work_with.
        the_first_thing_in_this_stuff.
            the_first_piece_of_data = 42; /*exra indent*/

    printf("The piece of data is => %d\n",
           some_stuff_to_work_with.
               the_first_thing_in_this_stuff. /*exra indent*/
                   the_first_piece_of_data); /*exra indent*/

    pointer_to_stuff->
        pointer_to_the_first_thing_in_this_stuff->
            the_first_piece_of_data++; /*exra indent*/

    printf("The piece of data is => %d\n",
           pointer_to_stuff->
               pointer_to_the_first_thing_in_this_stuff-> /*exra indent*/
                   the_first_piece_of_data); /*exra indent*/

    return 0;
}
  • 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-22T02:52:23+00:00Added an answer on May 22, 2026 at 2:52 am

    This is not possible with the built-in indentation options.

    You can verify this by using C-c C-s (aka c-show-syntactic-information) on the lines where you want the /* extra indent */ and the line above them, and you’ll see that the syntactic information for those lines is always the same. In other words, as far as the indentation engine knows, those lines are the same syntactically.

    Check out the documentation for interactive customization.

    It might be possible to do what you want by customizing c-special-indent-hook.

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

Sidebar

Related Questions

See also: Emacs behind HTTP proxy Is it possible to tell emacs to automatically
Are there any Emacs gurus out there who can tell me how to bind
Is there an emacs lisp function that will allow me to tell if a
I recently discovered longlines mode in Emacs (after having been a regular user for
I have two sessions open in Emacs-ESS: one on my desktop and one on
please tell me how to use language like HINDI in xml. my current xml
How do I tell in emacs window orientation, e.g. if it was created by
How do I get emacs to tell me the location of the .emacs file
I like to use Emacs' shell mode, but it has a few deficiencies. One
How can I tell (from inside of .emacs) whether or not the Emacs version

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.