all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Martin Stjernholm <mast@lysator.liu.se>
Cc: bug-cc-mode@gnu.org
Subject: Re: [pogonyshev@gmx.net: `c-indent-command' in a rare case]
Date: Thu, 07 Oct 2004 13:21:17 +0200	[thread overview]
Message-ID: <5bvfdmzscy.fsf@lister.roxen.com> (raw)
In-Reply-To: <E1CDv10-0004rX-Fw@fencepost.gnu.org> (Richard Stallman's message of "Sat, 02 Oct 2004 21:18:18 -0400")

Richard Stallman <rms@gnu.org> wrote:

> Would you please DTRT and ack to me?
>
> From: Paul Pogonyshev <pogonyshev@gmx.net>
> Subject: `c-indent-command' in a rare case
> To: emacs-devel@gnu.org
> 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	other threads:[~2004-10-07 11:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1CDv10-0004rX-Fw@fencepost.gnu.org>
2004-10-07 11:21 ` Martin Stjernholm [this message]
2004-10-08 16:05   ` [pogonyshev@gmx.net: `c-indent-command' in a rare case] Richard Stallman
2004-10-08 17:29     ` Stefan
2004-10-10 15:16       ` Richard Stallman
2004-10-10 22:38         ` Kim F. Storm
2004-10-08 17:53     ` Martin Stjernholm
2004-10-08 18:31       ` David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5bvfdmzscy.fsf@lister.roxen.com \
    --to=mast@lysator.liu.se \
    --cc=bug-cc-mode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.