From da263640c8157ddf9a9656f45ec7e8afcbcadbb4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 25 Jun 2019 11:35:56 -0400 Subject: [PATCH] * lisp/simple.el (forward-visible-line, end-of-visible-line): Use invisible-p --- lisp/simple.el | 39 +++++++-------------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 5e9d13f9f86..87159366f61 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5261,24 +5261,14 @@ If ARG is zero, move to the beginning of the current line." (signal 'end-of-buffer nil)) ;; If the newline we just skipped is invisible, ;; don't count it. - (let ((prop - (get-char-property (1- (point)) 'invisible))) - (if (if (eq buffer-invisibility-spec t) - prop - (or (memq prop buffer-invisibility-spec) - (assq prop buffer-invisibility-spec))) - (setq arg (1+ arg)))) + (if (invisible-p (1- (point))) + (setq arg (1+ arg))) (setq arg (1- arg))) ;; If invisible text follows, and it is a number of complete lines, ;; skip it. (let ((opoint (point))) (while (and (not (eobp)) - (let ((prop - (get-char-property (point) 'invisible))) - (if (eq buffer-invisibility-spec t) - prop - (or (memq prop buffer-invisibility-spec) - (assq prop buffer-invisibility-spec))))) + (invisible-p (point))) (goto-char (if (get-text-property (point) 'invisible) (or (next-single-property-change (point) 'invisible) @@ -5295,24 +5285,14 @@ If ARG is zero, move to the beginning of the current line." ;; If the newline we just moved to is invisible, ;; don't count it. (unless (bobp) - (let ((prop - (get-char-property (1- (point)) 'invisible))) - (unless (if (eq buffer-invisibility-spec t) - prop - (or (memq prop buffer-invisibility-spec) - (assq prop buffer-invisibility-spec))) - (setq arg (1+ arg))))) + (unless (invisible-p (1- (point))) + (setq arg (1+ arg)))) (setq first nil)) ;; If invisible text follows, and it is a number of complete lines, ;; skip it. (let ((opoint (point))) (while (and (not (bobp)) - (let ((prop - (get-char-property (1- (point)) 'invisible))) - (if (eq buffer-invisibility-spec t) - prop - (or (memq prop buffer-invisibility-spec) - (assq prop buffer-invisibility-spec))))) + (invisible-p (1- (point)))) (goto-char (if (get-text-property (1- (point)) 'invisible) (or (previous-single-property-change (point) 'invisible) @@ -5332,12 +5312,7 @@ If ARG is zero, move to the beginning of the current line." (while (and (not (eobp)) (save-excursion (skip-chars-forward "^\n") - (let ((prop - (get-char-property (point) 'invisible))) - (if (eq buffer-invisibility-spec t) - prop - (or (memq prop buffer-invisibility-spec) - (assq prop buffer-invisibility-spec)))))) + (invisible-p (point)))) (skip-chars-forward "^\n") (if (get-text-property (point) 'invisible) (goto-char (or (next-single-property-change (point) 'invisible) -- 2.39.5