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

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

Re: how to redo align-regexp?


From: Marco Wahl
Subject: Re: how to redo align-regexp?
Date: Thu, 06 Oct 2016 09:42:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

HASM <hasm@example.invalid> writes:

>>> I mark a region and run align-regexp.
>>> Then I mark a different region and attempt a repeat-complex-command, but
>>> the command has the old region beg/end in it, and thus won't do what I
>>> want.
>>> Is repeat possible?  [...]
>
>> What about running align-regexp again and using M-p to recover the
>> recent regexp?
>
> It's
>   M-x ali TAB -r TAB M-p
> a lot more keystrokes than
>   C-x M-ESC 
>
> I'll need to wrap align-regexp with a function that uses the current
> region.

Not sure IIUC.  `align-regexp' actually already uses the current region
AFAICS.

Let me be more clear on what I suggest.

Let's say we have a buffer with the following 5 lines

a:a
aa:a
:
aaa:a
aaaa:a

Then you mark the first two lines and type M-x align-regexp : RET.  This
results in the first two lines to be aligned.

Then you mark the last two lines and type M-x M-p RET M-p RET.  This
results in the last two lines to be aligned.


HTH,
-- 
Marco


reply via email to

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