From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas =?iso-8859-1?q?R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: Extending Alignment in C/C++ expressions (align.el) Date: Tue, 11 Sep 2007 18:51:14 +0200 Message-ID: <200709111851.15332.andreas.roehler@online.de> References: <1189427856.416129.298270@o80g2000hse.googlegroups.com> <1189509297.802688.33670@r29g2000hsg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1189529386 7443 80.91.229.12 (11 Sep 2007 16:49:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2007 16:49:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 11 18:49:43 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IV8vm-0002lT-PV for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Sep 2007 18:49:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IV8vm-0004L8-4d for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Sep 2007 12:49:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IV8vY-0004L3-TP for help-gnu-emacs@gnu.org; Tue, 11 Sep 2007 12:49:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IV8vW-0004Kk-ND for help-gnu-emacs@gnu.org; Tue, 11 Sep 2007 12:49:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IV8vW-0004Kd-GH for help-gnu-emacs@gnu.org; Tue, 11 Sep 2007 12:49:26 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.183]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IV8vV-0003qX-UG for help-gnu-emacs@gnu.org; Tue, 11 Sep 2007 12:49:26 -0400 Original-Received: from p54BE977A.dip0.t-ipconnect.de [84.190.151.122] (helo=karton) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis), id 0ML25U-1IV8vU2AYn-0007dL; Tue, 11 Sep 2007 18:49:24 +0200 User-Agent: KMail/1.8.2 In-Reply-To: <1189509297.802688.33670@r29g2000hsg.googlegroups.com> Content-Disposition: inline X-Provags-ID: V01U2FsdGVkX18/3bnVpg7RFu4r3G364JrCcxPpy3D084EUsM/ BWNd7BARlTPi+7cxJbOPCMKDSd77HEC2g0bXdx+7sSL4Y95pRg 670kTNjFsvYkb+GdN7LSw== X-Detected-Kernel: Linux 2.6? (barebone, rare!) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:47498 Archived-At: Am Dienstag, 11. September 2007 13:14 schrieb Nordl=F6w: > On 10 Sep, 18:30, Tom Tromey wrote: > > >>>>> "Nordl=F6w" =3D=3D Nordl=F6w writes: > > > > Nordl=F6w> How can I extend the Emacs package align.el to make M-x > > align-entire Nordl=F6w> additionally align the if sub-expressions and > > opening curly-braces as Nordl=F6w> 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=F6w 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. [^-=3D!^&*+<>/| =09 ]\(\s-*[-=3D!^&*+<>/|]*\)=3D\(\s-*\)\([^=3D =09 ]\|$\) In the middle a single, not parentised `=3D' - the char taken for indentati= on. Simply extend expression here, replace `=3D' by `[{(=3D]' - 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=F6hler=20