[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: `c-indent-command' in a rare case]

From: Martin Stjernholm
Subject: Re: address@hidden: `c-indent-command' in a rare case]
Date: Thu, 07 Oct 2004 13:21:17 +0200
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/20.7 (gnu/linux)

Richard Stallman <address@hidden> wrote:

> Would you please DTRT and ack to me?
> From: Paul Pogonyshev <address@hidden>
> Subject: `c-indent-command' in a rare case
> To: address@hidden
> Date: Fri Oct  1 03:25:54 2004 +0200
> Create a new C mode buffer and type 
>       #define X\ TAB
> in it (note: no RET.)  Emacs will hang in `c-append-backslashes-forward'
> till you press C-g.  The one-liner below solves this.  However, I'm not
> sure if this the correct way of solving.  Should `(forward-line 1)'
> return 0 when not advancing a single line and only jumping to the end
> of last, unterminated, line?

According to the documentation it should, so I'll fix the code in CC
Mode accordingly.

Still, I think that's an unfortunate special case that makes it more
complicated to use: The construct

    (while (= (forward-line 1) 0)

is convenient to execute something once for each line, with the point
at the start of the line, as long as there are lines left. Now the
special behavior of forward-line when eob isn't directly after a
newline requires more complex measures.

I understand that it probably isn't an option to change the behavior
of forward-line for compatibility reasons, but it could still be
interesting to know the reason for the decision to return zero when it
has moved but not managed to move to a different line.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]