all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#681: Wrong C++ indentation in batch mode
@ 2008-08-09 15:26 Vivien Mallet
  2008-08-10 16:42 ` OFFICE ZERO
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Vivien Mallet @ 2008-08-09 15:26 UTC (permalink / raw)
  To: bug-gnu-emacs

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

	Hello,

	The indentation in C++ mode does not seem to work properly in batch mode with 
the following code (indented in interactive mode):
"""
template <class A, class B>
Derived<A, B>::Derived():
  Base<A,
       B>() // Problem: wrong indentation in batch mode.
{
}
"""

	Now, define the Lisp function:
(defun cpp_indent ()
  (c-set-style "gnu")
  (c++-mode)
  (indent-region (point-min) (point-max) ())
  (save-buffer)
  )
	And apply it the previous function. It will result in:
"""
template <class A, class B>
Derived<A, B>::Derived():
  Base<A,
  B>() // Problem: wrong indentation in batch mode.
{
}
"""
	which is inconsistent with the interactive and is not, I presume, the 
targeted result.
	I found the problem in Emacs 23.0.60.1 (emacs snapshot in Kubuntu 8.04) and 
in Emacs 22.1.3. It does not appear in Emacs 21.4.1 (Debian Etch).


	Just an unrelated note about the indentation. I found a difference between the 
two latest versions I mentioned and the version 21.4.1. This code (indented 
with Emacs 22+):
"""
template <class A, class B>
Derived0<A, B>::Derived0():
  Base<A, B>
  ()
{
}
"""
	is indented by Emacs 21.4.1 as
"""
template <class A, class B>
Derived0<A, B>::Derived0():
  Base<A, B>
()
{
}
"""
	I like the new indentation better, and I suppose it was an improvement 
introduced in the latest versions. I mention it, just in case...


	I attach three files:
- test.cxx: a file to be indented (but already well indented);
- test-wrong_indentation.cxx: test.cxx after indentation in batch mode with 
Emacs 22+;
- cpp_indent.lisp: the indentation function. Used in: "emacs -batch test.cxx -
l cpp_indent.lisp -f cpp_indent".


	Thank you for your great work,
	Vivien Mallet.

[-- Attachment #2: test-wrong_indentation.cxx --]
[-- Type: text/x-c++src, Size: 251 bytes --]

template <class A, class B>
Derived<A, B>::Derived():
  Base<A,
  B>() // Problem: wrong indentation in batch mode.
{
}


template <class A, class B>
Derived0<A, B>::Derived0():
  Base<A, B>
  () // Just a note: Emacs 21 did not indent like that.
{
}

[-- Attachment #3: test.cxx --]
[-- Type: text/x-c++src, Size: 256 bytes --]

template <class A, class B>
Derived<A, B>::Derived():
  Base<A,
       B>() // Problem: wrong indentation in batch mode.
{
}


template <class A, class B>
Derived0<A, B>::Derived0():
  Base<A, B>
  () // Just a note: Emacs 21 did not indent like that.
{
}

[-- Attachment #4: cpp_indent.lisp --]
[-- Type: text/plain, Size: 121 bytes --]

(defun cpp_indent ()
  (c-set-style "gnu")
  (c++-mode)
  (indent-region (point-min) (point-max) ())
  (save-buffer)
  )

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

* bug#681: Wrong C++ indentation in batch mode
  2008-08-09 15:26 bug#681: Wrong C++ indentation in batch mode Vivien Mallet
@ 2008-08-10 16:42 ` OFFICE ZERO
       [not found]   ` <handler.681.B681.12183870793367.ackinfo@emacsbugs.donarmstrong.com>
  2008-08-10 17:01 ` bug#681: Wrong C++ indentation in batch mode OFFICE ZERO
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 20+ messages in thread
From: OFFICE ZERO @ 2008-08-10 16:42 UTC (permalink / raw)
  To: Vivien Mallet, 681

Do not send me any mail!
NO thank you!!




1----- Original Message ----- 
From: "Vivien Mallet" <Vivien.Mallet@inria.fr>
To: <bug-gnu-emacs@gnu.org>
Sent: Sunday, August 10, 2008 12:26 AM
Subject: bug#681: Wrong C++ indentation in batch mode


