unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* lisp/progmodes/cc-styles.el indentation broken in ellemtel mode
@ 2008-07-15 12:44 Joachim Nilsson
  2008-07-16 15:25 ` Andrew W. Nosenko
  0 siblings, 1 reply; 10+ messages in thread
From: Joachim Nilsson @ 2008-07-15 12:44 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

Hi!

The Ellemtel C/C++ indentation engine has been broken on trunk since 
around March[1].  This is a followup notice.

It fails to indent function arguments that are on a new line. Like this:

	printf ("foo %d\n",
	arg);

instead of lining them up under the first argument, like this:

	printf ("foo %d\n",
	        arg);

The attached patch solves the problem and I have, since March, not found
any other problems with using this patch.

Regards
 /Jocke

[1] - http://lists.gnu.org/archive/html/emacs-devel/2008-03/msg02332.html

--  
Joachim Nilsson :: <joachim AT vmlinux DOT org>
+46(0)21-123348 :: <http://vmlinux.org/joachim>

[-- Attachment #2: cc-styles.diff --]
[-- Type: text/plain, Size: 662 bytes --]

Index: lisp/progmodes/cc-styles.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-styles.el,v
retrieving revision 1.51
diff -u -r1.51 cc-styles.el
--- lisp/progmodes/cc-styles.el	6 May 2008 07:18:15 -0000	1.51
+++ lisp/progmodes/cc-styles.el	12 Jul 2008 18:04:23 -0000
@@ -169,8 +169,7 @@
                          (case-label           . +)
                          (access-label         . -)
                          (inclass              . ++)
-			 (inline-open          . 0)
-			 (arglist-cont-nonempty))))
+			 (inline-open          . 0))))
 
     ("linux"
      (c-basic-offset  . 8)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: lisp/progmodes/cc-styles.el indentation broken in ellemtel mode
  2008-07-15 12:44 lisp/progmodes/cc-styles.el indentation broken in ellemtel mode Joachim Nilsson
@ 2008-07-16 15:25 ` Andrew W. Nosenko
  2008-07-17  0:53   ` Joachim Nilsson
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew W. Nosenko @ 2008-07-16 15:25 UTC (permalink / raw)
  To: Joachim Nilsson; +Cc: emacs-devel

On Tue, Jul 15, 2008 at 3:44 PM, Joachim Nilsson <crash@vmlinux.org> wrote:
> Hi!
>
> The Ellemtel C/C++ indentation engine has been broken on trunk since
> around March[1].  This is a followup notice.
>
> It fails to indent function arguments that are on a new line. Like this:
>
>        printf ("foo %d\n",
>        arg);
>
> instead of lining them up under the first argument, like this:
>
>        printf ("foo %d\n",
>                arg);
>
> The attached patch solves the problem and I have, since March, not found
> any other problems with using this patch.
>
> Regards
>  /Jocke
>
> [1] - http://lists.gnu.org/archive/html/emacs-devel/2008-03/msg02332.html
>

Beside removing
    (arglist-cont-nonempty)
from the c-offsets-alist, you need add it to the
c-hanging-braces-alist, just like it done for all other styles.  IMHO,
current difference of "ellemtel" from an other styles was just a typo.

-- 
Andrew W. Nosenko <andrew.w.nosenko@gmail.com>




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: lisp/progmodes/cc-styles.el indentation broken in ellemtel mode
  2008-07-16 15:25 ` Andrew W. Nosenko
@ 2008-07-17  0:53   ` Joachim Nilsson
  2008-07-27 17:37     ` For 23.1 release ... please. (Was: Re: lisp/progmodes/cc-styles.el indentation broken in ellemtel mode) Joachim Nilsson
  0 siblings, 1 reply; 10+ messages in thread
From: Joachim Nilsson @ 2008-07-17  0:53 UTC (permalink / raw)
  To: Andrew W. Nosenko; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 552 bytes --]

On Wed, Jul 16, 2008 at 06:25:55PM +0300, Andrew W. Nosenko wrote:
> On Tue, Jul 15, 2008 at 3:44 PM, Joachim Nilsson <crash@vmlinux.org> wrote:
> > The Ellemtel C/C++ indentation engine has been broken on trunk since
> > around March.
> Beside removing (arglist-cont-nonempty) from the c-offsets-alist, you
> need add it to the c-hanging-braces-alist, just like it done for all
> other styles.  IMHO, current difference of "ellemtel" from an other
> styles was just a typo.

Yep, that seems about right.  Attached is a revised patch.

Regards
 /Jocke

