From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Martin Stjernholm Newsgroups: gmane.emacs.devel Subject: Re: [pogonyshev@gmx.net: `c-indent-command' in a rare case] Date: Thu, 07 Oct 2004 13:21:17 +0200 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <5bvfdmzscy.fsf@lister.roxen.com> References: Reply-To: bug-cc-mode@gnu.org NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1097148358 21121 80.91.229.6 (7 Oct 2004 11:25:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 7 Oct 2004 11:25:58 +0000 (UTC) Cc: bug-cc-mode@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 07 13:25:42 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CFWOy-0007KC-00 for ; Thu, 07 Oct 2004 13:25:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CFWVh-0004uq-Bx for ged-emacs-devel@m.gmane.org; Thu, 07 Oct 2004 07:32:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CFWRo-0003Nk-Qx for emacs-devel@gnu.org; Thu, 07 Oct 2004 07:28:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CFWRn-0003NP-Me for emacs-devel@gnu.org; Thu, 07 Oct 2004 07:28:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CFWRn-0003NG-Gk for emacs-devel@gnu.org; Thu, 07 Oct 2004 07:28:35 -0400 Original-Received: from [212.247.28.43] (helo=mail.roxen.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CFWKq-0002Wk-6t; Thu, 07 Oct 2004 07:21:24 -0400 Original-Received: by mail.roxen.com (Postfix, from userid 52) id C1ECE99D6; Thu, 7 Oct 2004 13:21:20 +0200 (MEST) Original-Received: from localhost (localhost [127.0.0.1]) by mail.roxen.com (Postfix) with ESMTP id BA0419A21; Thu, 7 Oct 2004 13:21:17 +0200 (MEST) Original-Received: from lister.roxen.com (lister.roxen.com [212.247.28.136]) by mail.roxen.com (Postfix) with ESMTP id E012E99F0; Thu, 7 Oct 2004 13:21:16 +0200 (MEST) Original-Received: from mast by lister.roxen.com with local (Exim 3.36 #1 (Debian)) id 1CFWKj-0006Sb-00; Thu, 07 Oct 2004 13:21:17 +0200 Original-To: rms@gnu.org, emacs-devel@gnu.org, Paul Pogonyshev In-Reply-To: (Richard Stallman's message of "Sat, 02 Oct 2004 21:18:18 -0400") User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/20.7 (gnu/linux) X-Virus-Scanned: by amavisd 0.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28027 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28027 Richard Stallman wrote: > Would you please DTRT and ack to me? > > From: Paul Pogonyshev > 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.