> Hello,
>
> The indentation in C++ mode does not seem to work properly in batch mode 
> with
> the following code (indented in interactive mode):
> """
> template <class A, class B>
> Derived<A, B>::Derived():
>  Base<A,
>       B>() // Problem: wrong indentation in batch mode.
> {
> }
> """
>
> Now, define the Lisp function:
> (defun cpp_indent ()
>  (c-set-style "gnu")
>  (c++-mode)
>  (indent-region (point-min) (point-max) ())
>  (save-buffer)
>  )
> And apply it the previous function. It will result in:
> """
> template <class A, class B>
> Derived<A, B>::Derived():
>  Base<A,
>  B>() // Problem: wrong indentation in batch mode.
> {
> }
> """
> which is inconsistent with the interactive and is not, I presume, the
> targeted result.
> I found the problem in Emacs 23.0.60.1 (emacs snapshot in Kubuntu 8.04) 
> and
> in Emacs 22.1.3. It does not appear in Emacs 21.4.1 (Debian Etch).
>
>
> Just an unrelated note about the indentation. I found a difference between 
> the
> two latest versions I mentioned and the version 21.4.1. This code 
> (indented
> with Emacs 22+):
> """
> template <class A, class B>
> Derived0<A, B>::Derived0():
>  Base<A, B>
>  ()
> {
> }
> """
> is indented by Emacs 21.4.1 as
> """
> template <class A, class B>
> Derived0<A, B>::Derived0():
>  Base<A, B>
> ()
> {
> }
> """
> I like the new indentation better, and I suppose it was an improvement
> introduced in the latest versions. I mention it, just in case...
>
>
> I attach three files:
> - test.cxx: a file to be indented (but already well indented);
> - test-wrong_indentation.cxx: test.cxx after indentation in batch mode 
> with
> Emacs 22+;
> - cpp_indent.lisp: the indentation function. Used in: "emacs -batch 
> test.cxx -
> l cpp_indent.lisp -f cpp_indent".
>
>
> Thank you for your great work,
> Vivien Mallet.
> 







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

* bug#681: Wrong C++ indentation in batch mode
  2008-08-09 15:26 bug#681: Wrong C++ indentation in batch mode Vivien Mallet
  2008-08-10 16:42 ` OFFICE ZERO
@ 2008-08-10 17:01 ` OFFICE ZERO
       [not found]   ` <handler.681.B681.12183876726365.ackinfo@emacsbugs.donarmstrong.com>
  2008-08-10 17:11 ` bug#681: Wrong C++ indentation in batch mode OFFICE ZERO
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 20+ messages in thread
From: OFFICE ZERO @ 2008-08-10 17:01 UTC (permalink / raw)
  To: Vivien Mallet, 681

Do not send me any mail!
NO thank you!!

----- Original Message ----- 
From: "Vivien Mallet" <Vivien.Mallet@inria.fr>
To: <bug-gnu-emacs@gnu.org>
Sent: Sunday, August 10, 2008 12:26 AM
Subject: bug#681: Wrong C++ indentation in batch mode


> Hello,
>
> The indentation in C++ mode does not seem to work properly in batch mode 
> with
> the following code (indented in interactive mode):
> """
> template <class A, class B>
> Derived<A, B>::Derived():
>  Base<A,
>       B>() // Problem: wrong indentation in batch mode.
> {
> }
> """
>
> Now, define the Lisp function:
> (defun cpp_indent ()
>  (c-set-style "gnu")
>  (c++-mode)
>  (indent-region (point-min) (point-max) ())
>  (save-buffer)
>  )
> And apply it the previous function. It will result in:
> """
> template <class A, class B>
> Derived<A, B>::Derived():
>  Base<A,
>  B>() // Problem: wrong indentation in batch mode.
> {
> }
> """
> which is inconsistent with the interactive and is not, I presume, the
> targeted result.
> I found the problem in Emacs 23.0.60.1 (emacs snapshot in Kubuntu 8.04) 
> and
> in Emacs 22.1.3. It does not appear in Emacs 21.4.1 (Debian Etch).
>
>
> Just an unrelated note about the indentation. I found a difference between 
> the
> two latest versions I mentioned and the version 21.4.1. This code 
> (indented
> with Emacs 22+):
> """
> template <class A, class B>
> Derived0<A, B>::Derived0():
>  Base<A, B>
>  ()
> {
> }
> """
> is indented by Emacs 21.4.1 as
> """
> template <class A, class B>
> Derived0<A, B>::Derived0():
>  Base<A, B>
> ()
> {
> }
> """
> I like the new indentation better, and I suppose it was an improvement
> introduced in the latest versions. I mention it, just in case...
>
>
> I attach three files:
> - test.cxx: a file to be indented (but already well indented);
> - test-wrong_indentation.cxx: test.cxx after indentation in batch mode 
> with
> Emacs 22+;
> - cpp_indent.lisp: the indentation function. Used in: "emacs -batch 
> test.cxx -
> l cpp_indent.lisp -f cpp_indent".
>
>
> Thank you for your great work,
> Vivien Mallet.
> 







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

