emacs-devel
[Top][All Lists]
Advanced

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

Re: what-page and first line of page?


From: Juanma Barranquero
Subject: Re: what-page and first line of page?
Date: Wed, 16 Sep 2009 13:15:05 +0200

On Tue, Sep 15, 2009 at 03:22, Stefan Monnier <address@hidden> wrote:

> I removed the beginning-of-line (has been there since the original
> commit 1.1 in 1989).

Strangely enough, that `beginning-of-line' somewhat masked a bug in
`what-page' that happens when `re-search-forward' matches but does not
move the point.

For example,

  emacs -Q lisp/ChangeLog
  M-x what-page <RET>         => "Page 1, line 1"

but

  emacs -Q lisp/ChangeLog
  <right>
  M-x what-page <RET>        => loops until C-g

This happens in ChangeLog files because `page-delimiter' has the value
"^\\<\\|^\f", which matches the empty string at the beginning of the
buffer.

I said the change "somewhat masked" the bug because before it, when
the point was on the first line of a ChangeLog, opoint was 1 (because
of the beginning-of-line), so the match failed and `what-page'
terminated. It only looped from line 2 on, while now it loops from
point 2 on.

    Juanma




reply via email to

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