changeset 19326:14681d10a973

(forward-visible-line): Handle nil value from next-single-property-change or previous-single-property-change.
author Richard M. Stallman <rms@gnu.org>
date Tue, 12 Aug 1997 23:18:41 +0000
parents db1b53ad6c80
children 70e5d1211d98
files lisp/simple.el
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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)