GNU bug report logs - #20663
page.el (forward-page): Avoid skipping pages

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Pierre Neidhardt <ambrevar@HIDDEN>; dated Tue, 26 May 2015 17:23:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 27 Apr 2016 07:53:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 27 03:53:43 2016
Received: from localhost ([127.0.0.1]:49366 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1avKI3-0005Xn-J5
	for submit <at> debbugs.gnu.org; Wed, 27 Apr 2016 03:53:43 -0400
Received: from mail-pa0-f68.google.com ([209.85.220.68]:35102)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ambrevar@HIDDEN>) id 1avKI1-0005Xa-V7
 for 20663 <at> debbugs.gnu.org; Wed, 27 Apr 2016 03:53:42 -0400
Received: by mail-pa0-f68.google.com with SMTP id zy2so4389594pac.2
 for <20663 <at> debbugs.gnu.org>; Wed, 27 Apr 2016 00:53:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=XmOhl54LEDgLKXpiCn2r59FU47aAJiIuHdyW7MkSe6E=;
 b=PVVIcD8HLNznLB1JKFC20Xkfq040QTXCiRU06kjKEdcCQ9n2rx3dQPgPyDIyz32uJ1
 thC5tpwGa7rRV1kNDBqG58Pz+N5GSKwrKc2uTOwfW5jUX4MC/nWMbDQbQlpUjHh/Z7Jt
 VbLEcK+/tdGePc+CM4szk98nbSbkHIVthTI4veyTsf3MTzTyHjaFDSUAmcS7s6oXWyr/
 Yg2UhfL7i9iIoUHaPyx89n+4DMjhBCTH7GgIqmhF8j1nXQ7UdxQO1bfAfYc9YD6i3UJb
 ZhFUbbZJ5ECH8nUnl/JfPtB6/jHvlTHXl2vCSojV9KrjcotV9KMW5pbFS9xSqQKPiLay
 6ayA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:in-reply-to:user-agent;
 bh=XmOhl54LEDgLKXpiCn2r59FU47aAJiIuHdyW7MkSe6E=;
 b=E1JsvGlYIMEAjcM4yE5BwfG2GgNYI3EO4aBbJM3MJDXcwcDqwRBL8KP+YtOROwwEce
 8bXfUCEnCZf4CjTwBfpKdPfUIvG5A8t00Z+KAh9ghvGw6U3QYi0WMhrAXF/aDEmiE2vO
 yejfXTUk+UPa+AlaGEgzHvz/MMKJ76OvAX4CA4tcQ/7rge4Or8WK636bqqLmKR7NP1eQ
 7uVQNrF7nGAGc947cTOrT0QyTETixgM7oWripmRYeuVED94RJE+bpVMavT9xd9ANaqF3
 VmBNTKwmDyZXDpZgo/mz1DvJ4QVnTZwKq8Tftf6oqhl1cTQeg+OZ1nuBgoRpB072kDfw
 eF3g==
X-Gm-Message-State: AOPr4FVYSbWGmqVEbh+OH6H4YVMjavQbuwqhfhF9nHFWK1sitrzxklIpSyYshLnDEayNEA==
X-Received: by 10.66.246.165 with SMTP id xx5mr9726325pac.87.1461743616096;
 Wed, 27 Apr 2016 00:53:36 -0700 (PDT)
Received: from gmail.com ([14.175.133.17])
 by smtp.gmail.com with ESMTPSA id o81sm3921478pfj.50.2016.04.27.00.53.33
 (version=TLSv1/SSLv3 cipher=OTHER);
 Wed, 27 Apr 2016 00:53:35 -0700 (PDT)
Date: Wed, 27 Apr 2016 14:57:38 +0700
From: Pierre Neidhardt <ambrevar@HIDDEN>
To: Marcin Borkowski <mbork@HIDDEN>
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
Message-ID: <20160427075738.GA2587@HIDDEN>
References: <87h9fbum2w.fsf@HIDDEN> <83h9fbhu0p.fsf@HIDDEN>
 <871t6eve9c.fsf@HIDDEN> <837fg6injl.fsf@HIDDEN>
 <20160410012924.GA23097@HIDDEN> <87fuus30rs.fsf@HIDDEN>
 <8337qsgnvc.fsf@HIDDEN> <87a8kxcs4k.fsf@HIDDEN>
 <83shylbxqc.fsf@HIDDEN> <871t607n1m.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <871t607n1m.fsf@HIDDEN>
X-Info: Simplicity is the ultimate sophistication.
User-Agent: Mutt/1.5.24 (2015-08-30)
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20663
Cc: Eli Zaretskii <eliz@HIDDEN>, 20663 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

