help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Code alignment


From: Ewen Cartwright
Subject: RE: Code alignment
Date: Fri, 25 Aug 2006 15:28:06 +0100

Great -- that's exactly what I was after -- thanks! 

-----Original Message-----
From: help-gnu-emacs-bounces+ejc=abcam.com@gnu.org
[mailto:help-gnu-emacs-bounces+ejc=abcam.com@gnu.org] On Behalf Of Jim
Ottaway
Sent: 25 August 2006 15:06
To: help-gnu-emacs@gnu.org
Subject: Re: Code alignment

"Ewen Cartwright" <ewen.cartwright@abcam.com> 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:
>
>   <cfset var intSupplierID = 0>
>   <cfset var structSupplierInfo = 0>
>   <cfset var intAbID = getAbID(arguments.intStockID)>
>
> as:
>
>   <cfset var intSupplierID      = 0>
>   <cfset var structSupplierInfo = 0>
>   <cfset var intAbID            = getAbID(arguments.intStockID)>
>
> 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



_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs




reply via email to

[Prev in Thread] Current Thread [Next in Thread]