GNU bug report logs - #4828
23.1.50; c-newline-and-indent and indent-line-function

Previous Next

Packages: cc-mode, emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Thu, 29 Oct 2009 14:10:05 UTC

Severity: minor

Tags: patch

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4828 in the body.
You can then email your comments to 4828 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4828; Package emacs. (Thu, 29 Oct 2009 14:10:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Borgman <lennart.borgman <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 29 Oct 2009 14:10:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.1.50; c-newline-and-indent and indent-line-function
Date: Thu, 29 Oct 2009 15:07:08 +0100
c-newline-and-indent calls indent-according-to-mode to get indentation
right for a major mode. However in the case of multiple major modes in a
buffer (not yet part of Emacs) the current major mode is not enough to
know to get the indentation correct.

MuMaMo (a framework for multiple major modes in a buffer) therefore
instead sets indent-line-function which is more flexible. However when
the user uses c-electric-semi&comma this is bypassed since this
function calls c-newline-and-indent.

I just got a bug report where this problem shows up:

  https://bugs.launchpad.net/nxhtml/+bug/463136

I do not know how to solve this problem, but perhaps is it possible that
c-newline-and-indent instead calls indent-line-function?


In GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600)
 of 2009-10-15



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4828; Package emacs. (Fri, 30 Oct 2009 01:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 30 Oct 2009 01:15:05 GMT) Full text and rfc822 format available.

Message #10 received at 4828 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 4828 <at> debbugs.gnu.org
Subject: Re: bug#4828: 23.1.50; c-newline-and-indent and indent-line-function
Date: Thu, 29 Oct 2009 21:08:35 -0400
> c-newline-and-indent calls indent-according-to-mode to get indentation
[...]
> I do not know how to solve this problem, but perhaps is it possible that
> c-newline-and-indent instead calls indent-line-function?

Why would that help?  indent-according-to-mode doesn't do much more than
call indent-line-function.


        Stefan



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4828; Package emacs. (Sat, 21 Nov 2009 14:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Borgman <lennart.borgman <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 21 Nov 2009 14:15:04 GMT) Full text and rfc822 format available.

Message #15 received at 4828 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>, Alan Mackenzie <acm <at> muc.de>
Cc: 4828 <at> debbugs.gnu.org
Subject: Re: bug#4828: 23.1.50; c-newline-and-indent and indent-line-function
Date: Sat, 21 Nov 2009 15:09:08 +0100
On Fri, Oct 30, 2009 at 2:08 AM, Stefan Monnier
<monnier <at> iro.umontreal.ca> wrote:
>> c-newline-and-indent calls indent-according-to-mode to get indentation
> [...]
>> I do not know how to solve this problem, but perhaps is it possible that
>> c-newline-and-indent instead calls indent-line-function?
>
> Why would that help?  indent-according-to-mode doesn't do much more than
> call indent-line-function.

Eh, sorry.

Looking at the code in c-electric-semi&comma I think it is better to
change the call to (c-indent-line) currently on line 938 in cc-cmds.el
to (funcall indent-line-function). That will fix the problem I think.

	    (if c-syntactic-indentation
		;;(c-indent-line)
                (funcall indent-line-function)
              )

Would that be the right fix Alan?



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4828; Package emacs. (Sun, 22 Nov 2009 08:25:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alan Mackenzie <acm <at> muc.de>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 22 Nov 2009 08:25:06 GMT) Full text and rfc822 format available.

Message #20 received at 4828 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 4828 <at> debbugs.gnu.org
Subject: Re: bug#4828: 23.1.50; c-newline-and-indent and indent-line-function
Date: Sun, 22 Nov 2009 08:22:50 +0000
Hi, Lennart!

On Sat, Nov 21, 2009 at 03:09:08PM +0100, Lennart Borgman wrote:
> On Fri, Oct 30, 2009 at 2:08 AM, Stefan Monnier
> <monnier <at> iro.umontreal.ca> wrote:
> >> c-newline-and-indent calls indent-according-to-mode to get indentation
> > [...]
> >> I do not know how to solve this problem, but perhaps is it possible that
> >> c-newline-and-indent instead calls indent-line-function?

> > Why would that help?  indent-according-to-mode doesn't do much more than
> > call indent-line-function.

> Eh, sorry.

> Looking at the code in c-electric-semi&comma I think it is better to
> change the call to (c-indent-line) currently on line 938 in cc-cmds.el
> to (funcall indent-line-function). That will fix the problem I think.

> 	    (if c-syntactic-indentation
> 		;;(c-indent-line)
>                 (funcall indent-line-function)
>               )

> Would that be the right fix Alan?

I reckon so; it looks like a proper fix, not a workaround.  But if you
could comment it something like:

                 (funcall indent-line-function) ; Call indirectly for mumamo

, the chance of it being "cleaned up" at a later date would be
considerably diminished.	

If you want to commit this change, it's fine as far as I'm concerned.

-- 
Alan Mackenzie (Nuremberg, Germany).



bug reassigned from package 'emacs' to 'emacs,cc-mode'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 15 Jan 2010 02:35:02 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 15 Jan 2010 02:35:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#4828; Package emacs,cc-mode. (Wed, 13 Jul 2011 14:36:01 GMT) Full text and rfc822 format available.

Message #27 received at 4828 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: Alan Mackenzie <acm <at> muc.de>, 4828 <at> debbugs.gnu.org,
	Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#4828: 23.1.50; c-newline-and-indent and indent-line-function
Date: Wed, 13 Jul 2011 16:31:50 +0200
Lennart Borgman <lennart.borgman <at> gmail.com> writes:

> Looking at the code in c-electric-semi&comma I think it is better to
> change the call to (c-indent-line) currently on line 938 in cc-cmds.el
> to (funcall indent-line-function). That will fix the problem I think.
>
> 	    (if c-syntactic-indentation
> 		;;(c-indent-line)
>                 (funcall indent-line-function)
>               )

The code seems to have changed a bit in the mean time -- line 938 no
longer has that code.

Is this still relevant?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#4828; Package emacs,cc-mode. (Sun, 28 Feb 2016 06:37:02 GMT) Full text and rfc822 format available.

Message #30 received at 4828 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: Alan Mackenzie <acm <at> muc.de>, 4828 <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#4828: 23.1.50; c-newline-and-indent and indent-line-function
Date: Sun, 28 Feb 2016 17:35:36 +1100
Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:

> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>
>> Looking at the code in c-electric-semi&comma I think it is better to
>> change the call to (c-indent-line) currently on line 938 in cc-cmds.el
>> to (funcall indent-line-function). That will fix the problem I think.
>>
>> 	    (if c-syntactic-indentation
>> 		;;(c-indent-line)
>>                 (funcall indent-line-function)
>>               )
>
> The code seems to have changed a bit in the mean time -- line 938 no
> longer has that code.
>
> Is this still relevant?

More information was requested, but no response was given within a few
years, so I'm closing this bug report.  If the problem still exists,
please reopen this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 4828 <at> debbugs.gnu.org and Lennart Borgman <lennart.borgman <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 28 Feb 2016 06:37:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 27 Mar 2016 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 83 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.