From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mario Lang Newsgroups: gmane.emacs.devel Subject: what-page and first line of page? Date: Mon, 14 Sep 2009 12:42:53 +0200 Message-ID: <87tyz5ajte.fsf@x2.delysid.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1252924958 2015 80.91.229.12 (14 Sep 2009 10:42:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Sep 2009 10:42:38 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 14 12:42:30 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mn90v-0003Od-UZ for ged-emacs-devel@m.gmane.org; Mon, 14 Sep 2009 12:42:30 +0200 Original-Received: from localhost ([127.0.0.1]:41694 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mn90u-0006Vj-Pd for ged-emacs-devel@m.gmane.org; Mon, 14 Sep 2009 06:42:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mn90l-0006Tk-O1 for emacs-devel@gnu.org; Mon, 14 Sep 2009 06:42:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mn90f-0006OR-LM for emacs-devel@gnu.org; Mon, 14 Sep 2009 06:42:18 -0400 Original-Received: from [199.232.76.173] (port=51957 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mn90f-0006O4-8U for emacs-devel@gnu.org; Mon, 14 Sep 2009 06:42:13 -0400 Original-Received: from viefep17-int.chello.at ([62.179.121.37]:12609) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mn90e-00037A-Ec for emacs-devel@gnu.org; Mon, 14 Sep 2009 06:42:12 -0400 Original-Received: from edge01.upc.biz ([192.168.13.236]) by viefep17-int.chello.at (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20090914104159.ZLDB8011.viefep17-int.chello.at@edge01.upc.biz> for ; Mon, 14 Sep 2009 12:41:59 +0200 Original-Received: from x2.delysid.org ([84.115.136.207]) by edge01.upc.biz with edge id gahx1c07J4UfZvY01ahyUP; Mon, 14 Sep 2009 12:41:59 +0200 X-SourceIP: 84.115.136.207 Original-Received: from mlang by x2.delysid.org with local (Exim 4.69) (envelope-from ) id 1Mn91K-00046F-1V for emacs-devel@gnu.org; Mon, 14 Sep 2009 12:42:54 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115298 Archived-At: Hi. I am editiing a long document where original page numbers are important. When I use `what-page' to see to which physical page the position of point currently corresponds, I notice that it does not work on the first line which starts with ^L. I.e.: line 1 or page 1 line 2 of page 1 line 1 of page 2 To make `what-page' return the correct page number I either always have to immediately follow ^L with a newline, or remove `beginning-of-line' in the definition of `what-page': (defun what-page () "Print page and line number of point." (interactive) (save-restriction (widen) (save-excursion ;(beginning-of-line) (let ((count 1) (opoint (point))) (goto-char 1) (while (re-search-forward page-delimiter opoint t) (setq count (1+ count))) (message "Page %d, line %d" count (1+ (count-lines (point) opoint))))))) I am arguing this is a bug. Does anyone know why the `beginning-of-line' is actually in there? --=20 CYa, =E2=A1=8D=E2=A0=81=E2=A0=97=E2=A0=8A=E2=A0=95