annotate mcabber/CodingStyle.txt @ 2304:fa8365fb6ac2

[PATCH 1/3] New option: vi_mode If the new vi_mode option is set to 1, let MCabber's non-chat mode accept a few commands loosely based on those available in vi(1)'s normal mode, e.g.: A Call "/roster unread_first". a Call "/roster unread_next". F Call "/roster group_prev". f Call "/roster group_next". G Call "/roster bottom". gg Call "/roster top". i Enter chat mode. [<n>]j Call "/roster down [<n>]". [<n>]k Call "/roster up [<n>]". n Repeat the previous search (if any). O Call "/roster unread_first" and open chat window. o Call "/roster unread_next" and open chat window. ZZ Call "/quit". zM Call "/group fold" for all groups. zR Call "/group unfold" for all groups. <Space> Call "/group toggle" for the current group. '' Call "/roster alternate". ! Toggle attention flag for current buddy. # Toggle unread messages flag for current buddy. /<str> Call "/roster search <str>". :q Call "/quit". :wq Call "/quit". :x Call "/quit". :<n> Jump to line <n> in the roster. :<cmd> Call "/<cmd>" (unless <cmd> matches one of the above commands).
author Holger Weiß <holger@zedat.fu-berlin.de>
date Wed, 22 Jul 2015 19:25:22 +0200
parents 189ffdd944b4
children ffd0e57e9563
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1509
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
1 This document describes the preferred coding style for the mcabber project.
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
2
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
3 If you intend to patch and contribute to mcabber, please try to use the
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
4 existing style, and read the following points.
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
5
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
6 - Do not use tabs, use space characters;
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
7 - Avoid trailing whitespace;
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
8 - Avoid lines longer than 80 characters;
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
9 - Indentation is 2 spaces (ok, maybe it isn't a good idea but it's the
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
10 current style);
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
11 - Put a space after non-functions statements (e.g. if, while...)
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
12 - Put the opening brace last on the same line, and put the closing brace first
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
13 except for functions, where the opening brace should be alone on a new line.
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
14
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
15 Example:
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
16
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
17 void example(void)
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
18 {
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
19 if (cond1) {
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
20 do_a();
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
21 } else if (cond2) {
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
22 do_b();
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
23 } else {
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
24 do_c();
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
25 }
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
26
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
27 if (error)
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
28 exit(0);
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
29 }
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
30
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
31 - Look at existing code for rules not mentioned here.
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
32
189ffdd944b4 Add a small Coding Style document
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
33 Mikael