From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Bourgneuf Francois" Newsgroups: gmane.emacs.help Subject: RE: perl indentation Date: Mon, 8 Dec 2008 10:35:10 +0100 Message-ID: <9884393F63F8AF4EA99527DC3C9141E208D2A3@zw67246c.societe.mma.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1228728949 16096 80.91.229.12 (8 Dec 2008 09:35:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Dec 2008 09:35:49 +0000 (UTC) To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 08 10:36:54 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L9cXo-0004Xf-W7 for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Dec 2008 10:36:49 +0100 Original-Received: from localhost ([127.0.0.1]:55043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L9cWe-0006U1-4E for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Dec 2008 04:35:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L9cWC-0006Tn-Lu for help-gnu-emacs@gnu.org; Mon, 08 Dec 2008 04:35:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L9cWA-0006Ta-H2 for help-gnu-emacs@gnu.org; Mon, 08 Dec 2008 04:35:07 -0500 Original-Received: from [199.232.76.173] (port=50393 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L9cWA-0006TX-AI for help-gnu-emacs@gnu.org; Mon, 08 Dec 2008 04:35:06 -0500 Original-Received: from relais.groupe-mma.fr ([195.101.229.226]:10039 helo=razor73-1.mma-rg.fr) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L9cW9-00031f-VD for help-gnu-emacs@gnu.org; Mon, 08 Dec 2008 04:35:06 -0500 Original-Received: from ZW67252I.societe.mma.fr ([10.200.243.215]) by razor73-1.mma-rg.fr (MOS 3.10.3-GA) with ESMTP id DJH64420; Mon, 8 Dec 2008 10:35:02 +0100 (CET) Original-Received: from ZW67246C.societe.mma.fr ([10.200.3.36]) by ZW67252I.societe.mma.fr with Microsoft SMTPSVC(5.0.2195.6713); Mon, 8 Dec 2008 10:35:10 +0100 Content-class: urn:content-classes:message X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: perl indentation Thread-Index: AclXdgJ09qnQuHepSk6ie4TgAHpCpwBoVmIw X-OriginalArrivalTime: 08 Dec 2008 09:35:10.0391 (UTC) FILETIME=[43890470:01C95918] X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:60449 Archived-At: 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=20 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=3D2 -bli = -l=3D0 -lp -vt=3D1 -vtc=3D1 -nsfs -ndln" nil t) (goto-char orig-point))) (global-set-key "\C-ct" 'perltidy)=20 > -----Message d'origine----- > De :=20 > help-gnu-emacs-bounces+francois.bourgneuf=3Dgroupe-mma.fr@gnu.or > g=20 > [mailto:help-gnu-emacs-bounces+francois.bourgneuf=3Dgroupe-mma.f > r@gnu.org] De la part de Teemu Likonen > Envoy=E9 : samedi 6 d=E9cembre 2008 08:14 > =C0 : help-gnu-emacs@gnu.org > Objet : Re: perl indentation >=20 > Jagadeesh (2008-12-05 20:45 -0800) wrote: >=20 > > 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. >=20 > For any region you can use C-M-\ (indent-region) or you can=20 > also use C-j > (newline-and-indent) instead of Enter (newline) when writing the code. >=20 >=20