On 16-04-20 09:32:37, Marcin Borkowski wrote:
> And by the way, the patch the OP gave is also wrong, though in
> a different way.  (I should have noticed that earlier.)  The OP proposed
> this instead of (if (bolp) (forward-char 1)):
> 
> (if (string= page-delimiter "") (forward-char 1))
> 
> Of course, this condition should never be true: if `page-delimiter' is
> "", functions from page.el will most probably never work correctly
> anyway.  What (maybe) should have been tested would be
> 
> (eq (match-beginning 0) (match-end 0))
> 
> but anyway, since Emacs regex engine does not have a lot of zero-width
> assertions, this is not going to happen very often anyway (certainly
> never with the default value of `page-delimiter', which explains why the
> OP hasn't noticed any problems with his patch).  One possible value of
> `page-delimiter' that comes to my mind which could lead to the above
> condition holding would be "^$" -- though I can hardly see any practical
> use for it.
> 
> So my proposal would be to just delete the offending line altogether.
> I'd be very surprised if we heard any complaints afterwards.

Why disallowing "^$" as a page delimiter? I would not use it either, but I can
fathom that somebody else would. At the end of the day, the page display is like
colors: a matter of taste. So instead of removing the line, I'd use the
replacement you suggested.

> BTW, the analogous code for moving back one page seems also suspicious
> to me.  I'll look into it tomorrow.

The code for moving back first skips the page delimiter we are currently on, if
any. This is not problematic if the page was narrowed down since it is not
possible to be on the page delimiter at (point-min).

The code looks good to me if we consider that the delimiters belong to the end
of a page.

-- 
Pierre Neidhardt




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 20 Apr 2016 07:32:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 20 03:32:51 2016
Received: from localhost ([127.0.0.1]:40957 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1asmd1-00034v-KO
	for submit <at> debbugs.gnu.org; Wed, 20 Apr 2016 03:32:51 -0400
Received: from mail.mojserwer.eu ([195.110.48.8]:35572)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mbork@HIDDEN>) id 1asmcz-00034l-CJ
 for 20663 <at> debbugs.gnu.org; Wed, 20 Apr 2016 03:32:50 -0400
Received: from localhost (localhost [127.0.0.1])
 by mail.mojserwer.eu (Postfix) with ESMTP id 6F486AE51C9;
 Wed, 20 Apr 2016 09:32:47 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu
Received: from mail.mojserwer.eu ([127.0.0.1])
 by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 7+ZzZw2aYPr3; Wed, 20 Apr 2016 09:32:41 +0200 (CEST)
Received: from localhost (98-171.echostar.pl [213.156.98.171])
 by mail.mojserwer.eu (Postfix) with ESMTPSA id 0EAE2AE51C7;
 Wed, 20 Apr 2016 09:32:41 +0200 (CEST)
References: <20150526171440.GG647@HIDDEN> <87h9fbum2w.fsf@HIDDEN>
 <83h9fbhu0p.fsf@HIDDEN> <871t6eve9c.fsf@HIDDEN> <837fg6injl.fsf@HIDDEN>
 <20160410012924.GA23097@HIDDEN> <87fuus30rs.fsf@HIDDEN>
 <8337qsgnvc.fsf@HIDDEN> <87a8kxcs4k.fsf@HIDDEN> <83shylbxqc.fsf@HIDDEN>
User-agent: mu4e 0.9.13; emacs 25.1.50.8
From: Marcin Borkowski <mbork@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
In-reply-to: <83shylbxqc.fsf@HIDDEN>
Date: Wed, 20 Apr 2016 09:32:37 +0200
Message-ID: <871t607n1m.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20663
Cc: 20663 <at> debbugs.gnu.org, ambrevar@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)


On 2016-04-16, at 11:26, Eli Zaretskii <eliz@HIDDEN> wrote:

>> From: Marcin Borkowski <mbork@HIDDEN>
>> Cc: ambrevar@HIDDEN, 20663 <at> debbugs.gnu.org
>> Date: Wed, 13 Apr 2016 19:53:31 +0200
>> 
>> > Can one of you please explain why the original code misbehaves?
>> 
>> Quoting from the original report:
>> 
>> --8<---------------cut here---------------start------------->8---
>> > Running `emacs -Q example.txt`:
>> >
>> > 	M-<
>> > 	C-x n p
>> > 	M->
>> > 	M-1 C-x n p
>> >
>> > This should bring us from page 1 to page 2, but page 3 gets displayed instead.
>> --8<---------------cut here---------------end--------------->8---
>
> Yes, I've read that.  I asked for an explanation of _why_ the code
> currently in Emacs misbehaves in this recipe.  Can one of you describe
> that?

Let me try (note: this is partly my conjecture!).

Since the concept of a "page delimiter" is vague in Emacs (the manual
suggests that a page delimiter is a _line_ such that `page-delimiter'
matches at its beginning, common sense suggests that it is a _substring_
of the buffer matching `page-delimiter', it's probable that someone
decided that if the point is at the beginning of a line and matches
`page-delimiter', then `forward-page' shouldn't just move past the text
matching `page-delimiter' we are on, but the next one.  So the author of
the current version of `forward-page' decided just to move one character
forward (in case we are at the line beginning), so that `page-delimiter'
won't match.

This I consider a Bad Idea™.  As I mentioned earlier, I think the
concept of a "page" and "page delimiter" should be made more precise;
then, it should be enough to correct `forward-page' (basically all other
functions in page.el depend on it, directly or not).  Currently Emacs
seems to treat the _line_ as the page delimiter, but as the OP noted,
this yields strange/unintuitive results with narrowing.

And by the way, the patch the OP gave is also wrong, though in
a different way.  (I should have noticed that earlier.)  The OP proposed
this instead of (if (bolp) (forward-char 1)):

(if (string= page-delimiter "") (forward-char 1))

Of course, this condition should never be true: if `page-delimiter' is
"", functions from page.el will most probably never work correctly
anyway.  What (maybe) should have been tested would be

(eq (match-beginning 0) (match-end 0))

but anyway, since Emacs regex engine does not have a lot of zero-width
assertions, this is not going to happen very often anyway (certainly
never with the default value of `page-delimiter', which explains why the
OP hasn't noticed any problems with his patch).  One possible value of
`page-delimiter' that comes to my mind which could lead to the above
condition holding would be "^$" -- though I can hardly see any practical
use for it.

So my proposal would be to just delete the offending line altogether.
I'd be very surprised if we heard any complaints afterwards.

BTW, the analogous code for moving back one page seems also suspicious
to me.  I'll look into it tomorrow.

> Thanks.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 16 Apr 2016 11:27:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 16 07:27:21 2016
Received: from localhost ([127.0.0.1]:37151 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1arONk-0007XW-Vx
	for submit <at> debbugs.gnu.org; Sat, 16 Apr 2016 07:27:21 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39139)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1arONj-0007XK-Ad
 for 20663 <at> debbugs.gnu.org; Sat, 16 Apr 2016 07:27:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1arONa-0000uM-Us
 for 20663 <at> debbugs.gnu.org; Sat, 16 Apr 2016 07:27:14 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53335)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1arONa-0000uI-Rd; Sat, 16 Apr 2016 07:27:10 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3120
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1arONa-00015U-1n; Sat, 16 Apr 2016 07:27:10 -0400
Date: Sat, 16 Apr 2016 14:26:51 +0300
Message-Id: <83shylbxqc.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Marcin Borkowski <mbork@HIDDEN>
In-reply-to: <87a8kxcs4k.fsf@HIDDEN> (message from Marcin Borkowski on Wed, 
 13 Apr 2016 19:53:31 +0200)
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
References: <20150526171440.GG647@HIDDEN> <87h9fbum2w.fsf@HIDDEN>
 <83h9fbhu0p.fsf@HIDDEN> <871t6eve9c.fsf@HIDDEN> <837fg6injl.fsf@HIDDEN>
 <20160410012924.GA23097@HIDDEN> <87fuus30rs.fsf@HIDDEN>
 <8337qsgnvc.fsf@HIDDEN> <87a8kxcs4k.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.0 (------)
X-Debbugs-Envelope-To: 20663
Cc: 20663 <at> debbugs.gnu.org, ambrevar@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Marcin Borkowski <mbork@HIDDEN>
> Cc: ambrevar@HIDDEN, 20663 <at> debbugs.gnu.org
> Date: Wed, 13 Apr 2016 19:53:31 +0200
> 
> > Can one of you please explain why the original code misbehaves?
> 
> Quoting from the original report:
> 
> --8<---------------cut here---------------start------------->8---
> > Running `emacs -Q example.txt`:
> >
> > 	M-<
> > 	C-x n p
> > 	M->
> > 	M-1 C-x n p
> >
> > This should bring us from page 1 to page 2, but page 3 gets displayed instead.
> --8<---------------cut here---------------end--------------->8---

Yes, I've read that.  I asked for an explanation of _why_ the code
currently in Emacs misbehaves in this recipe.  Can one of you describe
that?

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 16 Apr 2016 11:03:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 16 07:03:51 2016
Received: from localhost ([127.0.0.1]:37095 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1arO11-0006xf-7e
	for submit <at> debbugs.gnu.org; Sat, 16 Apr 2016 07:03:51 -0400
Received: from mail.mojserwer.eu ([195.110.48.8]:47690)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mbork@HIDDEN>) id 1arO0z-0006xX-RX
 for 20663 <at> debbugs.gnu.org; Sat, 16 Apr 2016 07:03:50 -0400
Received: from localhost (localhost [127.0.0.1])
 by mail.mojserwer.eu (Postfix) with ESMTP id CE786ACB507;
 Sat, 16 Apr 2016 13:03:47 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu
Received: from mail.mojserwer.eu ([127.0.0.1])
 by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id OzPnMrLhwb63; Sat, 16 Apr 2016 13:03:45 +0200 (CEST)
Received: from localhost (98-171.echostar.pl [213.156.98.171])
 by mail.mojserwer.eu (Postfix) with ESMTPSA id 153E8ACB506;
 Sat, 16 Apr 2016 13:03:45 +0200 (CEST)
References: <20150526171440.GG647@HIDDEN> <87h9fbum2w.fsf@HIDDEN>
 <83h9fbhu0p.fsf@HIDDEN> <871t6eve9c.fsf@HIDDEN> <837fg6injl.fsf@HIDDEN>
 <20160410012924.GA23097@HIDDEN> <87fuus30rs.fsf@HIDDEN>
 <8337qsgnvc.fsf@HIDDEN> <87a8kxcs4k.fsf@HIDDEN>
User-agent: mu4e 0.9.13; emacs 25.1.50.8
From: Marcin Borkowski <mbork@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
Message-ID: <8760vhvmr9.fsf@HIDDEN>
In-reply-to: <87a8kxcs4k.fsf@HIDDEN>
Date: Sat, 16 Apr 2016 13:03:41 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20663
Cc: 20663 <at> debbugs.gnu.org, ambrevar@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)


On 2016-04-13, at 17:53, Marcin Borkowski <mbork@HIDDEN> wrote:

> Here's the relevant excerpt from the manual:
>
> --8<---------------cut here---------------start------------->8---
>    The variable ‘page-delimiter’ controls where pages begin.  Its value
> is a regular expression that matches the beginning of a line that
> separates pages (*note Regexps::).  The normal value of this variable is
> ‘"^\f"’, which matches a formfeed character at the beginning of a line.
> --8<---------------cut here---------------end--------------->8---
>
> Is it me or is the above ambiguous?
>
>
> I'm a bit busy now, but I'll make a second attempt at this issue within
> a few days.  One of the problems is that (as the above paragraph seems
> to confirm) the very notion of a "page" in Emacs is vague.  IMHO we
> should start with a clear definition of a "page".  It is well possible
> that different functions in page.el use different interpretations of
> this notion, and the bug is just a symptom if such a mess.
>
> My proposal is that a "page separator" would be a position in the buffer
> where (looking-at-p page-delimiter) is true, and if point is at such
> a place, then we consider it on the next page.  I.e., in this situation
>
> abcabcabc
> -!-^L
> cbacbacba
>
> the point is already on the second page (unlike the default Emacs
> behavior).
>
> Then, someone should study page.el and where necessary, update it to the
> precisely defined notion of a "page".  (The mythical "someone" might be
> me.)
>
> WDYT?

OK, I got almost no responses so far:-(.  In the meantime, I started to
study this issue.  It seems that `forward-page' indeed has a bug.
Here's the recipe (slightly modified from the OP's one).  With this
buffer state:

