From: Chong Yidong Date: Thu, 22 Mar 2012 07:38:05 +0000 (+0800) Subject: Fix corner case in end-of-visible-line. X-Git-Tag: emacs-pretest-24.0.05~77 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=64fee3118aed82c404193c6ef23aad65bc5994a9;p=emacs.git Fix corner case in end-of-visible-line. * lisp/simple.el (end-of-visible-line): Handle return value of next-single-property-change properly. Fixes: debbugs:9371 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8601fb78b75..f844f3f8f32 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-03-22 Chong Yidong + + * simple.el (end-of-visible-line): Handle return value of + next-single-property-change properly (Bug#9371). + 2012-03-22 Kenichi Handa * international/quail.el (quail-insert-kbd-layout): Fix previous diff --git a/lisp/simple.el b/lisp/simple.el index 936037f5caa..8b04534455d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3688,7 +3688,8 @@ If ARG is zero, move to the beginning of the current line." (assq prop buffer-invisibility-spec)))))) (skip-chars-forward "^\n") (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)))) (end-of-line)))