unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4828: 23.1.50; c-newline-and-indent and indent-line-function
@ 2009-10-29 14:07 Lennart Borgman
  2009-10-30  1:08 ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Lennart Borgman @ 2009-10-29 14:07 UTC (permalink / raw)
  To: emacs-pretest-bug

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





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

* bug#4828: 23.1.50; c-newline-and-indent and indent-line-function
  2009-10-29 14:07 bug#4828: 23.1.50; c-newline-and-indent and indent-line-function Lennart Borgman
@ 2009-10-30  1:08 ` Stefan Monnier
  2009-11-21 14:09   ` Lennart Borgman
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2009-10-30  1:08 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: 4828

> 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





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

* bug#4828: 23.1.50; c-newline-and-indent and indent-line-function
  2009-10-30  1:08 ` Stefan Monnier
@ 2009-11-21 14:09   ` Lennart Borgman
  2009-11-22  8:22     ` Alan Mackenzie
  2011-07-13 14:31     ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 6+ messages in thread
From: Lennart Borgman @ 2009-11-21 14:09 UTC (permalink / raw)
  To: Stefan Monnier, Alan Mackenzie; +Cc: 4828

On Fri, Oct 30, 2009 at 2:08 AM, Stefan Monnier
<monnier@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?





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

* bug#4828: 23.1.50; c-newline-and-indent and indent-line-function
  2009-11-21 14:09   ` Lennart Borgman
@ 2009-11-22  8:22     ` Alan Mackenzie
  2011-07-13 14:31     ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 6+ messages in thread
From: Alan Mackenzie @ 2009-11-22  8:22 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: 4828

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@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).





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

* bug#4828: 23.1.50; c-newline-and-indent and indent-line-function
  2009-11-21 14:09   ` Lennart Borgman
  2009-11-22  8:22     ` Alan Mackenzie
@ 2011-07-13 14:31     ` Lars Magne Ingebrigtsen
  2016-02-28  6:35       ` Lars Ingebrigtsen
  1 sibling, 1 reply; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-07-13 14:31 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Alan Mackenzie, 4828

Lennart Borgman <lennart.borgman@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/





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

* bug#4828: 23.1.50; c-newline-and-indent and indent-line-function
  2011-07-13 14:31     ` Lars Magne Ingebrigtsen
@ 2016-02-28  6:35       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-28  6:35 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Alan Mackenzie, 4828, Stefan Monnier

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Lennart Borgman <lennart.borgman@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





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

end of thread, other threads:[~2016-02-28  6:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-29 14:07 bug#4828: 23.1.50; c-newline-and-indent and indent-line-function Lennart Borgman
2009-10-30  1:08 ` Stefan Monnier
2009-11-21 14:09   ` Lennart Borgman
2009-11-22  8:22     ` Alan Mackenzie
2011-07-13 14:31     ` Lars Magne Ingebrigtsen
2016-02-28  6:35       ` Lars Ingebrigtsen

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).