X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/2846c6e3607995ce250435e5998ea6a08f60dd89..da95e2399e068eb87ea90a4617d80980d0601eb4:/lisp/textmodes/page.el?ds=sidebyside diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el index 448034d443..d5351089d5 100644 --- a/lisp/textmodes/page.el +++ b/lisp/textmodes/page.el @@ -1,10 +1,10 @@ ;;; page.el --- page motion commands for Emacs -;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, -;; 2006, 2007, 2008 Free Software Foundation, Inc. +;; Copyright (C) 1985, 2001-2014 Free Software Foundation, Inc. -;; Maintainer: FSF +;; Maintainer: emacs-devel@gnu.org ;; Keywords: wp convenience +;; Package: emacs ;; This file is part of GNU Emacs. @@ -149,18 +149,18 @@ thus showing a page other than the one point was originally in." (save-restriction (widen) (save-excursion - (beginning-of-line) (let ((count 1) (opoint (point))) - (goto-char 1) + (goto-char (point-min)) (while (re-search-forward page-delimiter opoint t) + (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))))))) + (message "Page %d, line %d" count (line-number-at-pos opoint)))))) + + ;;; Place `provide' at end of file. (provide 'page) -;; arch-tag: e8d7a0bd-8655-4b6e-b852-f2ee25316a1d ;;; page.el ends here