diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-08-12 23:18:41 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-08-12 23:18:41 +0000 |
commit | 4470d97c2d0171e186c7a039711c27d5688de557 (patch) | |
tree | 1ee1a8e3166766401bfa315540bbf8e973de5b01 /lisp | |
parent | aa5204d7875235bf0ee81b45d9fcb87e7ce7c8ca (diff) | |
download | emacs-4470d97c2d0171e186c7a039711c27d5688de557.tar.gz |
(forward-visible-line): Handle nil value from
next-single-property-change or previous-single-property-change.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/simple.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index a00368e47a5..a676353fa56 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1202,9 +1202,11 @@ If ARG is zero, move to the beginning of the current line." 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 @@ If ARG is zero, move to the beginning of the current line." 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) |