From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jim Ottaway Newsgroups: gmane.emacs.help Subject: Re: Code alignment Date: Fri, 25 Aug 2006 15:05:56 +0100 Message-ID: <871wr4vrjv.fsf@lse.ac.uk> References: <873bbl9xtv.fsf@tiger.rapttech.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1156514850 6157 80.91.229.2 (25 Aug 2006 14:07:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 25 Aug 2006 14:07:30 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 25 16:07:27 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GGcL4-0001Lh-ME for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Aug 2006 16:07:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GGcL4-0007gw-2j for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Aug 2006 10:07:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GGcKn-0007eS-CK for help-gnu-emacs@gnu.org; Fri, 25 Aug 2006 10:06:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GGcKk-0007cB-7A for help-gnu-emacs@gnu.org; Fri, 25 Aug 2006 10:06:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GGcKj-0007by-Nd for help-gnu-emacs@gnu.org; Fri, 25 Aug 2006 10:06:53 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GGcT1-0007U6-PG for help-gnu-emacs@gnu.org; Fri, 25 Aug 2006 10:15:28 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GGcKT-0001CB-Nb for help-gnu-emacs@gnu.org; Fri, 25 Aug 2006 16:06:38 +0200 Original-Received: from 53-186.adsl.zetnet.co.uk ([194.247.53.186]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Aug 2006 16:06:37 +0200 Original-Received: from j.ottaway by 53-186.adsl.zetnet.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Aug 2006 16:06:37 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 45 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 53-186.adsl.zetnet.co.uk User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:eWcgp9QcgAVMMfelvdgT22M37sE= 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:36931 Archived-At: "Ewen Cartwright" writes: > Hi all, > > I'm a long-time vim user who is converting to emacs. One thing I miss > from vim is a generic code alignment tool (like Align.vim, if anyone's > familiar with it) for formatting code like: > > > > > > as: > > > > > > As you may be able to tell, this is ColdFusion code, so natty C or > Java-specific code-formatting tools won't help much -- I guess I'll need > something completely language-agnostic as I doubt anyone has written > anything specific to ColdFusion. > > If anyone knows of anything I could use in emacs to do this I'd be very > grateful! You could try creating a ColdFusion mode and using M-x align. I tried this: (define-derived-mode cf-mode java-mode "CF") (push 'cf-mode align-c++-modes) and I got the alignment you want by marking the text and doing M-x align. I know nothing at all about ColdFusion, so I don't know if java-mode is the right thing from which to derive a ColdFusion mode. All that really matters, however, is that you have a mode name that you can add to align-c++-modes. Regards, -- Jim Ottaway