unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Mario Lang <mlang@delysid.org>,
	Emacs Bug Tracker <submit@emacsbugs.donarmstrong.com>,
	emacs-devel@gnu.org
Subject: Re: what-page and first line of page?
Date: Wed, 16 Sep 2009 13:15:05 +0200	[thread overview]
Message-ID: <f7ccd24b0909160415y1e4e2200pe09806970192c1c0@mail.gmail.com> (raw)
In-Reply-To: <jwviqfl57fe.fsf-monnier+emacs@gnu.org>

On Tue, Sep 15, 2009 at 03:22, Stefan Monnier <monnier@iro.umontreal.ca> 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	other threads:[~2009-09-16 11:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14 10:42 what-page and first line of page? Mario Lang
2009-09-15  1:22 ` Stefan Monnier
2009-09-16 11:15   ` Juanma Barranquero [this message]
2009-09-16 13:15     ` Stefan Monnier
2009-09-16 13:36       ` Juanma Barranquero

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=f7ccd24b0909160415y1e4e2200pe09806970192c1c0@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=mlang@delysid.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=submit@emacsbugs.donarmstrong.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).