--8<---------------cut here---------------start------------->8---
Page 1
-!-^L
Page 2
^L
Page 3
--8<---------------cut here---------------end--------------->8---

press `C-x ]' (`forward-page').  Now the point moves across /two/
form-feed characters.  Is that intentional?  Seems broken for me.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 13 Apr 2016 20:54:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 13 16:54:31 2016
Received: from localhost ([127.0.0.1]:34058 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aqRnz-0005RO-3q
	for submit <at> debbugs.gnu.org; Wed, 13 Apr 2016 16:54:31 -0400
Received: from mail.mojserwer.eu ([195.110.48.8]:39829)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mbork@HIDDEN>) id 1aqRny-0005RF-4R
 for 20663 <at> debbugs.gnu.org; Wed, 13 Apr 2016 16:54:30 -0400
Received: from localhost (localhost [127.0.0.1])
 by mail.mojserwer.eu (Postfix) with ESMTP id A133AABFB61;
 Wed, 13 Apr 2016 22:54:28 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu
Received: from mail.mojserwer.eu ([127.0.0.1])
 by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id zgKEH6YJPjH1; Wed, 13 Apr 2016 22:54:26 +0200 (CEST)
Received: from localhost (98-171.echostar.pl [213.156.98.171])
 by mail.mojserwer.eu (Postfix) with ESMTPSA id 5BD03ABFB5F;
 Wed, 13 Apr 2016 22:54:26 +0200 (CEST)
References: <20150526171440.GG647@HIDDEN> <87h9fbum2w.fsf@HIDDEN>
 <83h9fbhu0p.fsf@HIDDEN> <871t6eve9c.fsf@HIDDEN> <837fg6injl.fsf@HIDDEN>
 <20160410012924.GA23097@HIDDEN> <87fuus30rs.fsf@HIDDEN>
 <8337qsgnvc.fsf@HIDDEN> <87a8kxcs4k.fsf@HIDDEN>
 <CAOj2CQTXKvfuQ80D_rjd=BjLkkvpGqD70MuKMLYQqfdg9uZJiA@HIDDEN>
User-agent: mu4e 0.9.13; emacs 25.1.50.8
From: Marcin Borkowski <mbork@HIDDEN>
To: John Mastro <john.b.mastro@HIDDEN>
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
In-reply-to: <CAOj2CQTXKvfuQ80D_rjd=BjLkkvpGqD70MuKMLYQqfdg9uZJiA@HIDDEN>
Date: Wed, 13 Apr 2016 22:54:25 +0200
Message-ID: <8760vlcjr2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20663
Cc: Eli Zaretskii <eliz@HIDDEN>, 20663 <at> debbugs.gnu.org, ambrevar@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)


On 2016-04-13, at 20:14, John Mastro <john.b.mastro@HIDDEN> wrote:

> Marcin Borkowski <mbork@HIDDEN> wrote:
>> My proposal is that a "page separator" would be a position in the buffer
>> where (looking-at-p page-delimiter) is true, and if point is at such
>> a place, then we consider it on the next page.  I.e., in this situation
>>
>> abcabcabc
>> -!-^L
>> cbacbacba
>>
>> the point is already on the second page (unlike the default Emacs
>> behavior).
>
> That seems somewhat confusing to me. Intuitively, I would expect the new
> page to start after the delimiter, not immediately before it
>
> For comparison, when (looking-at-p "$") returns non-nil, that means
> point is at the end of the current line (i.e. before the "\n"), not the
> beginning of the next one. (Of course, they're not exactly the same,
> since page-delimiter can match multiple characters.)

Well, I'm fine with that version, too - but I'd insist that we should
settle on _something_ and make it clear in the docs.

