> Is it that it is emacs?
The OP is using a function which is not standard indenting, hitting TAB is.°

That's an oversimplification.

  1. <TAB> is equivalent to M-x cperl-indent-line if (as per default) tab-always-indent is set to a true value. It indents the current line.
  2. M-x cperl-indent-exp indents the current expression and reformats if (as per default) cperl-indent-region-fix-constructs is set to 1.
  3. M-x cperl-indent-region indents the current region and reformats if (as per default) cperl-indent-region-fix-constructs is set to 1.
  4. <RET> is, per default, equivalent to M-x newline which, also per default, indents the current and the new (empty) line.

None of these functions are more standard than the others, and with the current settings there's rarely the need to use <TAB> at all.

°) or activating auto-indent, which seems to be default now.

That's electric-indent-mode, which isn't actually overdocumented right now. One of the consequences of this mode is that the PBP recommendation to remap <RET> to M-x newline-and-indent is outdated and should no longer be used. Also, in Python buffers, where indentation can't be inferred from braces and such, Electric Indent mode is switched off.


In reply to Re^7: How would you indent this? by haj
in thread How would you indent this? by no longer just digit

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.