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

* bug#7115: 23.1;  count-lines
  2010-09-27 11:15 bug#7115: 23.1; count-lines Andreas Röhler
@ 2010-09-27 17:24 ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2010-09-27 17:24 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: 7115

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

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

All lines between start and end.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





^ 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.