BTW, the argument for my variant would be that a new page would always
start at beginning of (some) line (assuming that `page-delimiter' starts
with "^", as it does by default).  (I don't claim that it's especially
strong argument, I just wanted to mention it.)

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 13 Apr 2016 20:15:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 13 16:15:13 2016
Received: from localhost ([127.0.0.1]:34014 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aqRBx-0004Pk-BZ
	for submit <at> debbugs.gnu.org; Wed, 13 Apr 2016 16:15:13 -0400
Received: from mail-yw0-f173.google.com ([209.85.161.173]:35158)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <john.b.mastro@HIDDEN>) id 1aqRBv-0004PW-Lo
 for 20663 <at> debbugs.gnu.org; Wed, 13 Apr 2016 16:15:12 -0400
Received: by mail-yw0-f173.google.com with SMTP id i84so82651388ywc.2
 for <20663 <at> debbugs.gnu.org>; Wed, 13 Apr 2016 13:15:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=Ao2zE8NKxZI/5OBsQg5kZJk1C+1KZglsNJhRIpUJfek=;
 b=PwZS7TG6Rbpea/PdKwGCHMzd7zNY7M90DlvNCcrxPPV0pyp1/DeUiDTclecZpTyOhy
 4o8h+i8AMMXHOGX1kSjuvSBJnwFPzPcIoe7ZtEOpttmOPvtfhTqJmecgG/AuqgvA5+8M
 NBz9AG9eBeCXsYZkTMPUePQbkESQMczhaAim2olurOZSTqfuO9sJrCgxMCC0c+LrlQj1
 NK4kaAZYOqgwkZXYaWllHohYmJPBqzG+5dtbtYGmAeiKLMkekoDQn4nZQvCdH6b/Evup
 lMbj38F7Hm7/53wyRlBzrl69IUg8bGnP6HETEFExbY1vY/WI7Ko89xAUv3TbndeEMdgd
 VhVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=Ao2zE8NKxZI/5OBsQg5kZJk1C+1KZglsNJhRIpUJfek=;
 b=YJwkXHSB4tnXYij2BIQJkrOFDR+yhNnV97QsaV6Q6bcOVYCwAb4/PNnHMLkiMNZEDv
 5Cy23vR/GxnnAqfyyvTK7EEXBw4WRTD+pH4bxPbRAGukJl3dw1sHZsA/Wn+Hhc4K+ucl
 XUfu0o+rX68tlMxQVXp151irT/5VsKJ45FQAJl2YPj6AAEgd5I9OjQqXVfvNmmen4QtY
 0iaYcJUDplC/g1GBhDNBKTySTjVBo7bFrDSMvTkQ7u1jkMR9Q3GrjyMZgZD2NxaF2+Fy
 JNqcb2DkKF0QFLgmIa4leYzcZknODHHLycLny/JYZM1snM9IzwHVhxMNkP56jHzetrno
 L0Yw==
X-Gm-Message-State: AOPr4FWRlg1lPM3rl0zI6/XoP0i63uwqnjE0dXUblyBkX10GGcO/LCWi5/XWgdHYsKx1KRSTPucFouDapEr5ag==
X-Received: by 10.129.103.85 with SMTP id b82mr5848852ywc.127.1460578505854;
 Wed, 13 Apr 2016 13:15:05 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.37.71.86 with HTTP; Wed, 13 Apr 2016 13:14:46 -0700 (PDT)
In-Reply-To: <87a8kxcs4k.fsf@HIDDEN>
References: <20150526171440.GG647@HIDDEN> <87h9fbum2w.fsf@HIDDEN>
 <83h9fbhu0p.fsf@HIDDEN> <871t6eve9c.fsf@HIDDEN> <837fg6injl.fsf@HIDDEN>
 <20160410012924.GA23097@HIDDEN> <87fuus30rs.fsf@HIDDEN>
 <8337qsgnvc.fsf@HIDDEN> <87a8kxcs4k.fsf@HIDDEN>
From: John Mastro <john.b.mastro@HIDDEN>
Date: Wed, 13 Apr 2016 13:14:46 -0700
Message-ID: <CAOj2CQTXKvfuQ80D_rjd=BjLkkvpGqD70MuKMLYQqfdg9uZJiA@HIDDEN>
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
To: Marcin Borkowski <mbork@HIDDEN>
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 20663
Cc: Eli Zaretskii <eliz@HIDDEN>, 20663 <at> debbugs.gnu.org, ambrevar@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Marcin Borkowski <mbork@HIDDEN> wrote:
> My proposal is that a "page separator" would be a position in the buffer
> where (looking-at-p page-delimiter) is true, and if point is at such
> a place, then we consider it on the next page.  I.e., in this situation
>
> abcabcabc
> -!-^L
> cbacbacba
>
> the point is already on the second page (unlike the default Emacs
> behavior).

That seems somewhat confusing to me. Intuitively, I would expect the new
page to start after the delimiter, not immediately before it

For comparison, when (looking-at-p "$") returns non-nil, that means
point is at the end of the current line (i.e. before the "\n"), not the
beginning of the next one. (Of course, they're not exactly the same,
since page-delimiter can match multiple characters.)

-- 
john




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 13 Apr 2016 17:53:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 13 13:53:41 2016
Received: from localhost ([127.0.0.1]:33975 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aqOyz-00016D-0l
	for submit <at> debbugs.gnu.org; Wed, 13 Apr 2016 13:53:41 -0400
Received: from mail.mojserwer.eu ([195.110.48.8]:34714)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mbork@HIDDEN>) id 1aqOyx-000165-EP
 for 20663 <at> debbugs.gnu.org; Wed, 13 Apr 2016 13:53:40 -0400
Received: from localhost (localhost [127.0.0.1])
 by mail.mojserwer.eu (Postfix) with ESMTP id F1EE6ABF294;
 Wed, 13 Apr 2016 19:53:37 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu
Received: from mail.mojserwer.eu ([127.0.0.1])
 by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id zHPs4SUYW5Qu; Wed, 13 Apr 2016 19:53:35 +0200 (CEST)
Received: from localhost (98-171.echostar.pl [213.156.98.171])
 by mail.mojserwer.eu (Postfix) with ESMTPSA id 48A85ABF293;
 Wed, 13 Apr 2016 19:53:35 +0200 (CEST)
References: <20150526171440.GG647@HIDDEN> <87h9fbum2w.fsf@HIDDEN>
 <83h9fbhu0p.fsf@HIDDEN> <871t6eve9c.fsf@HIDDEN> <837fg6injl.fsf@HIDDEN>
 <20160410012924.GA23097@HIDDEN> <87fuus30rs.fsf@HIDDEN>
 <8337qsgnvc.fsf@HIDDEN>
User-agent: mu4e 0.9.13; emacs 25.1.50.8
From: Marcin Borkowski <mbork@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
In-reply-to: <8337qsgnvc.fsf@HIDDEN>
Date: Wed, 13 Apr 2016 19:53:31 +0200
Message-ID: <87a8kxcs4k.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20663
Cc: 20663 <at> debbugs.gnu.org, ambrevar@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)


On 2016-04-11, at 15:35, Eli Zaretskii <eliz@HIDDEN> wrote:

>> From: Marcin Borkowski <mbork@HIDDEN>
>> Cc: Eli Zaretskii <eliz@HIDDEN>,  20663 <at> debbugs.gnu.org
>> Date: Mon, 11 Apr 2016 12:20:07 +0200
>> 
>> I spent a few minutes on this with Edebug and Git today.
>
> Thanks.
>
>> > - All the patch does it make the code consistent with its comments, that is:
>> >
>> > 	;; In case the page-delimiter matches the null string,
>> > 	;; don't find a match without moving.
>> 
>> Seems ok.
>> 
>> > - If you try the recipe (I just did on Emacs 24.5.1, don't have time to check
>> > now on upstream), you'll see that a page gets skipped, which is not the desired
>> > behaviour.
>> 
>> Condirmed.  And it doesn't happen with the patch installed.
>
> Can one of you please explain why the original code misbehaves?

Quoting from the original report:

--8<---------------cut here---------------start------------->8---
> Running `emacs -Q example.txt`:
>
> 	M-<
> 	C-x n p
> 	M->
> 	M-1 C-x n p
>
> This should bring us from page 1 to page 2, but page 3 gets displayed instead.
--8<---------------cut here---------------end--------------->8---

>> For instance, when the point is -!-, is the point on the first or
>> second page here?  Emacs with and without the patch has different
>> opinions on that.
>
> Good point.

Here's the relevant excerpt from the manual:

--8<---------------cut here---------------start------------->8---
   The variable ‘page-delimiter’ controls where pages begin.  Its value
is a regular expression that matches the beginning of a line that
separates pages (*note Regexps::).  The normal value of this variable is
‘"^\f"’, which matches a formfeed character at the beginning of a line.
--8<---------------cut here---------------end--------------->8---

Is it me or is the above ambiguous?


I'm a bit busy now, but I'll make a second attempt at this issue within
a few days.  One of the problems is that (as the above paragraph seems
to confirm) the very notion of a "page" in Emacs is vague.  IMHO we
should start with a clear definition of a "page".  It is well possible
that different functions in page.el use different interpretations of
this notion, and the bug is just a symptom if such a mess.

My proposal is that a "page separator" would be a position in the buffer
where (looking-at-p page-delimiter) is true, and if point is at such
a place, then we consider it on the next page.  I.e., in this situation

abcabcabc
-!-^L
cbacbacba

the point is already on the second page (unlike the default Emacs
behavior).

Then, someone should study page.el and where necessary, update it to the
precisely defined notion of a "page".  (The mythical "someone" might be
me.)

WDYT?

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 11 Apr 2016 15:35:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 11 11:35:48 2016
Received: from localhost ([127.0.0.1]:59597 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1apdsS-0000ym-HI
	for submit <at> debbugs.gnu.org; Mon, 11 Apr 2016 11:35:48 -0400
Received: from eggs.gnu.org ([208.118.235.92]:49578)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1apdsR-0000yZ-14
 for 20663 <at> debbugs.gnu.org; Mon, 11 Apr 2016 11:35:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1apdsG-00045E-3w
 for 20663 <at> debbugs.gnu.org; Mon, 11 Apr 2016 11:35:41 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35439)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1apdsF-000458-PT; Mon, 11 Apr 2016 11:35:35 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4991
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1apdsE-0007tF-H4; Mon, 11 Apr 2016 11:35:35 -0400
Date: Mon, 11 Apr 2016 18:35:03 +0300
Message-Id: <8337qsgnvc.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Marcin Borkowski <mbork@HIDDEN>
In-reply-to: <87fuus30rs.fsf@HIDDEN> (message from Marcin Borkowski on Mon, 
 11 Apr 2016 12:20:07 +0200)
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
References: <20150526171440.GG647@HIDDEN> <87h9fbum2w.fsf@HIDDEN>
 <83h9fbhu0p.fsf@HIDDEN> <871t6eve9c.fsf@HIDDEN>
 <837fg6injl.fsf@HIDDEN> <20160410012924.GA23097@HIDDEN>
 <87fuus30rs.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.0 (------)
X-Debbugs-Envelope-To: 20663
Cc: 20663 <at> debbugs.gnu.org, ambrevar@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Marcin Borkowski <mbork@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  20663 <at> debbugs.gnu.org
> Date: Mon, 11 Apr 2016 12:20:07 +0200
> 
> I spent a few minutes on this with Edebug and Git today.

Thanks.

> > - All the patch does it make the code consistent with its comments, that is:
> >
> > 	;; In case the page-delimiter matches the null string,
> > 	;; don't find a match without moving.
> 
> Seems ok.
> 
> > - If you try the recipe (I just did on Emacs 24.5.1, don't have time to check
> > now on upstream), you'll see that a page gets skipped, which is not the desired
> > behaviour.
> 
> Condirmed.  And it doesn't happen with the patch installed.

Can one of you please explain why the original code misbehaves?

> For instance, when the point is -!-, is the point on the first or
> second page here?  Emacs with and without the patch has different
> opinions on that.

Good point.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 11 Apr 2016 10:20:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 11 06:20:19 2016
Received: from localhost ([127.0.0.1]:58018 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1apYx9-0008Hc-H6
	for submit <at> debbugs.gnu.org; Mon, 11 Apr 2016 06:20:19 -0400
Received: from mail.mojserwer.eu ([195.110.48.8]:56350)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mbork@HIDDEN>) id 1apYx8-0008HU-0j
 for 20663 <at> debbugs.gnu.org; Mon, 11 Apr 2016 06:20:18 -0400
Received: from localhost (localhost [127.0.0.1])
 by mail.mojserwer.eu (Postfix) with ESMTP id 29B8DAB2210;
 Mon, 11 Apr 2016 12:20:15 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu
Received: from mail.mojserwer.eu ([127.0.0.1])
 by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 8QWM1mFN8Jmg; Mon, 11 Apr 2016 12:20:11 +0200 (CEST)
Received: from localhost (98-171.echostar.pl [213.156.98.171])
 by mail.mojserwer.eu (Postfix) with ESMTPSA id AD828AB2415;
 Mon, 11 Apr 2016 12:20:11 +0200 (CEST)
From: Marcin Borkowski <mbork@HIDDEN>
To: Pierre Neidhardt <ambrevar@HIDDEN>
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
References: <20150526171440.GG647@HIDDEN> <87h9fbum2w.fsf@HIDDEN>
 <83h9fbhu0p.fsf@HIDDEN> <871t6eve9c.fsf@HIDDEN>
 <837fg6injl.fsf@HIDDEN> <20160410012924.GA23097@HIDDEN>
Date: Mon, 11 Apr 2016 12:20:07 +0200
In-Reply-To: <20160410012924.GA23097@HIDDEN> (Pierre Neidhardt's message of
 "Sun, 10 Apr 2016 08:29:24 +0700")
Message-ID: <87fuus30rs.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20663
Cc: Eli Zaretskii <eliz@HIDDEN>, 20663 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Hi,

I spent a few minutes on this with Edebug and Git today.

On 2016-04-10, at 08:29, Pierre Neidhardt <ambrevar@HIDDEN> wrote:

> I did not expect this patch to be so confusing, but let me clarify the above questions:
>
> - `forward-page' is called by `narrow-to-page', which is bound to 'C-x n p' by
>   default.

True.

> - All the patch does it make the code consistent with its comments, that is:
>
> 	;; In case the page-delimiter matches the null string,
> 	;; don't find a match without moving.

Seems ok.

> - If you try the recipe (I just did on Emacs 24.5.1, don't have time to check
> now on upstream), you'll see that a page gets skipped, which is not the desired
> behaviour.

Condirmed.  And it doesn't happen with the patch installed.

> - As for side effects, there might be some, althought I haven't noticed anything
> in a year of use. If there is, then it is a bug in the caller.

That I still don't know.

I also checked when the discussed fragment was introduced.  It seems it
was commit 07f4ea7, and clearly the commiter did not adhere to the rules
concerning writing clear and informative commit messages. (SCNR;-P)
I still have a very vague idea about the patch.  I think it is crucial
to define clearly where the page boundary is.  For instance, when the
point is -!-, is the point on the first or second page here?  Emacs with
and without the patch has different opinions on that.

Page 1
-!-^L
Page 2
^L
Page 3

-- 
Marcin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 10 Apr 2016 01:26:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 09 21:26:48 2016
Received: from localhost ([127.0.0.1]:56468 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ap49I-0005zd-1M
	for submit <at> debbugs.gnu.org; Sat, 09 Apr 2016 21:26:48 -0400
Received: from mail-pa0-f67.google.com ([209.85.220.67]:34825)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ambrevar@HIDDEN>) id 1ap49G-0005zP-C0
 for 20663 <at> debbugs.gnu.org; Sat, 09 Apr 2016 21:26:46 -0400
Received: by mail-pa0-f67.google.com with SMTP id zy2so11694735pac.2
 for <20663 <at> debbugs.gnu.org>; Sat, 09 Apr 2016 18:26:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=77+yjqm6il57NsBfuVJ/FbZwTJ2ikSda5VIYp3TVEUQ=;
 b=aw695Lod5bueBzGpfoHKZFNJJlo+sMKLALLHo6Weqxezk/aW3ZN0ZgEBwhZW0KigjI
 94ohw2w8mtHmJyEByJUrGSiTYygvqH8/Ty+B4beC/Zr+9OAnCQUXCA7WQLKGNK6himDh
 CZ0SkcOZPmx55EZbd+e3d6UWYZmBXt+Q+fHzryb8Wl1HzyjpU3mzcHoyxjhUzpLMUfpy
 QnqK9AvruS4iV4p5sNNY2cfbyhNpJuZ/lKoPlateZb52GsHsTP31TkHjPfg08G951SMR
 Ad7kYAAzx8zf4431TeCprVj5tXsilsBagUmHm8OhtFA4uXXvMtaEujp+2QTQvegDZiLP
 ugfA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:in-reply-to:user-agent;
 bh=77+yjqm6il57NsBfuVJ/FbZwTJ2ikSda5VIYp3TVEUQ=;
 b=BZRmrOQ3mQgXFjdCuIWFewo/G8fFhtDTp2PCaIbrpeoVW48fz7QTQXPRJG0XC0jSBx
 aFNhC97zRn7Qqndo1pVTd0nN0kwrKKBslknBsi7Ea746QvQFBV13CZxSsCbbGuRsXCFK
 YSytVHAEeq6CeyVqrvHMcqFhkY8vtbQxdWEDOS1eB/RtGR4DkhqO6mgH1KYk+DH9Zw9T
 yQpr9dhnL0S0c71upj1OQNggQHHKYr97n4eOj1SsZLycmhrJY5WDVrAyyZJro7MO4+Su
 yX5g1LX519ppyzHZhryPc1At7AEkrTsNF5LtCciuVh2c8d+rTgnyabVOYmuWNHiiD7ub
 sOcQ==
X-Gm-Message-State: AD7BkJICsOhp9Qm3EyvM4Bov2JutIn6qBR01xTxZ4TQ2w5JrnqgvcJ0yjS0VM7eUovD26g==
X-Received: by 10.66.235.9 with SMTP id ui9mr23091510pac.135.1460251600511;
 Sat, 09 Apr 2016 18:26:40 -0700 (PDT)
Received: from gmail.com ([116.106.2.232])
 by smtp.gmail.com with ESMTPSA id s26sm27340672pfa.0.2016.04.09.18.26.38
 (version=TLSv1/SSLv3 cipher=OTHER);
 Sat, 09 Apr 2016 18:26:40 -0700 (PDT)
Date: Sun, 10 Apr 2016 08:29:24 +0700
From: Pierre Neidhardt <ambrevar@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
Message-ID: <20160410012924.GA23097@HIDDEN>
References: <20150526171440.GG647@HIDDEN> <87h9fbum2w.fsf@HIDDEN>
 <83h9fbhu0p.fsf@HIDDEN> <871t6eve9c.fsf@HIDDEN>
 <837fg6injl.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <837fg6injl.fsf@HIDDEN>
X-Info: Simplicity is the ultimate sophistication.
User-Agent: Mutt/1.5.24 (2015-08-30)
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20663
Cc: 20663 <at> debbugs.gnu.org, Marcin Borkowski <mbork@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

I did not expect this patch to be so confusing, but let me clarify the above questions:

- `forward-page' is called by `narrow-to-page', which is bound to 'C-x n p' by
  default.

- All the patch does it make the code consistent with its comments, that is:

	;; In case the page-delimiter matches the null string,
	;; don't find a match without moving.

- If you try the recipe (I just did on Emacs 24.5.1, don't have time to check
now on upstream), you'll see that a page gets skipped, which is not the desired
behaviour.

- As for side effects, there might be some, althought I haven't noticed anything
in a year of use. If there is, then it is a bug in the caller.

-- 
Pierre Neidhardt




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 9 Apr 2016 19:35:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 09 15:35:25 2016
Received: from localhost ([127.0.0.1]:56386 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aoyfF-0005vT-Hm
	for submit <at> debbugs.gnu.org; Sat, 09 Apr 2016 15:35:25 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34618)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1aoyfD-0005vH-Um
 for 20663 <at> debbugs.gnu.org; Sat, 09 Apr 2016 15:35:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1aoyf5-0002Rb-I1
 for 20663 <at> debbugs.gnu.org; Sat, 09 Apr 2016 15:35:18 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47610)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1aoyf5-0002RX-Eb; Sat, 09 Apr 2016 15:35:15 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2173
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1aoyf4-0005zm-Nm; Sat, 09 Apr 2016 15:35:15 -0400
Date: Sat, 09 Apr 2016 22:34:38 +0300
Message-Id: <837fg6injl.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Marcin Borkowski <mbork@HIDDEN>
In-reply-to: <871t6eve9c.fsf@HIDDEN> (message from Marcin Borkowski on Sat, 
 09 Apr 2016 20:16:47 +0200)
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
References: <20150526171440.GG647@HIDDEN> <87h9fbum2w.fsf@HIDDEN>
 <83h9fbhu0p.fsf@HIDDEN> <871t6eve9c.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.0 (------)
