bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#6825: what-page line count


From: Stephen Berman
Subject: bug#6825: what-page line count
Date: Wed, 25 Aug 2010 00:16:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

On Thu, 19 Aug 2010 20:53:42 -0600 Christoph <cschol2112@googlemail.com> 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  <stephen.berman@gmx.net>

        * 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)

reply via email to

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