all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#7115: 23.1;  count-lines
@ 2010-09-27 11:15 Andreas Röhler
  2010-09-27 17:24 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Röhler @ 2010-09-27 11:15 UTC (permalink / raw)
  To: 7115


Hi,

`count-lines' returns different values
if cursor is at the bol or not.

The bug is reffered to in the docu already,

"...but can be one more if START is not equal to END
and the greater of them is not at the start of a line."

Looks like a doku bug too: if start is equal to end,
which lines are to count?

IMHO there is no need for these bugs.

Also `count-lines' should have a default value for it's
arguments,

(point-min) (point) for example.

What about to implement it simply

(1+ (count-matches "[\n\C-m]" start end))

Thanks

Andreas

GNU Emacs 23.1.1 (i586-suse-linux-gnu, GTK+ Version 2.20.1) of 2010-07-05

--
https://code.launchpad.net/~a-roehler/python-mode
https://code.launchpad.net/s-x-emacs-werkstatt/





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

end of thread, other threads:[~2010-09-27 17:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-27 11:15 bug#7115: 23.1; count-lines Andreas Röhler
2010-09-27 17:24 ` Andreas Schwab

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.