X-Debbugs-Envelope-To: 20663
Cc: 20663 <at> debbugs.gnu.org, ambrevar@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Marcin Borkowski <mbork@HIDDEN>
> Cc: ambrevar@HIDDEN, 20663 <at> debbugs.gnu.org
> Date: Sat, 09 Apr 2016 20:16:47 +0200
> 
> Well, I quickly glanced over the patch and decided that even if it
> worked for me, I wouldn't be sure whether it doesn't break something
> else.  Since you claim it rather won't work

I don't claim it doesn't work, I just don't have a clear understanding
of the problem, and consequently don't understand the solution, and
cannot judge whether it's TRT.

> I'm now tempted to look at this issue more closely.  Hopefully I'll
> be able to come up with a better patch in a few days.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 9 Apr 2016 18:16:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 09 14:16:55 2016
Received: from localhost ([127.0.0.1]:56334 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aoxRG-00044Z-QR
	for submit <at> debbugs.gnu.org; Sat, 09 Apr 2016 14:16:55 -0400
Received: from mail.mojserwer.eu ([195.110.48.8]:42231)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mbork@HIDDEN>) id 1aoxRF-00044Q-6b
 for 20663 <at> debbugs.gnu.org; Sat, 09 Apr 2016 14:16:53 -0400
Received: from localhost (localhost [127.0.0.1])
 by mail.mojserwer.eu (Postfix) with ESMTP id 00194AA92D1;
 Sat,  9 Apr 2016 20:16:51 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu
