all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Bourgneuf Francois" <francois.bourgneuf@groupe-mma.fr>
To: <help-gnu-emacs@gnu.org>
Subject: RE: perl indentation
Date: Mon, 8 Dec 2008 10:35:10 +0100	[thread overview]
Message-ID: <9884393F63F8AF4EA99527DC3C9141E208D2A3@zw67246c.societe.mma.fr> (raw)

You may use perltidy.

I have inserted the following code in my .emacs, then C-c t will do the job on any marked region.
If you use activeperl, perltidy will be located in "Perl_Directory"/site/bin/perltidy
Regards 
Bour9

;; PerlTidy
(defmacro mark-active ()
    "Xemacs/emacs compatibility macro"
    (if (boundp 'mark-active)
        'mark-active
      '(mark)))
(defun perltidy ( )
  "Run perltidy on the current region or buffer."
  (interactive)
  (let ((orig-point (point)))
    (unless (mark-active) (mark-defun))
    (shell-command-on-region (point) (mark) "perltidy -q -ci=2 -bli -l=0 -lp -vt=1 -vtc=1 -nsfs -ndln" nil t)
    (goto-char orig-point)))
(global-set-key "\C-ct" 'perltidy) 




> -----Message d'origine-----
> De : 
> help-gnu-emacs-bounces+francois.bourgneuf=groupe-mma.fr@gnu.or
> g 
> [mailto:help-gnu-emacs-bounces+francois.bourgneuf=groupe-mma.f
> r@gnu.org] De la part de Teemu Likonen
> Envoyé : samedi 6 décembre 2008 08:14
> À : help-gnu-emacs@gnu.org
> Objet : Re: perl indentation
> 
> Jagadeesh (2008-12-05 20:45 -0800) wrote:
> 
> > Yes. TAB Does the magic. But when you are writing tons of line, you
> > can not press tons of TABs. So is there any block indentation
> > technique? VIM has this feature.
> 
> For any region you can use C-M-\ (indent-region) or you can 
> also use C-j
> (newline-and-indent) instead of Enter (newline) when writing the code.
> 
> 




             reply	other threads:[~2008-12-08  9:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-08  9:35 Bourgneuf Francois [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-12-01 16:13 perl indentation Jagadeesh
2008-12-01 19:11 ` aartist
2008-12-02  4:53   ` Jagadeesh
2008-12-02 14:44     ` Ted Zlatanov
2008-12-02 15:32     ` Phil Carmody
2008-12-06  4:45       ` Jagadeesh
2008-12-06  7:14         ` Teemu Likonen
2003-08-07 18:44 Perl Indentation Aaron Lenfestey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9884393F63F8AF4EA99527DC3C9141E208D2A3@zw67246c.societe.mma.fr \
    --to=francois.bourgneuf@groupe-mma.fr \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.