[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: align-regexp problem when called from lisp code
From: |
Luca Ferrari |
Subject: |
Re: align-regexp problem when called from lisp code |
Date: |
Fri, 9 Aug 2013 12:03:34 +0200 |
On Fri, Aug 9, 2013 at 11:40 AM, Tassilo Horn <tsdh@gnu.org> wrote:
> Luca Ferrari <fluca1978@infinito.it> writes:
>
> Hi Luca,
>
>> Uhm...no, I was wondering to obtaining some that aligns the
>> assignments and potential one line comments, so something that from
>> this:
>>
>> a = 10; /* 10 is the inital value */
>> veryLongVariableName = ( a + 2 ); /* should start two more from a */
>
> Ah, ok, then you need to use the REPEAT argument to repeat the alignment
> at = and /* throughout the line.
>
> --8<---------------cut here---------------start------------->8---
> (defun fluca1978/align-assignments (beg end)
> (interactive "r")
> (align-regexp beg end "\\(\\s-*\\)\\(?:=\\|/\\*\\)" 1 nil t))
> --8<---------------cut here---------------end--------------->8---
Great!
Thank you very much!
Luca