Received: from mail.mojserwer.eu ([127.0.0.1])
 by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id oh6zz4V8KJdg; Sat,  9 Apr 2016 20:16:48 +0200 (CEST)
Received: from localhost (98-171.echostar.pl [213.156.98.171])
 by mail.mojserwer.eu (Postfix) with ESMTPSA id 7D044AA92CE;
 Sat,  9 Apr 2016 20:16:48 +0200 (CEST)
References: <20150526171440.GG647@HIDDEN> <87h9fbum2w.fsf@HIDDEN>
 <83h9fbhu0p.fsf@HIDDEN>
User-agent: mu4e 0.9.13; emacs 25.1.50.8
From: Marcin Borkowski <mbork@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
In-reply-to: <83h9fbhu0p.fsf@HIDDEN>
Date: Sat, 09 Apr 2016 20:16:47 +0200
Message-ID: <871t6eve9c.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20663
Cc: 20663 <at> debbugs.gnu.org, ambrevar@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)


On 2016-04-09, at 12:00, Eli Zaretskii <eliz@HIDDEN> wrote:

>> From: Marcin Borkowski <mbork@HIDDEN>
>> Date: Sat, 09 Apr 2016 12:13:11 +0200
>> Cc: 20663 <at> debbugs.gnu.org
>> 
>> On 2015-05-26, at 19:14, Pierre Neidhardt <ambrevar@HIDDEN> wrote:
>> 
>> > When `page-delimiter` starts at the beginning of the line and the position is
>> > also at the beginning of the line, calling `forward-page` will skip one page.
>> >
>> > Running `emacs -Q example.txt`:
>> >
>> > 	M-<
>> > 	C-x n p
>> > 	M->
>> > 	M-1 C-x n p
>> >
>> > This should bring us from page 1 to page 2, but page 3 gets displayed instead.
>> >
>> > The attached patch fixes it by changing the code to actually match its
>> > surrounding comments.
>> 
>> Hi Emacs devs,
>> 
>> could someone take a look at the proposed patch?  It is not installed as
>> of GNU Emacs 25.1.50.8 (commit 1e8cd05), and I don't feel competent
>> enough to be sure it does not have any adverse side effects.
>
> Maybe I'm missing something, but I don't see the connection between
> the description of the bug, the recipe, and the patch.
>
> The description talks about calling forward-page, but the recipe
> doesn't call it.  The patch compares page-delimiter with an empty
> string, but the default value of page-delimiter is not empty.
>
> So I'm mightily confused by this.  Hopefully, someone will show me
> what I'm missing.

