Often when particular lines are hidden, one  wants to count only visible lines.  count-lines presently cannot do this.  XEmacs has for a long-time had count-lines take an optional 3rd parameter flag which if non-nil, ignores invisible lines in the line count.  This would be very helpful whenever selective-display is in use.