From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: manish honap Newsgroups: gmane.emacs.help Subject: Re: Help on indentation Date: Sat, 31 Mar 2012 23:52:54 +0800 (SGT) Message-ID: <1333209174.40638.YahooMailNeo@web192402.mail.sg3.yahoo.com> References: <1333018729.79347.YahooMailNeo@web192406.mail.sg3.yahoo.com> <1333087227.94015.YahooMailNeo@web192403.mail.sg3.yahoo.com> Reply-To: manish honap NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="1577518589-455948363-1333209174=:40638" X-Trace: dough.gmane.org 1333209194 23731 80.91.229.3 (31 Mar 2012 15:53:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 31 Mar 2012 15:53:14 +0000 (UTC) To: "Ludwig, Mark" , "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 31 17:53:12 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SE0c3-0001k7-OV for geh-help-gnu-emacs@m.gmane.org; Sat, 31 Mar 2012 17:53:12 +0200 Original-Received: from localhost ([::1]:50758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SE0c3-0001Dj-7s for geh-help-gnu-emacs@m.gmane.org; Sat, 31 Mar 2012 11:53:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SE0bv-0001Da-Eq for help-gnu-emacs@gnu.org; Sat, 31 Mar 2012 11:53:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SE0bs-0002Po-Sp for help-gnu-emacs@gnu.org; Sat, 31 Mar 2012 11:53:03 -0400 Original-Received: from nm13.bullet.mail.sg3.yahoo.com ([106.10.148.92]:37838) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SE0bp-0002Oo-S2 for help-gnu-emacs@gnu.org; Sat, 31 Mar 2012 11:53:00 -0400 Original-Received: from [106.10.166.61] by nm13.bullet.mail.sg3.yahoo.com with NNFMP; 31 Mar 2012 15:52:55 -0000 Original-Received: from [106.10.151.219] by tm18.bullet.mail.sg3.yahoo.com with NNFMP; 31 Mar 2012 15:52:55 -0000 Original-Received: from [127.0.0.1] by omp1017.mail.sg3.yahoo.com with NNFMP; 31 Mar 2012 15:52:55 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 174748.74641.bm@omp1017.mail.sg3.yahoo.com Original-Received: (qmail 66926 invoked by uid 60001); 31 Mar 2012 15:52:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s1024; t=1333209174; bh=rftgjX3f1C1Ekrd5NIFyGgWrcr9V+DX973K2oldPKnM=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=ThpZCW6lfWD60uTC6ENMAzRZgkuGzT40dPoQBUgYvwUreevSTA35o1wI4S+SC7J6hda1nMR5AKoIMG/5LBvT96KVs5cWUFVaG/q/sZiUEoHjpXw8kpi+aunY6JH87TGJbhuQKQroB9x7T3L4iMIONhgWMBoakPTpUhN72ke3/zo= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=DuIPfQgg0fGjQBVi7/hBS/1zSrOsF8wht9yC0mLK5E56v0ObeGlCxA9QJ+ppWJuJN9w/xo6iDC5kkHkIZdNcGg0QXCFNdr/K10KNJBNb5COk+6v9ZPg8MKt0otDAPnrTZfaFJ/GIFPKyJM4eS+29/YOdtLvsklsfJR2GwUhgzUE=; X-YMail-OSG: dU8PKVYVM1lLfASvXxL6nuWKx6NfOXJz0WsnDCFK0r8ZbUA qYKum4Fxg5nTATzau9ybzmj.x49xv7LA2S7fx.K6tP0hFvV0qSSON0Vrb711 C99E9hYl68F5sGd7577sFNUk0a986zqiJ4yQpSEOISeDkLdaVnQoajBzBd9e F1vuS0M1eIN3c4LaciruVplUqLDFrVsXcOsMpHMZOaBbJvVujYFmdrgwKpqI yUMXI5YLjZR5N1OWFtZAjjLE3ValkdfOR5zGX.J835WYiAZ.Dx3hRlUigPlu KOP1XWNAgePzElxNvxMti9hkrbK_pr8vGfD_SGdKtgLKxDwt0noPsqsTAIkZ J1m4x9CXSR0LBoDoWfvI7pP_zAIbQPqiZcUYXZFp1ZXhRueeSIpGqC6u7NQd ArjdhkfEnKZAUSLvEt81oKJwBdSuI91GDHsMHurHRab2iOOMdpK77exY7E6Y WSkD0ISwpedufJjfmlhMSkB98UKqh9b8C1g2l7PpQlNKtCqQJlKZ6JLWLk5u HVbBWXB5f9MMMzdckGApcEbmPRAOEXu732A-- Original-Received: from [117.195.70.22] by web192402.mail.sg3.yahoo.com via HTTP; Sat, 31 Mar 2012 23:52:54 SGT X-Mailer: YahooMailWebService/0.8.117.340979 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 106.10.148.92 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84230 Archived-At: --1577518589-455948363-1333209174=:40638 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I started the topic due to same issue.=0AI used `paredit.el', but it also d= id in the same manner you showed - inserting spaces even after function cal= l parenthesis.=0A=0AHave to check how to modify cc-mode `(' binding...=0A= =0AThanks,=0AManish=0A=0A=0A________________________________=0A From: "Ludw= ig, Mark" =0ATo: "help-gnu-emacs@gnu.org" =0ASent: Friday, 30 March 2012 7:14 PM=0ASubject: RE: Help= on indentation=0A =0A=0A =0AThere is curious synchronicity on this topic, = because my colleagues are reviewing some of my code this week and are chall= enging me about the spaces before the argument lists for function calls.=C2= =A0 (They mostly use =E2=80=98vi=E2=80=99=E2=80=A6.)=0A=C2=A0=0ANormal Emac= s behavior using M-( results in the following (could be Java or C):=0A=C2= =A0=0A=C2=A0=C2=A0 if (foo1 (bar, baz))=0A=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fo= o2 ();=0A=C2=A0=0AWhat we want is:=0A=C2=A0=0A=C2=A0=C2=A0 if (foo1(bar, ba= z))=0A=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 foo2();=0A=C2=A0=0AThat is, we only wa= nt a space to be inserted after a language keyword.=C2=A0 Has anyone hacked= this (presumably as part of or in conjunction with CC Mode) for conditiona= lly adding the space before the open parentheses?=C2=A0 The reason I expect= it to be related to CC Mode is that it=E2=80=99s the fact that =E2=80=9Cif= =E2=80=9D is a language keyword that makes the difference, and CC Mode alre= ady knows about the keywords.=C2=A0 Looking at insert-parentheses and inser= t-pair, it seems as though insert-parentheses could be wrapped in something= like cc-insert-parentheses to do this.=C2=A0 That=E2=80=99s what I=E2=80= =99ll start doing if no one else pipes up=E2=80=A6.=0A=C2=A0=0AThanks!=0AMa= rk=0A=C2=A0=0AFrom:Ludwig, Mark =0ASent: Friday, March 30, 2012 7:36 AM=0AT= o: 'manish honap'; Nash Steve=0ACc: help-gnu-emacs@gnu.org=0ASubject: RE: H= elp on indentation=0A=C2=A0=0AIt=E2=80=99s not at all clear why you needed = to do this, since M-( is normally bound to insert-parentheses.=C2=A0 (AFAIK= , it has been this way for decades.)=0A=C2=A0=0ARegarding making the =E2=80= =98(=E2=80=98 character do this, by convention, it would be an =E2=80=9Cele= ctric=E2=80=9D function, and it=E2=80=99s probably not very hard to write.= =C2=A0 You might even be happy just binding =E2=80=98(=E2=80=98 to insert-p= arentheses.=0A=C2=A0=0AHope this helps,=0AMark=0A=C2=A0=0AFrom:help-gnu-ema= cs-bounces+ludwig.mark=3Dsiemens.com@gnu.org [mailto:help-gnu-emacs-bounces= +ludwig.mark=3Dsiemens.com@gnu.org] On Behalf Of manish honap=0ASent: Frida= y, March 30, 2012 1:00 AM=0ATo: Nash Steve=0ACc: help-gnu-emacs@gnu.org=0AS= ubject: Re: Help on indentation=0A=C2=A0=0AThanks for your help.=0A=C2=A0= =0AI got a hint from `http://www.emacswiki.org/emacs/LineCopyChar'=0Aand I = added,=0A=C2=A0=0A(defun insert-paren-pair (&optional b)=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=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=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 =0A(define-key global-map (kbd "M-(") 'insert-paren-pair)=C2=A0=0A= =C2=A0=0Ato my .emacs=0A=C2=A0=0Athis won't solve the original problem, but= for specific keywords it will suffice.=0A=C2=A0=0A=0A_____________________= ___________=0A =0AFrom:Nash Steve =0ATo: manish honap = =0ACc: "help-gnu-emacs@gnu.org" =0ASent: Friday, 30 March 2012 12:29 AM=0ASubject: Re: Help on= indentation=0A=C2=A0=0Ainsert-parentheses may help.=0A=C2=A0=0AOn Thu, Mar= 29, 2012 at 6:58 AM, manish honap wrote:=0A= I have following query,=0A=C2=A0=0AIn cc-mode=0Awhenever I type `(', I want= emacs to automatically insert space before it,=0Ajust for symbols [if | wh= ile | for | switch] during typing;=0A=C2=A0=0AHow it can be done ?=0A=C2=A0= =0AThanks,=0AManish --1577518589-455948363-1333209174=:40638 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
I started = the topic due to same issue.
I used `paredit.el', bu= t it also did in the same manner you showed - inserting spaces even after f= unction call parenthesis.

Have to check how to modify cc-mode `(' binding...

Thanks,
Manish


From: "Ludwig, Mark" <ludwig.mark@siemens.com> To: "help-gnu-emacs@gnu= .org" <help-gnu-emacs@gnu.org>
= Sent: Friday, 30 March 2012 7:14 PM
Subject: RE: Help on indentation

=0A=0A =0A =0A=0A=0A
=0A
=0AThere is curious synchronicity on this topic, because my colleagues = are reviewing some of my code this week and are challenging me about the sp= aces before the=0A argument lists for function calls.  (They mostly us= e =E2=80=98vi=E2=80=99=E2=80=A6.)
=0A
 <= /div> =0A
Normal Emacs behavior using M-( results in the following= (could be Java or C):
=0A
 
=0A   if (foo1 (bar, baz))
=0A
 &= nbsp;    foo2 ();
=0A
  =0A
What we want is:
=0A
 =
=0A
   if (foo1(bar, baz))
=0A
      foo2();
=0A
 = ;
=0A
That is, we only want a space to be inserted af= ter a language keyword.  Has anyone hacked this (presumably as part of= or in conjunction with CC Mode) for conditionally=0A adding the space befo= re the open parentheses?  The reason I expect it to be related to CC M= ode is that it=E2=80=99s the fact that =E2=80=9Cif=E2=80=9D is a language k= eyword that makes the difference, and CC Mode already knows about the keywo= rds.  Looking at insert-parentheses and=0A insert-pair, it seems as th= ough insert-parentheses could be wrapped in something like cc-insert-parent= heses to do this.  That=E2=80=99s what I=E2=80=99ll start doing if no = one else pipes up=E2=80=A6.
=0A
 
= =0A
Thanks!
=0A
<= span style=3D"font-size:11.0pt;color:#1F497D;">Mark
=0A
 
=0A
=0A
=0A
From: Ludwig, Mark=0A
=0ASent: Friday, March 30= , 2012 7:36 AM
=0ATo: 'manish honap'; Nash Steve
=0ACc:= help-gnu-emacs@gnu.org
=0ASubject: RE: Help on indentation
=0A
=0A
=0A
  =0A
It=E2=80=99s not at all clear why you needed to do this, = since M-( is normally bound to insert-parentheses.  (AFAIK, it has bee= n this way for decades.)
=0A
 
=0A=
Regarding making the =E2=80=98(=E2=80=98 character do this, by co= nvention, it would be an =E2=80=9Celectric=E2=80=9D function, and it=E2=80= =99s probably not very hard to write.  You might even be=0A happy just= binding =E2=80=98(=E2=80=98 to insert-parentheses.
=0A
 
=0A
Hope this helps,
=0A
Mark
=0A
 
=0A
=0A
=0A
From: help-gnu-emacs-bou= nces+ludwig.mark=3Dsiemens.com@gnu.org [mailto:help-gnu-emacs-bounces+ludwi= g.mark=3Dsiemens.com@gnu.org]=0AOn Behalf Of manish honap
=0AS= ent: Friday, March 30, 2012 1:00 AM
=0ATo: Nash Steve
=0A<= b>Cc: help-gnu-emacs@gnu.org
=0ASubject: Re: Help on indentat= ion
=0A
=0A
=0A
=  
=0A
=0A
=0A
Thanks for your help.
=0A
=0A
=0A
 
= =0A
=0A
=0A
I got a hint from `http://www.emacsw= iki.org/emacs/LineCopyChar'
=0A
=0A
=0A
and I added,
=0A
=0A
=0A
&nbs= p;
=0A
=0A
=0A
(defun insert-paren-= pair (&optional b)         = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;        =0A
=0A  (interact= ive "p")           &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            = =0A
=0A  (let (p col s)       &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;      =0A
=0A    (setq = p (point))           = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;           =0A=0A    (setq col (current-column))    =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;            =             &nb= sp;       =0A
=0A    (= move-to-column col)         &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;         =0A
=0A &nbs= p;  (goto-char p)         = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;    =0A
=0A    (insert " ()") &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;          =0A
=0A=     (goto-char (- (point) 1))))     = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;      =0A
=0A    &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;=0A
=0A(define-key global-map (kbd "M-(") 'insert-paren-pair) =
=0A
=0A
=0A
 
= =0A
=0A
=0A
to my .emacs
=0A
= =0A
=0A
 
=0A
=0A
=0Athis won't solve the original problem, but for specific keyw= ords it will suffice.
=0A
=0A
=0A
=  
=0A
=0A
=0A
=0A
=0A
=0A=0A
=0A
=0A
From:= Nash Steve <nash11228@gmail.com>
=0ATo: manish honap <m= anish_honap_vit@yahoo.co.in>
=0ACc: "help-gnu-emacs@gnu.org" = <help-gnu-emacs@gnu.org>
=0ASent: Friday, 30 March 2012 12= :29 AM
=0ASubject: Re: Help on indentation
=0A
=0A
  =0A
=0A
insert-parentheses ma= y help.
=0A
=0A
&= nbsp;
=0A
=0A
On Thu, Mar 29, 2012 at 6:= 58 AM, manish honap <manish_honap_vit@yahoo.co.in> wrote:
=0A
=0A=0A
=0A
I have following query,
=0A=0A
=0A
 
=0A
=0A
=0A=
In cc-mode
=0A
=0A
=0A
whenever I type `(', I want emacs to automatically insert space be= fore it,
=0A
=0A
=0A
just for symbo= ls [if | while | for | switch] during typing;
=0A
=0A=0A
 
=0A
=0A
=0A
How it can be done ?
=0A
=0A
=0A
 
=0A
=0A
=0A
Thanks= ,
=0A
=0A
=0A
Manish
= =0A
=0A
=0A
=0A
=0A
  =0A
=0A
=0A
 
=0A
=0A
=0A
=0A
=0A
=0A=0A

--1577518589-455948363-1333209174=:40638--