* bug#681: Info received (bug#681: Wrong C++ indentation in batch mode)
       [not found]   ` <handler.681.B681.12183870793367.ackinfo@emacsbugs.donarmstrong.com>
@ 2008-08-10 17:10     ` OFFICE ZERO
       [not found]       ` <handler.681.B681.121838828710091.ackinfo@emacsbugs.donarmstrong.com>
  0 siblings, 1 reply; 20+ messages in thread
From: OFFICE ZERO @ 2008-08-10 17:10 UTC (permalink / raw)
  To: 681

Do not send me any mail!
NO thank you!!

----- Original Message ----- 
From: "Emacs bug Tracking System" <don@donarmstrong.com>
To: "OFFICE ZERO" <hi-oh230@air.ocn.ne.jp>
Sent: Monday, August 11, 2008 2:00 AM
Subject: bug#681: Info received (bug#681: Wrong C++ indentation in batch 
mode)



Thank you for the additional information you have supplied regarding
this bug report.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 Emacs Bugs <bug-gnu-emacs@gnu.org>

If you wish to submit further information on this problem, please
send it to 681@emacsbugs.donarmstrong.com, as before.

Please do not send mail to don@donarmstrong.com unless you wish
to report a problem with the Bug-tracking system.


-- 
681: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=681
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems 







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

* bug#681: Wrong C++ indentation in batch mode
  2008-08-09 15:26 bug#681: Wrong C++ indentation in batch mode Vivien Mallet
  2008-08-10 16:42 ` OFFICE ZERO
  2008-08-10 17:01 ` bug#681: Wrong C++ indentation in batch mode OFFICE ZERO
@ 2008-08-10 17:11 ` OFFICE ZERO
       [not found]   ` <handler.681.B681.121838833410165.ackinfo@emacsbugs.donarmstrong.com>
  2008-08-10 17:12 ` bug#681: Wrong C++ indentation in batch mode OFFICE ZERO
  2014-01-07 10:26 ` bug#681: Wrong C++ indentation in batch mode Bastien Guerry
  4 siblings, 1 reply; 20+ messages in thread
From: OFFICE ZERO @ 2008-08-10 17:11 UTC (permalink / raw)
  To: Vivien Mallet, 681

Do not send me any mail!
NO thank you!!

----- Original Message ----- 
From: "Vivien Mallet" <Vivien.Mallet@inria.fr>
To: <bug-gnu-emacs@gnu.org>
Sent: Sunday, August 10, 2008 12:26 AM
Subject: bug#681: Wrong C++ indentation in batch mode


> Hello,
>
> The indentation in C++ mode does not seem to work properly in batch mode 
> with
> the following code (indented in interactive mode):
> """
> template <class A, class B>
> Derived<A, B>::Derived():
>  Base<A,
>       B>() // Problem: wrong indentation in batch mode.
> {
> }
> """
>
> Now, define the Lisp function:
> (defun cpp_indent ()
>  (c-set-style "gnu")
>  (c++-mode)
>  (indent-region (point-min) (point-max) ())
>  (save-buffer)
>  )
> And apply it the previous function. It will result in:
> """
> template <class A, class B>
> Derived<A, B>::Derived():
>  Base<A,
>  B>() // Problem: wrong indentation in batch mode.
> {
> }
> """
> which is inconsistent with the interactive and is not, I presume, the
> targeted result.
> I found the problem in Emacs 23.0.60.1 (emacs snapshot in Kubuntu 8.04) 
> and
> in Emacs 22.1.3. It does not appear in Emacs 21.4.1 (Debian Etch).
>
>
> Just an unrelated note about the indentation. I found a difference between 
> the
> two latest versions I mentioned and the version 21.4.1. This code 
> (indented
> with Emacs 22+):
> """
> template <class A, class B>
> Derived0<A, B>::Derived0():
>  Base<A, B>
>  ()
> {
> }
> """
> is indented by Emacs 21.4.1 as
> """
> template <class A, class B>
> Derived0<A, B>::Derived0():
>  Base<A, B>
> ()
> {
> }
> """
> I like the new indentation better, and I suppose it was an improvement
> introduced in the latest versions. I mention it, just in case...
>
>
> I attach three files:
> - test.cxx: a file to be indented (but already well indented);
> - test-wrong_indentation.cxx: test.cxx after indentation in batch mode 
> with
> Emacs 22+;
> - cpp_indent.lisp: the indentation function. Used in: "emacs -batch 
> test.cxx -
> l cpp_indent.lisp -f cpp_indent".
>
>
> Thank you for your great work,
> Vivien Mallet.
> 







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

* bug#681: Wrong C++ indentation in batch mode
  2008-08-09 15:26 bug#681: Wrong C++ indentation in batch mode Vivien Mallet
                   ` (2 preceding siblings ...)
  2008-08-10 17:11 ` bug#681: Wrong C++ indentation in batch mode OFFICE ZERO
@ 2008-08-10 17:12 ` OFFICE ZERO
       [not found]   ` <handler.681.B681.121838833410168.ackinfo@emacsbugs.donarmstrong.com>
  2014-01-07 10:26 ` bug#681: Wrong C++ indentation in batch mode Bastien Guerry
  4 siblings, 1 reply; 20+ messages in thread
From: OFFICE ZERO @ 2008-08-10 17:12 UTC (permalink / raw)
  To: Vivien Mallet, 681

Do not send me any mail!
NO thank you!!

----- Original Message ----- 
From: "Vivien Mallet" <Vivien.Mallet@inria.fr>
To: <bug-gnu-emacs@gnu.org>
Sent: Sunday, August 10, 2008 12:26 AM
Subject: bug#681: Wrong C++ indentation in batch mode


