unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jim Ottaway <j.ottaway@lse.ac.uk>
Subject: Re: Code alignment
Date: Fri, 25 Aug 2006 15:05:56 +0100	[thread overview]
Message-ID: <871wr4vrjv.fsf@lse.ac.uk> (raw)
In-Reply-To: B0418CC3E025F549AEBD69058442E3F0019E2F48@abcam-uk-mail.abcam.com

"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

  parent reply	other threads:[~2006-08-25 14:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-24 22:32 url links to open from emacs Gary Wessle
2006-08-24 23:17 ` David Hansen
2006-08-25  5:41 ` Tim X
2006-08-25 10:24   ` Code alignment Ewen Cartwright
2006-08-25 12:26     ` Peter Dyballa
2006-08-25 14:05     ` Jim Ottaway [this message]
2006-08-25 14:28       ` Ewen Cartwright

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=871wr4vrjv.fsf@lse.ac.uk \
    --to=j.ottaway@lse.ac.uk \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).