[-- Attachment #2: cc-styles.diff --]
[-- Type: text/plain, Size: 1094 bytes --]

Index: lisp/progmodes/cc-styles.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-styles.el,v
retrieving revision 1.51
diff -u -r1.51 cc-styles.el
--- lisp/progmodes/cc-styles.el	6 May 2008 07:18:15 -0000	1.51
+++ lisp/progmodes/cc-styles.el	17 Jul 2008 00:45:35 -0000
@@ -162,15 +162,15 @@
     ("ellemtel"
      (c-basic-offset . 3)
      (c-comment-only-line-offset . 0)
-     (c-hanging-braces-alist     . ((substatement-open before after)))
+     (c-hanging-braces-alist     . ((substatement-open before after)
+				    (arglist-cont-nonempty)))
      (c-offsets-alist . ((topmost-intro        . 0)
 			 (substatement         . +)
 			 (substatement-open    . 0)
                          (case-label           . +)
                          (access-label         . -)
-                         (inclass              . ++)
-			 (inline-open          . 0)
-			 (arglist-cont-nonempty))))
+                         (inclass              . +)
+			 (inline-open          . 0))))
 
     ("linux"
      (c-basic-offset  . 8)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* For 23.1 release ... please. (Was: Re: lisp/progmodes/cc-styles.el indentation broken in ellemtel mode)
  2008-07-17  0:53   ` Joachim Nilsson
@ 2008-07-27 17:37     ` Joachim Nilsson
  2008-07-31 14:02       ` For 23.1 release ... please Chong Yidong
  2008-08-01 10:38       ` For 23.1 release ... please. (Was: Re: lisp/progmodes/cc-styles.el indentation broken in ellemtel mode) Andrew W. Nosenko
  0 siblings, 2 replies; 10+ messages in thread
From: Joachim Nilsson @ 2008-07-27 17:37 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

PING?

This patch, now with a ChangeLog entry, could be quite useful to get
into the release. 

Regards
 /Jocke

Joachim Nilsson wrote, on 07/17/2008 02:53 AM:
> On Wed, Jul 16, 2008 at 06:25:55PM +0300, Andrew W. Nosenko wrote:
>   
>> On Tue, Jul 15, 2008 at 3:44 PM, Joachim Nilsson <crash@vmlinux.org> wrote:
>>     
>>> The Ellemtel C/C++ indentation engine has been broken on trunk since
>>> around March.
>>>       
>> Beside removing (arglist-cont-nonempty) from the c-offsets-alist, you
>> need add it to the c-hanging-braces-alist, just like it done for all
>> other styles.  IMHO, current difference of "ellemtel" from an other
>> styles was just a typo.
>>     
>
> Yep, that seems about right.  Attached is a revised patch.
>
> Regards
>  /Jocke
>   


[-- Attachment #2: cc-styles.diff --]
[-- Type: text/plain, Size: 1353 bytes --]

--- lisp/ChangeLog	27 Jul 2008 02:28:46 -0000	1.14226
+++ lisp/ChangeLog	27 Jul 2008 17:32:00 -0000
@@ -1,3 +1,9 @@
+2008-07-27  Joachim Nilsson  <joachim.nilsson@member.fsf.org>
+
+	* progmodes/cc-styles.el: For the Ellemtel style, move
+	the (arglist-cont-nonempty) from c-offsets-alist to
+	c-hanging-braces-alist like other styles already have.
+
 2008-07-26  Adrian Robert  <Adrian.B.Robert@gmail.com>
 
 	* term/ns-win.el (ns-extended-platform-support-mode): Get rid of
--- lisp/progmodes/cc-styles.el	6 May 2008 07:18:15 -0000	1.51
+++ lisp/progmodes/cc-styles.el	17 Jul 2008 00:45:35 -0000
@@ -162,15 +162,15 @@
     ("ellemtel"
      (c-basic-offset . 3)
      (c-comment-only-line-offset . 0)
-     (c-hanging-braces-alist     . ((substatement-open before after)))
+     (c-hanging-braces-alist     . ((substatement-open before after)
+				    (arglist-cont-nonempty)))
      (c-offsets-alist . ((topmost-intro        . 0)
 			 (substatement         . +)
 			 (substatement-open    . 0)
                          (case-label           . +)
                          (access-label         . -)
-                         (inclass              . ++)
-			 (inline-open          . 0)
-			 (arglist-cont-nonempty))))
+                         (inclass              . +)
+			 (inline-open          . 0))))
 
     ("linux"
      (c-basic-offset  . 8)

[-- Attachment #3: joachim_nilsson.vcf --]
[-- Type: text/x-vcard, Size: 167 bytes --]

begin:vcard
fn:Joachim Nilsson
n:Nilsson;Joachim
email;internet:joachim.nilsson@vmlinux.org
x-mozilla-html:TRUE
url:http://vmlinux.org/joachim/
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: For 23.1 release ... please.
  2008-07-27 17:37     ` For 23.1 release ... please. (Was: Re: lisp/progmodes/cc-styles.el indentation broken in ellemtel mode) Joachim Nilsson
@ 2008-07-31 14:02       ` Chong Yidong
  2008-07-31 14:08         ` Eric Lilja
  2008-08-01 10:38       ` For 23.1 release ... please. (Was: Re: lisp/progmodes/cc-styles.el indentation broken in ellemtel mode) Andrew W. Nosenko
  1 sibling, 1 reply; 10+ messages in thread
From: Chong Yidong @ 2008-07-31 14:02 UTC (permalink / raw)
  To: Joachim Nilsson; +Cc: 113-done, emacs-devel

Joachim Nilsson <joachim.nilsson@vmlinux.org> writes:

> PING?
>
> This patch, now with a ChangeLog entry, could be quite useful to get
> into the release. 

Checked in.  Thanks.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: For 23.1 release ... please.
  2008-07-31 14:02       ` For 23.1 release ... please Chong Yidong
@ 2008-07-31 14:08         ` Eric Lilja
  2008-07-31 14:24           ` Chong Yidong
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Lilja @ 2008-07-31 14:08 UTC (permalink / raw)
  To: emacs-devel

Chong Yidong wrote:
> Joachim Nilsson <joachim.nilsson@vmlinux.org> writes:
> 
>> PING?
>>
>> This patch, now with a ChangeLog entry, could be quite useful to get
>> into the release. 
> 
> Checked in.  Thanks.
> 
> 
> 

Isn't this bug also present on the 22-branch? I usually stay with the 
trunk but when I compiled it a few days ago it was unfortunately too 
slow (yes, I'm on Windows for this project) so I performed a checkout 
from the 22-branch instead and built and used that and I noticed I got 
this behaviour in a C++ function definition:
void TransparentBlit(HBITMAP bitmap, HDC hdc, int nXDest, int nYDest,
int nWidth, int nHeight, int nXSrc, int nYSrc)
when I was expecting this:
void TransparentBlit(HBITMAP bitmap, HDC hdc, int nXDest, int nYDest,
                      int nWidth, int nHeight, int nXSrc, int nYSrc)

Hope the leading space on my last snippest is preserved when posting...

- Eric





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: For 23.1 release ... please.
  2008-07-31 14:08         ` Eric Lilja
@ 2008-07-31 14:24           ` Chong Yidong
  2008-08-01  5:19             ` Joachim Nilsson
  0 siblings, 1 reply; 10+ messages in thread
From: Chong Yidong @ 2008-07-31 14:24 UTC (permalink / raw)
  To: Eric Lilja; +Cc: emacs-devel

Eric Lilja <mindcooler@gmail.com> writes:

> Isn't this bug also present on the 22-branch?

I've checked it into the branch as well.

Thanks.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: For 23.1 release ... please.
  2008-07-31 14:24           ` Chong Yidong
@ 2008-08-01  5:19             ` Joachim Nilsson
  2008-08-01 10:07               ` Eric Lilja
  0 siblings, 1 reply; 10+ messages in thread
From: Joachim Nilsson @ 2008-08-01  5:19 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Eric Lilja, emacs-devel

On Thu, Jul 31, 2008 at 10:24:46AM -0400, Chong Yidong wrote:
> Eric Lilja <mindcooler@gmail.com> writes:
> > Isn't this bug also present on the 22-branch?
> I've checked it into the branch as well.

Verified both branch and trunk on GNU/Linux.  The branch was
verified --with-x-toolkit=gtk and trunk used default configure.

Eric: Is it possible for you test this on Windows?  I don't 
have windows so I cannot.


Regards
 /Jocke

--  
Joachim Nilsson :: <joachim AT vmlinux DOT org>
+46(0)21-123348 :: <http://vmlinux.org/joachim>




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: For 23.1 release ... please.
  2008-08-01  5:19             ` Joachim Nilsson
@ 2008-08-01 10:07               ` Eric Lilja
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Lilja @ 2008-08-01 10:07 UTC (permalink / raw)
  To: emacs-devel

Joachim Nilsson wrote:
> On Thu, Jul 31, 2008 at 10:24:46AM -0400, Chong Yidong wrote:
>> Eric Lilja <mindcooler@gmail.com> writes:
>>> Isn't this bug also present on the 22-branch?
>> I've checked it into the branch as well.
> 
> Verified both branch and trunk on GNU/Linux.  The branch was
> verified --with-x-toolkit=gtk and trunk used default configure.
> 
> Eric: Is it possible for you test this on Windows?  I don't 
> have windows so I cannot.

I have tested it on the 22-branch on Windows and the bug has indeed been 
fixed. Thanks!

> 
> 
> Regards
>  /Jocke
> 
> --  
> Joachim Nilsson :: <joachim AT vmlinux DOT org>
> +46(0)21-123348 :: <http://vmlinux.org/joachim>
> 
> 
> 





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: For 23.1 release ... please. (Was: Re: lisp/progmodes/cc-styles.el indentation broken in ellemtel mode)
  2008-07-27 17:37     ` For 23.1 release ... please. (Was: Re: lisp/progmodes/cc-styles.el indentation broken in ellemtel mode) Joachim Nilsson
  2008-07-31 14:02       ` For 23.1 release ... please Chong Yidong
@ 2008-08-01 10:38       ` Andrew W. Nosenko
  1 sibling, 0 replies; 10+ messages in thread
From: Andrew W. Nosenko @ 2008-08-01 10:38 UTC (permalink / raw)
  To: Joachim Nilsson; +Cc: emacs-devel

2008/7/27 Joachim Nilsson <joachim.nilsson@vmlinux.org>:
> PING?
>
> This patch, now with a ChangeLog entry, could be quite useful to get
> into the release.
>
> Regards
>  /Jocke
>
> Joachim Nilsson wrote, on 07/17/2008 02:53 AM:
>> On Wed, Jul 16, 2008 at 06:25:55PM +0300, Andrew W. Nosenko wrote:
>>
>>> On Tue, Jul 15, 2008 at 3:44 PM, Joachim Nilsson <crash@vmlinux.org> wrote:
>>>
>>>> The Ellemtel C/C++ indentation engine has been broken on trunk since
>>>> around March.
>>>>
>>> Beside removing (arglist-cont-nonempty) from the c-offsets-alist, you
>>> need add it to the c-hanging-braces-alist, just like it done for all
>>> other styles.  IMHO, current difference of "ellemtel" from an other
>>> styles was just a typo.
>>>
>>
>> Yep, that seems about right.  Attached is a revised patch.
>>
>> Regards
>>  /Jocke
>>
>
>
> --- lisp/ChangeLog      27 Jul 2008 02:28:46 -0000      1.14226
> +++ lisp/ChangeLog      27 Jul 2008 17:32:00 -0000
> @@ -1,3 +1,9 @@
> +2008-07-27  Joachim Nilsson  <joachim.nilsson@member.fsf.org>
> +
> +       * progmodes/cc-styles.el: For the Ellemtel style, move
> +       the (arglist-cont-nonempty) from c-offsets-alist to
> +       c-hanging-braces-alist like other styles already have.
> +
>  2008-07-26  Adrian Robert  <Adrian.B.Robert@gmail.com>
>
>        * term/ns-win.el (ns-extended-platform-support-mode): Get rid of
> --- lisp/progmodes/cc-styles.el 6 May 2008 07:18:15 -0000       1.51
> +++ lisp/progmodes/cc-styles.el 17 Jul 2008 00:45:35 -0000
> @@ -162,15 +162,15 @@
>     ("ellemtel"
>      (c-basic-offset . 3)
>      (c-comment-only-line-offset . 0)
> -     (c-hanging-braces-alist     . ((substatement-open before after)))
> +     (c-hanging-braces-alist     . ((substatement-open before after)
> +                                   (arglist-cont-nonempty)))
>      (c-offsets-alist . ((topmost-intro        . 0)
>                         (substatement         . +)
>                         (substatement-open    . 0)
>                          (case-label           . +)
>                          (access-label         . -)
> -                         (inclass              . ++)
> -                        (inline-open          . 0)
> -                        (arglist-cont-nonempty))))
> +                         (inclass              . +)
> +                        (inline-open          . 0))))
>
>     ("linux"
>      (c-basic-offset  . 8)
>
>

Your patch changes 'inclass' from
    (inclass . ++)
to
    (inclass . +)

Is it intentional?

-- 
Andrew W. Nosenko <andrew.w.nosenko@gmail.com>




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-08-01 10:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-15 12:44 lisp/progmodes/cc-styles.el indentation broken in ellemtel mode Joachim Nilsson
2008-07-16 15:25 ` Andrew W. Nosenko
2008-07-17  0:53   ` Joachim Nilsson
2008-07-27 17:37     ` For 23.1 release ... please. (Was: Re: lisp/progmodes/cc-styles.el indentation broken in ellemtel mode) Joachim Nilsson
2008-07-31 14:02       ` For 23.1 release ... please Chong Yidong
2008-07-31 14:08         ` Eric Lilja
2008-07-31 14:24           ` Chong Yidong
2008-08-01  5:19             ` Joachim Nilsson
2008-08-01 10:07               ` Eric Lilja
2008-08-01 10:38       ` For 23.1 release ... please. (Was: Re: lisp/progmodes/cc-styles.el indentation broken in ellemtel mode) Andrew W. Nosenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).