Well, I quickly glanced over the patch and decided that even if it
worked for me, I wouldn't be sure whether it doesn't break something
else.  Since you claim it rather won't work, I'm now tempted to look at
this issue more closely.  Hopefully I'll be able to come up with
a better patch in a few days.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 9 Apr 2016 12:00:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 09 08:00:53 2016
Received: from localhost ([127.0.0.1]:55230 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aorZN-0003AX-JY
	for submit <at> debbugs.gnu.org; Sat, 09 Apr 2016 08:00:53 -0400
Received: from eggs.gnu.org ([208.118.235.92]:36165)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1aorZM-0003AI-NU
 for 20663 <at> debbugs.gnu.org; Sat, 09 Apr 2016 08:00:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1aorZE-0003eH-FG
 for 20663 <at> debbugs.gnu.org; Sat, 09 Apr 2016 08:00:47 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39573)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1aorZE-0003e9-C4; Sat, 09 Apr 2016 08:00:44 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1490
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1aorZD-0006df-Kr; Sat, 09 Apr 2016 08:00:44 -0400
Date: Sat, 09 Apr 2016 15:00:06 +0300
Message-Id: <83h9fbhu0p.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Marcin Borkowski <mbork@HIDDEN>
In-reply-to: <87h9fbum2w.fsf@HIDDEN> (message from Marcin Borkowski on Sat, 
 09 Apr 2016 12:13:11 +0200)
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
References: <20150526171440.GG647@HIDDEN> <87h9fbum2w.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.0 (------)
X-Debbugs-Envelope-To: 20663
Cc: 20663 <at> debbugs.gnu.org, ambrevar@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Marcin Borkowski <mbork@HIDDEN>
> Date: Sat, 09 Apr 2016 12:13:11 +0200
> Cc: 20663 <at> debbugs.gnu.org
> 
> On 2015-05-26, at 19:14, Pierre Neidhardt <ambrevar@HIDDEN> wrote:
> 
> > When `page-delimiter` starts at the beginning of the line and the position is
> > also at the beginning of the line, calling `forward-page` will skip one page.
> >
> > Running `emacs -Q example.txt`:
> >
> > 	M-<
> > 	C-x n p
> > 	M->
> > 	M-1 C-x n p
> >
> > This should bring us from page 1 to page 2, but page 3 gets displayed instead.
> >
> > The attached patch fixes it by changing the code to actually match its
> > surrounding comments.
> 
> Hi Emacs devs,
> 
> could someone take a look at the proposed patch?  It is not installed as
> of GNU Emacs 25.1.50.8 (commit 1e8cd05), and I don't feel competent
> enough to be sure it does not have any adverse side effects.

Maybe I'm missing something, but I don't see the connection between
the description of the bug, the recipe, and the patch.

The description talks about calling forward-page, but the recipe
doesn't call it.  The patch compares page-delimiter with an empty
string, but the default value of page-delimiter is not empty.

So I'm mightily confused by this.  Hopefully, someone will show me
what I'm missing.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at 20663 <at> debbugs.gnu.org:


Received: (at 20663) by debbugs.gnu.org; 9 Apr 2016 10:13:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 09 06:13:22 2016
Received: from localhost ([127.0.0.1]:55186 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aoptK-0007RL-L2
	for submit <at> debbugs.gnu.org; Sat, 09 Apr 2016 06:13:22 -0400
Received: from mail.mojserwer.eu ([195.110.48.8]:33312)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mbork@HIDDEN>) id 1aoptJ-0007RD-IG
 for 20663 <at> debbugs.gnu.org; Sat, 09 Apr 2016 06:13:21 -0400
Received: from localhost (localhost [127.0.0.1])
 by mail.mojserwer.eu (Postfix) with ESMTP id 74BA4AA51D5;
 Sat,  9 Apr 2016 12:13:19 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu
