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 ☆☆☆☆ :)