# HG changeset patch # User Richard M. Stallman # Date 871427921 0 # Node ID 14681d10a9734f13cebc2aafdb80fbcd72c5d9bd # Parent db1b53ad6c807a37803bec66ae99dbe21639fa6d (forward-visible-line): Handle nil value from next-single-property-change or previous-single-property-change. diff -r db1b53ad6c80 -r 14681d10a973 lisp/simple.el --- a/lisp/simple.el Tue Aug 12 23:08:13 1997 +0000 +++ b/lisp/simple.el Tue Aug 12 23:18:41 1997 +0000 @@ -1202,9 +1202,11 @@ prop (or (memq prop buffer-invisibility-spec) (assq prop buffer-invisibility-spec))))) - (if (get-text-property (point) 'invisible) - (goto-char (next-single-property-change (point) 'invisible)) - (goto-char (next-overlay-change (point)))) + (goto-char + (if (get-text-property (point) 'invisible) + (or (next-single-property-change (point) 'invisible) + (point-max)) + (next-overlay-change (point)))) (or (zerop (forward-line 1)) (signal 'end-of-buffer nil))) (setq arg (1- arg))) @@ -1221,9 +1223,11 @@ prop (or (memq prop buffer-invisibility-spec) (assq prop buffer-invisibility-spec))))) - (if (get-text-property (1- (point)) 'invisible) - (goto-char (previous-single-property-change (point) 'invisible)) - (goto-char (previous-overlay-change (point)))) + (goto-char + (if (get-text-property (1- (point)) 'invisible) + (or (previous-single-property-change (point) 'invisible) + (point-min)) + (previous-overlay-change (point)))) (or (zerop (forward-line -1)) (signal 'beginning-of-buffer nil))) (setq first nil)