(beg (progn (beginning-of-line) (if (bobp) (point) (1- (point)))))
(eoi (when end
(if (fboundp 'next-single-char-property-change)
- (next-single-char-property-change end 'invisible)
+ (if (featurep 'xemacs)
+ (or (next-single-char-property-change end 'invisible)
+ (point-max))
+ (next-single-char-property-change end 'invisible))
(while (progn
(end-of-line 2)
(and (not (eobp))