[sf-perl] Do you have a tidy style? Emacs/cperl and perltidy.

Joseph Brenner doomvox at gmail.com
Wed Jan 23 12:14:27 PST 2013

Jonathan Swartz <swartz at pobox.com> wrote:
> Being a frequent user of both emacs and perltidy, I heartily recommend you have an easy keystroke (like ctrl-t) that will perltidy your current buffer.

Yeah, I stuck one of these in perlnow.el-- I would guess it's
something everyone does, in one way or another:

(defun perlnow-run-perltidy-on-region (start end)
  "Format the region using perltidy."
  (interactive "r")
  (let ( (command
          (format "perltidy --standard-output --standard-error-output"
                  )) )
    (shell-command-on-region start end command nil t "*error*")

Running perltidy on just the current region can have problems though
(perltidy can't get the whole context), and it might make more sense
to just run on the whole buffer as Jonathan suggests.

> Also, shameless plug, https://metacpan.org/module/tidyall has some ways to automate tidying and critiquing in different contexts.

I was going to plug that if you didn't... switching your configuration
for different projects is an obvious need, and this is a good way of
doing it.

More information about the SanFrancisco-pm mailing list