> Hello,
>
> The indentation in C++ mode does not seem to work properly in batch mode 
> with
> the following code (indented in interactive mode):
> """
> template <class A, class B>
> Derived<A, B>::Derived():
>  Base<A,
>       B>() // Problem: wrong indentation in batch mode.
> {
> }
> """
>
> Now, define the Lisp function:
> (defun cpp_indent ()
>  (c-set-style "gnu")
>  (c++-mode)
>  (indent-region (point-min) (point-max) ())
>  (save-buffer)
>  )
> And apply it the previous function. It will result in:
> """
> template <class A, class B>
> Derived<A, B>::Derived():
>  Base<A,
>  B>() // Problem: wrong indentation in batch mode.
> {
> }
> """
> which is inconsistent with the interactive and is not, I presume, the
> targeted result.
> I found the problem in Emacs 23.0.60.1 (emacs snapshot in Kubuntu 8.04) 
> and
> in Emacs 22.1.3. It does not appear in Emacs 21.4.1 (Debian Etch).
>
>
> Just an unrelated note about the indentation. I found a difference between 
> the
> two latest versions I mentioned and the version 21.4.1. This code 
> (indented
> with Emacs 22+):
> """
> template <class A, class B>
> Derived0<A, B>::Derived0():
>  Base<A, B>
>  ()
> {
> }
> """
> is indented by Emacs 21.4.1 as
> """
> template <class A, class B>
> Derived0<A, B>::Derived0():
>  Base<A, B>
> ()
> {
> }
> """
> I like the new indentation better, and I suppose it was an improvement
> introduced in the latest versions. I mention it, just in case...
>
>
> I attach three files:
> - test.cxx: a file to be indented (but already well indented);
> - test-wrong_indentation.cxx: test.cxx after indentation in batch mode 
> with
> Emacs 22+;
> - cpp_indent.lisp: the indentation function. Used in: "emacs -batch 
> test.cxx -
> l cpp_indent.lisp -f cpp_indent".
>
>
> Thank you for your great work,
> Vivien Mallet.
> 







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

* bug#681: Info received (bug#681: Wrong C++ indentation in batch mode)
       [not found]   ` <handler.681.B681.121838833410168.ackinfo@emacsbugs.donarmstrong.com>
@ 2008-08-11  1:07     ` OFFICE ZERO
  0 siblings, 0 replies; 20+ messages in thread
From: OFFICE ZERO @ 2008-08-11  1:07 UTC (permalink / raw)
  To: 681

Do not send me any mail  !
no thank you






----- Original Message ----- 
From: "Emacs bug Tracking System" <don@donarmstrong.com>
To: "OFFICE ZERO" <hi-oh230@air.ocn.ne.jp>
Sent: Monday, August 11, 2008 2:20 AM
Subject: bug#681: Info received (bug#681: Wrong C++ indentation in batch 
mode)



Thank you for the additional information you have supplied regarding
this bug report.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 Emacs Bugs <bug-gnu-emacs@gnu.org>

If you wish to submit further information on this problem, please
send it to 681@emacsbugs.donarmstrong.com, as before.

Please do not send mail to don@donarmstrong.com unless you wish
to report a problem with the Bug-tracking system.


-- 
681: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=681
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems 







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

* bug#681: Info received (bug#681: Wrong C++ indentation in batch mode)
       [not found]   ` <handler.681.B681.121838833410165.ackinfo@emacsbugs.donarmstrong.com>
@ 2008-08-11  1:16     ` OFFICE ZERO
  0 siblings, 0 replies; 20+ messages in thread
From: OFFICE ZERO @ 2008-08-11  1:16 UTC (permalink / raw)
  To: 681

Do not send me any mail !
No thank you !!

----- Original Message ----- 
From: "Emacs bug Tracking System" <don@donarmstrong.com>
To: "OFFICE ZERO" <hi-oh230@air.ocn.ne.jp>
Sent: Monday, August 11, 2008 2:20 AM
Subject: bug#681: Info received (bug#681: Wrong C++ indentation in batch 
mode)



Thank you for the additional information you have supplied regarding
this bug report.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 Emacs Bugs <bug-gnu-emacs@gnu.org>

If you wish to submit further information on this problem, please
send it to 681@emacsbugs.donarmstrong.com, as before.

Please do not send mail to don@donarmstrong.com unless you wish
to report a problem with the Bug-tracking system.


-- 
681: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=681
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems 







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

* bug#681: Info received (bug#681: Info received (bug#681: Wrong C++ indentation in batch mode))
       [not found]       ` <handler.681.B681.121838828710091.ackinfo@emacsbugs.donarmstrong.com>
@ 2008-08-11  1:17         ` OFFICE ZERO
  0 siblings, 0 replies; 20+ messages in thread
From: OFFICE ZERO @ 2008-08-11  1:17 UTC (permalink / raw)
  To: 681

Do not send me any mail !
No thank you !!

----- Original Message ----- 
From: "Emacs bug Tracking System" <don@donarmstrong.com>
To: "OFFICE ZERO" <hi-oh230@air.ocn.ne.jp>
Sent: Monday, August 11, 2008 2:20 AM
Subject: bug#681: Info received (bug#681: Info received (bug#681: Wrong C++ 
indentation in batch mode))



