in reply to Re^8: How would you indent this?
in thread How would you indent this?

I'm using emacs since university,...

I guess this is part of the problem. Emacs isn't the same as it was back then.

I bet all will know TAB

Sure. Users of Org mode use it to cycle entry visibility, or to proceed to the next field in an Org table. Practically every input in the minibuffer uses <TAB> for completion. Younger users see using <TAB> for indentation of a single line as a relic from the distant past.

Now from the docs of indent-region (all demos with 'emacs27 -Q')
C-h f indent-region ... 3) Indent each line via ‘indent-according-to-mode’. ...

I guess you deliberately left out the relevant paragraph here?

2) If ‘indent-region-function’ is non-nil, call that function to indent the region.

CPerl mode does set ‘indent-region-function’ to cperl-indent-region, so option 3) from your quote is irrelevant in CPerl mode. The docstring for cperl-indent-region ends with:

If ‘cperl-indent-region-fix-constructs’, will improve spacing on conditional/loop constructs.

Well, some might disagree on "improve" in our case, which is neither a conditional nor a loop. And this is why I call the current behavior a bug.

> The cperl-mode is the default supplied with the above.

you are contradicting yourself since your recipe says M-x cperl-mode

Emacs default is still perl-mode

This is close to trolling. Emacs supplies cperl-mode and it should be obvious that "default" refers to this version, as opposed to one of the various clones from GitHub and other repos. The author did not claim that cperl-mode is Emacs' default for opening Perl sources.

Replies are listed 'Best First'.
Re^10: How would you indent this?
by LanX (Saint) on Mar 19, 2021 at 14:23 UTC
    > This is close to trolling.

    and this is close to BS...

    I think it's better to stop here.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery