I have the same problem, which I normally solve manually.

But this could be solved with separate rules for = , =~ and => and/or "sections separations".

please note how this works

my $h_periods = { Mercury => { orbital => 0.24, rotation => 58.64 }, Venus => { orbital => 0.62, rotation => -243.02 }, Earth => { orbital => 1.00, rotation => 1.00 }, Mars => { orbital => 1.88, rotation => 1.03 }, Jupiter => { orbital => 11.86, rotation => 0.41 }, Saturn => { orbital => 29.46, rotation => 0.43 }, Uranus => { orbital => 84.01, rotation => -0.72 }, Neptune => { orbital => 164.8, rotation => 0.67 }, };

That's because { is a section separator while ( is not

`separate' Each rule can define its own section separator, which describes how to identify the separation of "sections" within the region to be aligned. Setting the `separate' attribute overrides the value of `align-region-separate' (see the documentation of that variable for possible values), and any separation argument passed to `align'.

using M-x customize-group RET align RET will facilitate customizing (it provides a textual UI for lisp data)

the rule in question in align-rules-list is

Alignment rule: Title: perl-assignment Required attributes: Regexp: (Regular expression to match) Choice: Value Menu Regexp: [^=!^&*-+<>/| ]\(\s-*\)=[~>]?\(\s-*\)\([^>= ]\|$\) Optional attributes: INS DEL Choice: Value Menu Paren group: (Parenthesis group to use) Choice: Value Menu Repeat: INS DEL Integer: 1 INS DEL Integer: 2 INS INS DEL Choice: Value Menu Modes: (Modes where this rule applies) Lisp expression: align-perl-modes INS DEL Choice: Value Menu To Tab Stop: (Should rule align to tab stops) Boolean: Toggle off (nil) INS

this [~>]? part should be deleted or replaced.

(BTW: not sure what the -* is intended to do...)

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!


In reply to Re^4: prettyfy hashes (emacs) by LanX
in thread prettyfy hashes by morgon

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.