Thank you for the additional information you have supplied regarding
this bug report.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 Emacs Bugs <bug-gnu-emacs@gnu.org>

If you wish to submit further information on this problem, please
send it to 681@emacsbugs.donarmstrong.com, as before.

Please do not send mail to don@donarmstrong.com unless you wish
to report a problem with the Bug-tracking system.


-- 
681: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=681
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems 







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

* bug#681: Info received (bug#681: Wrong C++ indentation in batch mode)
       [not found]   ` <handler.681.B681.12183876726365.ackinfo@emacsbugs.donarmstrong.com>
@ 2008-08-11  1:17     ` OFFICE ZERO
  0 siblings, 0 replies; 20+ messages in thread
From: OFFICE ZERO @ 2008-08-11  1:17 UTC (permalink / raw)
  To: 681

Do not send me any mail !
No thank you !!

----- Original Message ----- 
From: "Emacs bug Tracking System" <don@donarmstrong.com>
To: "OFFICE ZERO" <hi-oh230@air.ocn.ne.jp>
Sent: Monday, August 11, 2008 2:10 AM
Subject: bug#681: Info received (bug#681: Wrong C++ indentation in batch 
mode)



Thank you for the additional information you have supplied regarding
this bug report.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 Emacs Bugs <bug-gnu-emacs@gnu.org>

If you wish to submit further information on this problem, please
send it to 681@emacsbugs.donarmstrong.com, as before.

Please do not send mail to don@donarmstrong.com unless you wish
to report a problem with the Bug-tracking system.


-- 
681: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=681
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems 







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

* bug#681: Wrong C++ indentation in batch mode
  2008-08-09 15:26 bug#681: Wrong C++ indentation in batch mode Vivien Mallet
                   ` (3 preceding siblings ...)
  2008-08-10 17:12 ` bug#681: Wrong C++ indentation in batch mode OFFICE ZERO
@ 2014-01-07 10:26 ` Bastien Guerry
  2014-01-07 15:36   ` Vivien Mallet
  4 siblings, 1 reply; 20+ messages in thread
From: Bastien Guerry @ 2014-01-07 10:26 UTC (permalink / raw)
  To: Vivien Mallet; +Cc: 681-done

Hi Vivien,

Vivien Mallet <Vivien.Mallet@inria.fr> writes:

> 	The indentation in C++ mode does not seem to work properly in batch mode with 
> the following code (indented in interactive mode):
> """
> template <class A, class B>
> Derived<A, B>::Derived():
>   Base<A,
>        B>() // Problem: wrong indentation in batch mode.
> {
> }
> """
>
> 	Now, define the Lisp function:
> (defun cpp_indent ()
>   (c-set-style "gnu")
>   (c++-mode)
>   (indent-region (point-min) (point-max) ())
>   (save-buffer)
>   )
> 	And apply it the previous function. It will result in:
> """
> template <class A, class B>
> Derived<A, B>::Derived():
>   Base<A,
>   B>() // Problem: wrong indentation in batch mode.
> {
> }
> """
> 	which is inconsistent with the interactive and is not, I presume, the 
> targeted result.

I can't reproduce this.  I get the correct indentation.

I'm closing this bug report, feel free to reopen it if needed.

-- 
 Bastien





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

* bug#681: Wrong C++ indentation in batch mode
  2014-01-07 10:26 ` bug#681: Wrong C++ indentation in batch mode Bastien Guerry
@ 2014-01-07 15:36   ` Vivien Mallet
  2014-01-07 16:09     ` Bastien
  0 siblings, 1 reply; 20+ messages in thread
From: Vivien Mallet @ 2014-01-07 15:36 UTC (permalink / raw)
  To: Bastien Guerry; +Cc: 681-done

Hi Bastien,

Bastien Guerry <bzg@altern.org> writes:
> I can't reproduce this.  I get the correct indentation.
>
> I'm closing this bug report, feel free to reopen it if needed.

Under Emacs 24.3.1, I still get the same problem. Let me be a little bit
more specific. Create a file, say "test.cpp" with:

template <class A, class B>
Derived<A, B>::Derived():
  Base<A,
       B>() // Problem: wrong indentation in batch mode.
{
  int i:
}

This is what interactive mode gives after indentation.

Now, launch from command line:
\emacs -Q test.cpp --batch --eval="(defun cpp_indent () (c-set-style \"gnu\") (c++-mode) (indent-region (point-min) (point-max) ()) (save-buffer))" --eval="(cpp_indent)"

You should get:

template <class A, class B>
Derived<A, B>::Derived():
  Base<A,
  B>() // Problem: wrong indentation in batch mode.
{
  int i:
}

In addition, it seems that "c-set-style" is not honored. It may be
"bsd", "k&r", etc. without any difference.

Vivien.





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

* bug#681: Wrong C++ indentation in batch mode
  2014-01-07 15:36   ` Vivien Mallet
