Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: combining emacs' cperl-mode formatting with Perltidy

by duelafn (Parson)
on Oct 20, 2014 at 12:45 UTC ( [id://1104428]=note: print w/replies, xml ) Need Help??


in reply to combining emacs' cperl-mode formatting with Perltidy

Running perltidy using an Idle Timer should get perltidy to run at a reasonable interval and, I would think, help with formatting conflicts. I'd expect perltidy to be guaranteed to run after emacs did any alignment it intended to do since it will only run while "idle".

Good Day,
    Dean

  • Comment on Re: combining emacs' cperl-mode formatting with Perltidy

Replies are listed 'Best First'.
Re^2: combining emacs' cperl-mode formatting with Perltidy
by LanX (Saint) on Oct 20, 2014 at 12:58 UTC
    Sure but I don't want the formatting to flip flop between two stiles...

    Like the column where the comment starts...

    Maybe one first step is to write a perltidy config parser which translates to emacs settings.

    Another one would be a perltidy background demon to avoid the start overhead.

    I should have mentioned that emacs is more line oriented while perltidy processes the whole file...

    Cheers Rolf

    (addicted to the Perl Programming Language and ☆☆☆☆ :)

      Will they do that much fighting even if they are configured differently? I don't think cperl-mode changes indentation just by typing and certainly not anything further than the current line... at least I don't see anything in my cperl config that disables any such things. cperl is happy to allow me to edit a line or comment that it thinks in not properly aligned without changing the alignment. (that's actually a thing that drives me crazy in some other modes - they change the alignment when I type a paren or semi-colon.)

      Good Day,
          Dean

        As I said, there is an inline option for comment start (which might be a localized global variable)

        You can set up indent on return.

        You have indent region which is hooked in my config to closed curlies.

        You can set up the bracing style, like for if/else.

        So while the default is quite passive, there are many interactive features.

        (all options named from memory and most certainly not accurate)

        Cheers Rolf

        (addicted to the Perl Programming Language and ☆☆☆☆ :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1104428]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2026-04-11 23:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.