unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6825: what-page line count
@ 2010-08-07 13:39 Markus Falb
  2010-08-20  2:53 ` Christoph
  2011-04-10 20:52 ` Chong Yidong
  0 siblings, 2 replies; 4+ messages in thread
From: Markus Falb @ 2010-08-07 13:39 UTC (permalink / raw)
  To: 6825

[-- Attachment #1: Type: text/plain, Size: 510 bytes --]

Visit a new file and type some arbitrary text and move point to begin  
of line.
C-x C-f newfile RET bla C-a

If point is at line 1 column 0 what-page says (expected):
Page 1, line 1

but when at column > 0 (moved point with C-f) what-page says:
Page 1, line 2

I get this behavior with 23.2.1 on os-x (macports) both with gui or  
not, e.g.

GNU Emacs 23.2.1 (powerpc-apple-darwin9.8.0, NS apple-appkit-949.54)
  of 2010-05-11 on mac.fasel.at

I may provide more Information if needed, of course.

-- 
Markus

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#6825: what-page line count
  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
  2011-04-10 20:52 ` Chong Yidong
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph @ 2010-08-20  2:53 UTC (permalink / raw)
  To: 6825; +Cc: markus.falb

I can reproduce this with 24.0.50 (r101141) on Windows 7.

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


In GNU Emacs 24.0.50.1 (i386-mingw-nt6.1.7600)
  of 2010-08-19 on MARVIN
Windowing system distributor `Microsoft Corp.', version 6.1.7600
configured using `configure --with-gcc (4.4) --cflags 
-IC:Progra~2GnuWin32include -ID:devel^[macslibXpm-3.5.8include 
-ID:devel^[macslibXpm-3.5.8src'

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: nil
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: ENU
   value of $XMODIFIERS: nil
   locale-coding-system: cp1252
   default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
   tooltip-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t

Recent input:
t e s t C-a M-x w h a t - o <backspace> p a g e <tab>
<return> C-f M-x <up> <return> M-x r e p o r t <tab>
<return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Page 1, line 5
Page 1, line 6

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr message rfc822 mml easymenu mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
emacsbug tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32
disp-table ls-lisp w32-win w32-vars tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev button minibuffer faces cus-face files text-properties overlay
md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process multi-tty emacs)





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#6825: what-page line count
  2010-08-20  2:53 ` Christoph
@ 2010-08-24 22:16   ` Stephen Berman
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Berman @ 2010-08-24 22:16 UTC (permalink / raw)
  To: Christoph; +Cc: markus.falb, 6825

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#6825: what-page line count
  2010-08-07 13:39 bug#6825: what-page line count Markus Falb
  2010-08-20  2:53 ` Christoph
@ 2011-04-10 20:52 ` Chong Yidong
  1 sibling, 0 replies; 4+ messages in thread
From: Chong Yidong @ 2011-04-10 20:52 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Markus Falb, 6825

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

Thanks, applied.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-10 20:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-04-10 20:52 ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).