Subject: bug#6825: what-page line count

From: Stephen Berman <[email-masked]>
Date: Wed, 25 Aug 2010 00:16:41 +0200

On Thu, 19 Aug 2010 20:53:42 -0600 Christoph <[email-masked]> wrote:

> emacs -Q
> in *scratch* buffer type something
> C-a
> M-x what-page
> Output in minibuffer: Page 1, line 5
> C-f
> M-x what-page
> Output in minibuffer: Page 1, line 6

AFAICT using line-number-at-pos instead of count-lines DTRT, see patch
below.

Steve Berman

2010-08-21  Stephen Berman  <[email-masked]>

        * page.el (what-page): Use line-number-at-pos instead of
        count-lines to calculate line number.

*** /data/steve/bzr/emacs/trunk/lisp/textmodes/page.el	2010-01-13 10:56:56.000000000 +0100
--- /data/steve/bzr/emacs/quickfixes/lisp/textmodes/page.el	2010-08-24 23:30:11.000000000 +0200
***************
*** 156,164 ****
            (if (= (match-beginning 0) (match-end 0))
                (forward-char 1))
  	  (setq count (1+ count)))
! 	(message "Page %d, line %d"
! 		 count
! 		 (1+ (count-lines (point) opoint)))))))
  
  ;;; Place `provide' at end of file.
  (provide 'page)
--- 156,162 ----
            (if (= (match-beginning 0) (match-end 0))
                (forward-char 1))
  	  (setq count (1+ count)))
! 	(message "Page %d, line %d" count (line-number-at-pos opoint))))))
  
  ;;; Place `provide' at end of file.
  (provide 'page)