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

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

Re: Extending Alignment in C/C++ expressions (align.el)


From: Andreas Röhler
Subject: Re: Extending Alignment in C/C++ expressions (align.el)
Date: Tue, 11 Sep 2007 18:51:14 +0200
User-agent: KMail/1.8.2

Am Dienstag, 11. September 2007 13:14 schrieb Nordlöw:
> On 10 Sep, 18:30, Tom Tromey <tro...@redhat.com> wrote:
> > >>>>> "Nordlöw" == Nordlöw  <per.nord...@gmail.com> writes:
> >
> > Nordlöw> How can I extend the Emacs package align.el to make M-x
> > align-entire Nordlöw> additionally align the if sub-expressions and
> > opening curly-braces as Nordlöw> follows?:
> >
> > Perhaps try align-regexp.
> >
> > Tom
>
> The variable `align-rules-list' is really big. How can I easily change/
> extend the part concerning c-assignment? Is there perhaps some variant
> of add-to-list(), say modify-list-item(), that does just that?
>
> Thanks again,
> Per Nordlöw


Don't know. Anyway, customization seems easier then
writing new code:

M-x customize-variable align-rules-list

C-s c-assignment

Then below you see the regexp-string, which matters.

[^-=!^&*+<>/|   
]\(\s-*[-=!^&*+<>/|]*\)=\(\s-*\)\([^=   
]\|$\)


In the middle a single, not parentised `=' - the char taken for indentation.

Simply extend expression here, replace `=' by `[{(=]' -
a group of signes. (Or any others you want indentation
work on...)

Then still two switches AFAIR.

Just below:

Set first attributes Value Menu to "Repeat:"

And again below `Bolean' to "on".

So it works for me.



Andreas Röhler 




reply via email to

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