From: Stephen Berman <stephen.berman@gmx.net>
To: Christoph <cschol2112@googlemail.com>
Cc: markus.falb@fasel.at, 6825@debbugs.gnu.org
Subject: bug#6825: what-page line count
Date: Wed, 25 Aug 2010 00:16:41 +0200 [thread overview]
Message-ID: <878w3vodva.fsf@escher.home> (raw)
In-Reply-To: <4C6DEE36.4060700@gmail.com> (Christoph's message of "Thu, 19 Aug 2010 20:53:42 -0600")
[-- Attachment #1: Type: text/plain, Size: 512 bytes --]
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.
[-- Attachment #2: what-page patch --]
[-- Type: text/plain, Size: 749 bytes --]
*** /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)))))))
\f
;;; 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))))))
\f
;;; Place `provide' at end of file.
(provide 'page)
next prev parent reply other threads:[~2010-08-24 22:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-07 13:39 bug#6825: what-page line count Markus Falb
2010-08-20 2:53 ` Christoph
2010-08-24 22:16 ` Stephen Berman [this message]
2011-04-10 20:52 ` Chong Yidong
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878w3vodva.fsf@escher.home \
--to=stephen.berman@gmx.net \
--cc=6825@debbugs.gnu.org \
--cc=cschol2112@googlemail.com \
--cc=markus.falb@fasel.at \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.