cperl-style-examples
cperl-style-examples is a variable defined in `
cperl-mode.el
'.
Its value is
"##### Numbers etc are: cperl-indent-level cperl-brace-offset\n##### cperl-continued-brace-offset cperl-label-offset\n##### cperl-continued-statement-offset\n##### cperl-merge-trailing-else cperl-extra-newline-before-brace\n\n########### (Do not forget cperl-extra-newline-before-brace-multiline)\n\n### CPerl (=GNU - extra-newline-before-brace + merge-trailing-else) 2/0/0/-2/2/t/nil\nif (foo) {\n bar\n baz;\n label:\n {\n boon;\n }\n} else {\n stop;\n}\n\n### PerlStyle (=CPerl with 4 as indent) 4/0/0/-4/4/t/nil\nif (foo) {\n bar\n baz;\n label:\n {\n boon;\n }\n} else {\n stop;\n}\n\n### GNU 2/0/0/-2/2/nil/t\nif (foo)\n {\n bar\n baz;\n label:\n {\n boon;\n }\n }\nelse\n {\n stop;\n }\n\n### C++ (=PerlStyle with braces aligned with control words) 4/0/-4/-4/4/nil/t\nif (foo)\n{\n bar\n baz;\n label:\n {\n boon;\n }\n}\nelse\n{\n stop;\n}\n\n### BSD (=C++, but will not change preexisting merge-trailing-else\n### and extra-newline-before-brace ) 4/0/-4/-4/4\nif (foo)\n{\n bar\n baz;\n label:\n {\n boon;\n }\n}\nelse\n{\n stop;\n}\n\n### K&R (=C++ with indent 5 - merge-trailing-else, but will not\n### change preexisting extra-newline-before-brace) 5/0/-5/-5/5/nil\nif (foo)\n{\n bar\n baz;\n label:\n {\n boon;\n }\n}\nelse\n{\n stop;\n}\n\n### Whitesmith (=PerlStyle, but will not change preexisting\n### extra-newline-before-brace and merge-trailing-else) 4/0/0/-4/4\nif (foo)\n {\n bar\n baz;\n label:\n {\n boon;\n }\n }\nelse\n {\n stop;\n }\n"
- This variable may be risky if used as a file-local variable.
Documentation:
Examples of if/else with different indent styles (with v4.23).