@ 2014-01-07 16:09     ` Bastien
  2015-12-29  1:18       ` Andrew Hyatt
  0 siblings, 1 reply; 20+ messages in thread
From: Bastien @ 2014-01-07 16:09 UTC (permalink / raw)
  To: Vivien Mallet; +Cc: 681

Hi Vivien,

Vivien Mallet <Vivien.Mallet@inria.fr> writes:

> Now, launch from command line:
> \emacs -Q test.cpp --batch --eval="(defun cpp_indent () (c-set-style \"gnu\") (c++-mode) (indent-region (point-min) (point-max) ()) (save-buffer))" --eval="(cpp_indent)"
>
> You should get:
>
> template <class A, class B>
> Derived<A, B>::Derived():
>   Base<A,
>   B>() // Problem: wrong indentation in batch mode.
> {
>   int i:
> }
>
> In addition, it seems that "c-set-style" is not honored. It may be
> "bsd", "k&r", etc. without any difference.

Mhh... yes, I see now.

I reopend the bug and will let someone more familiar
with the code fix it.

-- 
 Bastien





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

* bug#681: Wrong C++ indentation in batch mode
  2014-01-07 16:09     ` Bastien
@ 2015-12-29  1:18       ` Andrew Hyatt
  2015-12-29 22:02         ` Alan Mackenzie
  2016-01-04 23:16         ` Alan Mackenzie
  0 siblings, 2 replies; 20+ messages in thread
From: Andrew Hyatt @ 2015-12-29  1:18 UTC (permalink / raw)
  To: Bastien; +Cc: Vivien Mallet, 681


Bastien <bzg@altern.org> writes:

> Hi Vivien,
>
> Vivien Mallet <Vivien.Mallet@inria.fr> writes:
>
>> Now, launch from command line:
>> \emacs -Q test.cpp --batch --eval="(defun cpp_indent () (c-set-style \"gnu\") (c++-mode) (indent-region (point-min) (point-max) ()) (save-buffer))" --eval="(cpp_indent)"
>>
>> You should get:
>>
>> template <class A, class B>
>> Derived<A, B>::Derived():
>>   Base<A,
>>   B>() // Problem: wrong indentation in batch mode.
>> {
>>   int i:
>> }
>>
>> In addition, it seems that "c-set-style" is not honored. It may be
>> "bsd", "k&r", etc. without any difference.
>
> Mhh... yes, I see now.
>
> I reopend the bug and will let someone more familiar
> with the code fix it.

I'm not the one more familiar, but I just want to record that this still
reproduces on emacs 25.





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

* bug#681: Wrong C++ indentation in batch mode
  2015-12-29  1:18       ` Andrew Hyatt
@ 2015-12-29 22:02         ` Alan Mackenzie
  2016-01-04 23:16         ` Alan Mackenzie
  1 sibling, 0 replies; 20+ messages in thread
From: Alan Mackenzie @ 2015-12-29 22:02 UTC (permalink / raw)
  To: Andrew Hyatt; +Cc: Bastien, Vivien Mallet, 681

Hello, Andrew.

On Mon, Dec 28, 2015 at 08:18:02PM -0500, Andrew Hyatt wrote:

> Bastien <bzg@altern.org> writes:

> > Hi Vivien,

> > Vivien Mallet <Vivien.Mallet@inria.fr> writes:

> >> Now, launch from command line:
> >> \emacs -Q test.cpp --batch --eval="(defun cpp_indent () (c-set-style \"gnu\") (c++-mode) (indent-region (point-min) (point-max) ()) (save-buffer))" --eval="(cpp_indent)"

> >> You should get:

> >> template <class A, class B>
> >> Derived<A, B>::Derived():
> >>   Base<A,
> >>   B>() // Problem: wrong indentation in batch mode.
> >> {
> >>   int i:
> >> }

> >> In addition, it seems that "c-set-style" is not honored. It may be
> >> "bsd", "k&r", etc. without any difference.

> > Mhh... yes, I see now.

> > I reopend the bug and will let someone more familiar
> > with the code fix it.

> I'm not the one more familiar, but I just want to record that this still
> reproduces on emacs 25.

I started looking at this back in 2011, but got stuck.  I've still got my
notes from then.  I'll see if I can get this fixed now.

-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#681: Wrong C++ indentation in batch mode
  2015-12-29  1:18       ` Andrew Hyatt
  2015-12-29 22:02         ` Alan Mackenzie
@ 2016-01-04 23:16         ` Alan Mackenzie
  2016-01-26  4:46           ` Andrew Hyatt
  2016-02-06 12:05           ` Vivien Mallet
  1 sibling, 2 replies; 20+ messages in thread
From: Alan Mackenzie @ 2016-01-04 23:16 UTC (permalink / raw)
  To: Vivien Mallet; +Cc: Bastien, Andrew Hyatt, 681

Hello Vivien.

On Mon, Dec 28, 2015 at 08:18:02PM -0500, Andrew Hyatt wrote:

