From: harven <harven@free.fr>
To: help-gnu-emacs@gnu.org
Subject: Re: align-regexp
Date: Mon, 08 Dec 2008 10:02:55 +0100 [thread overview]
Message-ID: <m2vdtvf39c.fsf@free.fr> (raw)
In-Reply-To: d511180a-2574-443a-b388-9f91b2c3d6a3@j35g2000yqh.googlegroups.com
bpatton <bpatton@ti.com> writes:
> x(a , b , c)
> x(abc , boo_bar , THIS_IS_A_LONG_VARIABLE);
>
> How do I get align-regexp to align on all three commas?
>
> x(a , b ,
> c );
> x(abc , boo_bar , THIS_IS_A_LONG_VARIABLE);
You could put the following simple command in your initfile
(defun align-repeat (start end regexp)
"repeatedly align using a regexp as the field separator.
Works on the current region"
(interactive "r\nsAlign regexp: ")
(if (equal start end)
(message "no region !"))
(align-regexp start end
(concat "\\(\\s-*\\)" regexp) 1 align-default-spacing t))
Then select your text, and type M-x align-repeat RET , RET
prev parent reply other threads:[~2008-12-08 9:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-07 13:33 align-regexp bpatton
2008-12-07 21:01 ` align-regexp florian.jung
2008-12-08 9:02 ` harven [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2vdtvf39c.fsf@free.fr \
--to=harven@free.fr \
--cc=help-gnu-emacs@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.