Received: from mail.mojserwer.eu ([127.0.0.1])
 by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id l3QVeBNBLJTw; Sat,  9 Apr 2016 12:13:17 +0200 (CEST)
Received: from localhost (98-171.echostar.pl [213.156.98.171])
 by mail.mojserwer.eu (Postfix) with ESMTPSA id 398B2AA51D4;
 Sat,  9 Apr 2016 12:13:17 +0200 (CEST)
From: Marcin Borkowski <mbork@HIDDEN>
To: Pierre Neidhardt <ambrevar@HIDDEN>
Subject: Re: bug#20663: page.el (forward-page): Avoid skipping pages
References: <20150526171440.GG647@HIDDEN>
Date: Sat, 09 Apr 2016 12:13:11 +0200
In-Reply-To: <20150526171440.GG647@HIDDEN> (Pierre Neidhardt's message of
 "Tue, 26 May 2015 19:14:40 +0200")
Message-ID: <87h9fbum2w.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20663
Cc: 20663 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

On 2015-05-26, at 19:14, Pierre Neidhardt <ambrevar@HIDDEN> wrote:

> When `page-delimiter` starts at the beginning of the line and the position is
> also at the beginning of the line, calling `forward-page` will skip one page.
>
> Running `emacs -Q example.txt`:
>
> 	M-<
> 	C-x n p
> 	M->
> 	M-1 C-x n p
>
> This should bring us from page 1 to page 2, but page 3 gets displayed instead.
>
> The attached patch fixes it by changing the code to actually match its
> surrounding comments.

Hi Emacs devs,

could someone take a look at the proposed patch?  It is not installed as
of GNU Emacs 25.1.50.8 (commit 1e8cd05), and I don't feel competent
enough to be sure it does not have any adverse side effects.

Best,

-- 
Marcin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 May 2015 17:22:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 26 13:22:35 2015
Received: from localhost ([127.0.0.1]:57328 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YxIYl-000646-2e
	for submit <at> debbugs.gnu.org; Tue, 26 May 2015 13:22:35 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39237)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ambrevar@HIDDEN>) id 1YxIPm-0005oy-HE
 for submit <at> debbugs.gnu.org; Tue, 26 May 2015 13:13:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ambrevar@HIDDEN>) id 1YxIPg-0003yv-E9
 for submit <at> debbugs.gnu.org; Tue, 26 May 2015 13:13:13 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
 FSL_HELO_FAKE,T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:56969)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ambrevar@HIDDEN>) id 1YxIPg-0003yk-Bu
 for submit <at> debbugs.gnu.org; Tue, 26 May 2015 13:13:12 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52712)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ambrevar@HIDDEN>) id 1YxIPf-0002VU-FW
 for bug-gnu-emacs@HIDDEN; Tue, 26 May 2015 13:13:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ambrevar@HIDDEN>) id 1YxIPa-0003wC-Ao
 for bug-gnu-emacs@HIDDEN; Tue, 26 May 2015 13:13:11 -0400
Received: from mail-la0-x234.google.com ([2a00:1450:4010:c03::234]:32951)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ambrevar@HIDDEN>) id 1YxIPa-0003vZ-3Z
 for bug-gnu-emacs@HIDDEN; Tue, 26 May 2015 13:13:06 -0400
Received: by lalw1 with SMTP id w1so4855463lal.0
 for <bug-gnu-emacs@HIDDEN>; Tue, 26 May 2015 10:13:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:subject:message-id:mime-version:content-type
 :content-disposition:user-agent;
 bh=/VjLUp/QmN8FM16kiVUlwBdYb7Mu8l8t7LWDHCNLM9w=;
 b=WLgT/p5mNJVseSm/zXT1G42e90JRBlhy4acoZ4ZLdaJLJ6KA9X6UQZcHazfBkQrhJE
 E9O/HFHR14wCsJfyihDB4UcQttIkdSKc5hTwO0e7soI9vTsX5nPIkyhCNstJ0Yu3PMuu
 RPv97YdOjxEErQk720IjGd8u5wcA/YJW/ooy1GT0ZzrN41zzoMXI5ZKHhheVkyigWa7o
 LyzCUDa5Eb6WP2U9uSKvbR1AX55SD63NDmQQw+/dkWc4Rf26ICklPFDGuY+OvrncAtIO
 kqjGE4uqd0o9F4gI9Hc75jpcKeAEkgocayVwvrz1EnXZTgehInBT0uDiTD1+eq57EdsZ
 FCzw==
X-Received: by 10.112.51.146 with SMTP id k18mr23388590lbo.91.1432660384810;
 Tue, 26 May 2015 10:13:04 -0700 (PDT)
Received: from gmail.com (c80-217-163-156.bredband.comhem.se. [80.217.163.156])
 by mx.google.com with ESMTPSA id jl4sm3168349lbc.14.2015.05.26.10.13.03
 for <bug-gnu-emacs@HIDDEN>
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 26 May 2015 10:13:04 -0700 (PDT)
Date: Tue, 26 May 2015 19:14:40 +0200
From: Pierre Neidhardt <ambrevar@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: page.el (forward-page): Avoid skipping pages
Message-ID: <20150526171440.GG647@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="xHFwDpU9dbj6ez1V"
Content-Disposition: inline
X-Info: Simplicity is the ultimate sophistication.
User-Agent: Mutt/1.5.23 (2014-03-12)
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -2.5 (--)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 26 May 2015 13:22:32 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.5 (--)


--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

When `page-delimiter` starts at the beginning of the line and the position is
also at the beginning of the line, calling `forward-page` will skip one page.

Running `emacs -Q example.txt`:

	M-<
	C-x n p
	M->
	M-1 C-x n p

This should bring us from page 1 to page 2, but page 3 gets displayed instead.

The attached patch fixes it by changing the code to actually match its
surrounding comments.


In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.2)
 of 2015-04-20 on bitzer.hoetzel.info
Windowing system distributor `The X.Org Foundation', version 11.0.11701000
System Description:	Arch Linux

Configured using:
 `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
 --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Important settings:
  value of $LC_MESSAGES: sv_SE.UTF-8
  value of $LANG: sv_SE.UTF-8
  locale-coding-system: utf-8-unix

-- 
Pierre Neidhardt

Virginia law forbids bathtubs in the house; tubs must be kept in the yard.

--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=ChangeLog

	* page.el (forward-page): Avoid skipping pages

--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="example.txt"

Page 1

Page 2

Page 3

--xHFwDpU9dbj6ez1V
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="page.patch"

diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el
index 39db5bb..c875a49 100644
--- a/lisp/textmodes/page.el
+++ b/lisp/textmodes/page.el
@@ -37,7 +37,7 @@ A page boundary is any line whose beginning matches the regexp
   (while (and (> count 0) (not (eobp)))
     ;; In case the page-delimiter matches the null string,
     ;; don't find a match without moving.
-    (if (bolp) (forward-char 1))
+    (if (string= page-delimiter "") (forward-char 1))
     (if (re-search-forward page-delimiter nil t)
 	nil
       (goto-char (point-max)))

--xHFwDpU9dbj6ez1V--




Acknowledgement sent to Pierre Neidhardt <ambrevar@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#20663; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 27 Apr 2016 08:00:02 UTC

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