> Bastien <bzg@altern.org> writes:

> > Hi Vivien,

> > Vivien Mallet <Vivien.Mallet@inria.fr> writes:

> >> Now, launch from command line:
> >> \emacs -Q test.cpp --batch --eval="(defun cpp_indent () (c-set-style \"gnu\") (c++-mode) (indent-region (point-min) (point-max) ()) (save-buffer))" --eval="(cpp_indent)"

> >> You should get:

> >> template <class A, class B>
> >> Derived<A, B>::Derived():
> >>   Base<A,
> >>   B>() // Problem: wrong indentation in batch mode.
> >> {
> >>   int i:
> >> }

> >> In addition, it seems that "c-set-style" is not honored. It may be
> >> "bsd", "k&r", etc. without any difference.

> > Mhh... yes, I see now.

> > I reopend the bug and will let someone more familiar
> > with the code fix it.

> I'm not the one more familiar, but I just want to record that this still
> reproduces on emacs 25.

I've committed what I hope is a fix to the emacs-25 branch at savannah.
Sorry it's taken (a lot) longer than it should have done.

Would you please tell me what version of Emacs you're currently using,
and I will try to adapt the patch for that version.  Then I will ask you
to try out the patch and let me know whether or not there are still
errors.

Then, hopefully, we can close this bug.

-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#681: Wrong C++ indentation in batch mode
  2016-01-04 23:16         ` Alan Mackenzie
@ 2016-01-26  4:46           ` Andrew Hyatt
  2016-02-06 12:05           ` Vivien Mallet
  1 sibling, 0 replies; 20+ messages in thread
From: Andrew Hyatt @ 2016-01-26  4:46 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: Bastien, Vivien Mallet, 681

Alan Mackenzie <acm@muc.de> writes:

> Hello Vivien.
>
> On Mon, Dec 28, 2015 at 08:18:02PM -0500, Andrew Hyatt wrote:
>
>> Bastien <bzg@altern.org> writes:
>
>> > Hi Vivien,
>
>> > Vivien Mallet <Vivien.Mallet@inria.fr> writes:
>
>> >> Now, launch from command line:
>> >> \emacs -Q test.cpp --batch --eval="(defun cpp_indent () (c-set-style \"gnu\") (c++-mode) (indent-region (point-min) (point-max) ()) (save-buffer))" --eval="(cpp_indent)"
>
>> >> You should get:
>
>> >> template <class A, class B>
>> >> Derived<A, B>::Derived():
>> >>   Base<A,
>> >>   B>() // Problem: wrong indentation in batch mode.
>> >> {
>> >>   int i:
>> >> }
>
>> >> In addition, it seems that "c-set-style" is not honored. It may be
>> >> "bsd", "k&r", etc. without any difference.
>
>> > Mhh... yes, I see now.
>
>> > I reopend the bug and will let someone more familiar
>> > with the code fix it.
>
>> I'm not the one more familiar, but I just want to record that this still
>> reproduces on emacs 25.
>
> I've committed what I hope is a fix to the emacs-25 branch at savannah.
> Sorry it's taken (a lot) longer than it should have done.
>
> Would you please tell me what version of Emacs you're currently using,
> and I will try to adapt the patch for that version.  Then I will ask you
> to try out the patch and let me know whether or not there are still
> errors.
>
> Then, hopefully, we can close this bug.

Seeing as how there's no response, if you've fixed this bug (thanks,
BTW!), perhaps we should close it now?





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

* bug#681: Wrong C++ indentation in batch mode
  2016-01-04 23:16         ` Alan Mackenzie
  2016-01-26  4:46           ` Andrew Hyatt
@ 2016-02-06 12:05           ` Vivien Mallet
  2016-02-07 22:09             ` Alan Mackenzie
  1 sibling, 1 reply; 20+ messages in thread
From: Vivien Mallet @ 2016-02-06 12:05 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: Bastien, Andrew Hyatt, 681

Hello,

On Tue, Jan 05 2016, Alan Mackenzie wrote:
> I've committed what I hope is a fix to the emacs-25 branch at savannah.
> Sorry it's taken (a lot) longer than it should have done.

Sure, 7.5 years is a long time! But it is good to see this bug report
was not lost, contrary to other reports.

> Would you please tell me what version of Emacs you're currently using,
> and I will try to adapt the patch for that version.  Then I will ask you
> to try out the patch and let me know whether or not there are still
> errors.

My current version is 24.5.3.

I am not sure this is so useful that the fix is tested on this
version. Instead, I could check with the latest version in the branch
you mention. I have just tried to compile current version, but I got
this error

CC       callint.o
alloc.c:1137:1: error: static declaration of ?aligned_alloc? follows non-static declaration
 aligned_alloc (size_t alignment, size_t size)
 ^
In file included from alloc.c:31:0:
lisp.h:3779:14: note: previous declaration of ?aligned_alloc? was here
 extern void *aligned_alloc (size_t, size_t) ATTRIBUTE_MALLOC_SIZE ((2));

I do not have a lot of time to dig. So you might just mark the bug as
resolved!

Thank you,
Vivien.





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

* bug#681: Wrong C++ indentation in batch mode
  2016-02-06 12:05           ` Vivien Mallet
