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

Previous Next

Package: emacs;

Reported by: Pierre Neidhardt <ambrevar <at> gmail.com>

Date: Tue, 26 May 2015 17:23:02 UTC

Severity: minor

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Marcin Borkowski <mbork <at> mbork.pl>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20663 <at> debbugs.gnu.org, ambrevar <at> gmail.com
Subject: bug#20663: page.el (forward-page): Avoid skipping pages
Date: Sat, 16 Apr 2016 13:03:41 +0200
On 2016-04-13, at 17:53, Marcin Borkowski <mbork <at> mbork.pl> 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




This bug report was last modified 3 years and 42 days ago.

Previous Next


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