changeset 41924:beab88f3e24f

(line-move): Cope if next-single-property-change or previous-single-property-change returns nil.
author Richard M. Stallman <rms@gnu.org>
date Mon, 10 Dec 2001 20:38:47 +0000
parents 86ecd07d46fb
children 524400c8c8b5
files lisp/simple.el
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Mon Dec 10 20:37:11 2001 +0000
+++ b/lisp/simple.el	Mon Dec 10 20:38:47 2001 +0000
@@ -2543,7 +2543,8 @@
 			      (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 (or (next-single-property-change (point) 'invisible)
+				   (point-max)))
 		  (goto-char (next-overlay-change (point)))))
 	      (setq arg (1- arg)))
 	    (while (< arg 0)
@@ -2558,7 +2559,8 @@
 			      (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 (or (previous-single-property-change (point) 'invisible)
+				   (point-min)))
 		  (goto-char (previous-overlay-change (point)))))
 	      (setq arg (1+ arg))))
 	  (let ((buffer-invisibility-spec nil))