@ 2016-02-07 22:09             ` Alan Mackenzie
  2016-02-07 22:10               ` Vivien Mallet
  0 siblings, 1 reply; 20+ messages in thread
From: Alan Mackenzie @ 2016-02-07 22:09 UTC (permalink / raw)
  To: Vivien Mallet, 681-done; +Cc: Bastien, Andrew Hyatt

Hello, Vivien.

On Sat, Feb 06, 2016 at 01:05:48PM +0100, Vivien Mallet wrote:
> Hello,

> On Tue, Jan 05 2016, Alan Mackenzie wrote:
> > I've committed what I hope is a fix to the emacs-25 branch at savannah.
> > Sorry it's taken (a lot) longer than it should have done.

> Sure, 7.5 years is a long time! But it is good to see this bug report
> was not lost, contrary to other reports.

> > Would you please tell me what version of Emacs you're currently using,
> > and I will try to adapt the patch for that version.  Then I will ask you
> > to try out the patch and let me know whether or not there are still
> > errors.

> My current version is 24.5.3.

> I am not sure this is so useful that the fix is tested on this
> version. Instead, I could check with the latest version in the branch
> you mention. I have just tried to compile current version, but I got
> this error

> CC       callint.o
> alloc.c:1137:1: error: static declaration of ?aligned_alloc? follows non-static declaration
>  aligned_alloc (size_t alignment, size_t size)
>  ^
> In file included from alloc.c:31:0:
> lisp.h:3779:14: note: previous declaration of ?aligned_alloc? was here
>  extern void *aligned_alloc (size_t, size_t) ATTRIBUTE_MALLOC_SIZE ((2));

> I do not have a lot of time to dig. So you might just mark the bug as
> resolved!

OK, then, I'll do that!

Thanks again for the bug report, all these years ago.

> Thank you,
> Vivien.

-- 
Alan Mackenzie (Nuremberg, Germany).





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

* bug#681: Wrong C++ indentation in batch mode
  2016-02-07 22:09             ` Alan Mackenzie
@ 2016-02-07 22:10               ` Vivien Mallet
  0 siblings, 0 replies; 20+ messages in thread
From: Vivien Mallet @ 2016-02-07 22:10 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: Bastien, 681-done, Andrew Hyatt

Alan,

On Sun, Feb 07 2016, Alan Mackenzie wrote:
> Thanks again for the bug report, all these years ago.

Thank you for fixing the bug!

Best,
Vivien.





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

end of thread, other threads:[~2016-02-07 22:10 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-09 15:26 bug#681: Wrong C++ indentation in batch mode Vivien Mallet
2008-08-10 16:42 ` OFFICE ZERO
     [not found]   ` <handler.681.B681.12183870793367.ackinfo@emacsbugs.donarmstrong.com>
2008-08-10 17:10     ` bug#681: Info received (bug#681: Wrong C++ indentation in batch mode) OFFICE ZERO
     [not found]       ` <handler.681.B681.121838828710091.ackinfo@emacsbugs.donarmstrong.com>
2008-08-11  1:17         ` bug#681: Info received (bug#681: Info received (bug#681: Wrong C++ indentation in batch mode)) OFFICE ZERO
2008-08-10 17:01 ` bug#681: Wrong C++ indentation in batch mode OFFICE ZERO
     [not found]   ` <handler.681.B681.12183876726365.ackinfo@emacsbugs.donarmstrong.com>
2008-08-11  1:17     ` bug#681: Info received (bug#681: Wrong C++ indentation in batch mode) OFFICE ZERO
2008-08-10 17:11 ` bug#681: Wrong C++ indentation in batch mode OFFICE ZERO
     [not found]   ` <handler.681.B681.121838833410165.ackinfo@emacsbugs.donarmstrong.com>
2008-08-11  1:16     ` bug#681: Info received (bug#681: Wrong C++ indentation in batch mode) OFFICE ZERO
2008-08-10 17:12 ` bug#681: Wrong C++ indentation in batch mode OFFICE ZERO
     [not found]   ` <handler.681.B681.121838833410168.ackinfo@emacsbugs.donarmstrong.com>
2008-08-11  1:07     ` bug#681: Info received (bug#681: Wrong C++ indentation in batch mode) OFFICE ZERO
2014-01-07 10:26 ` bug#681: Wrong C++ indentation in batch mode Bastien Guerry
2014-01-07 15:36   ` Vivien Mallet
2014-01-07 16:09     ` Bastien
2015-12-29  1:18       ` Andrew Hyatt
2015-12-29 22:02         ` Alan Mackenzie
2016-01-04 23:16         ` Alan Mackenzie
2016-01-26  4:46           ` Andrew Hyatt
2016-02-06 12:05           ` Vivien Mallet
2016-02-07 22:09             ` Alan Mackenzie
2016-02-07 22:10               ` Vivien Mallet

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.