3
如何让emacs缩进当前的续行(例如点或间接运算符后)比前一级更深一级?关于哪一个更漂亮的争论在这里是无关紧要的,因为这是我们在工作中使用的风格,所以我没有真正的选择。Emacs为每个续行缩进一个额外的级别
我猜这是一个偏移量(也许statement-cont
?),但我不知道如何动态地那样做......
相关:How to control indentation after an open parenthesis in Emacs
有
#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;
}
想
#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;
}
嘿,特雷,我只是想说说阅读你的答案总是很高兴! – Thomas 2011-05-18 19:23:40