aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2019-06-25 11:35:56 -0400
committerStefan Monnier2019-06-25 11:35:56 -0400
commitda263640c8157ddf9a9656f45ec7e8afcbcadbb4 (patch)
tree2e748247797d968404f60d3a339ad9a8bfee73bc
parentb26c2767edd98787297879c4570a2702eef031be (diff)
downloademacs-da263640c8157ddf9a9656f45ec7e8afcbcadbb4.tar.gz
emacs-da263640c8157ddf9a9656f45ec7e8afcbcadbb4.zip
* lisp/simple.el (forward-visible-line, end-of-visible-line): Use invisible-p
-rw-r--r--lisp/simple.el39
1 files 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."
5261 (signal 'end-of-buffer nil)) 5261 (signal 'end-of-buffer nil))
5262 ;; If the newline we just skipped is invisible, 5262 ;; If the newline we just skipped is invisible,
5263 ;; don't count it. 5263 ;; don't count it.
5264 (let ((prop 5264 (if (invisible-p (1- (point)))
5265 (get-char-property (1- (point)) 'invisible))) 5265 (setq arg (1+ arg)))
5266 (if (if (eq buffer-invisibility-spec t)
5267 prop
5268 (or (memq prop buffer-invisibility-spec)
5269 (assq prop buffer-invisibility-spec)))
5270 (setq arg (1+ arg))))
5271 (setq arg (1- arg))) 5266 (setq arg (1- arg)))
5272 ;; If invisible text follows, and it is a number of complete lines, 5267 ;; If invisible text follows, and it is a number of complete lines,
5273 ;; skip it. 5268 ;; skip it.
5274 (let ((opoint (point))) 5269 (let ((opoint (point)))
5275 (while (and (not (eobp)) 5270 (while (and (not (eobp))
5276 (let ((prop 5271 (invisible-p (point)))
5277 (get-char-property (point) 'invisible)))
5278 (if (eq buffer-invisibility-spec t)
5279 prop
5280 (or (memq prop buffer-invisibility-spec)
5281 (assq prop buffer-invisibility-spec)))))
5282 (goto-char 5272 (goto-char
5283 (if (get-text-property (point) 'invisible) 5273 (if (get-text-property (point) 'invisible)
5284 (or (next-single-property-change (point) 'invisible) 5274 (or (next-single-property-change (point) 'invisible)
@@ -5295,24 +5285,14 @@ If ARG is zero, move to the beginning of the current line."
5295 ;; If the newline we just moved to is invisible, 5285 ;; If the newline we just moved to is invisible,
5296 ;; don't count it. 5286 ;; don't count it.
5297 (unless (bobp) 5287 (unless (bobp)
5298 (let ((prop 5288 (unless (invisible-p (1- (point)))
5299 (get-char-property (1- (point)) 'invisible))) 5289 (setq arg (1+ arg))))
5300 (unless (if (eq buffer-invisibility-spec t)
5301 prop
5302 (or (memq prop buffer-invisibility-spec)
5303 (assq prop buffer-invisibility-spec)))
5304 (setq arg (1+ arg)))))
5305 (setq first nil)) 5290 (setq first nil))
5306 ;; If invisible text follows, and it is a number of complete lines, 5291 ;; If invisible text follows, and it is a number of complete lines,
5307 ;; skip it. 5292 ;; skip it.
5308 (let ((opoint (point))) 5293 (let ((opoint (point)))
5309 (while (and (not (bobp)) 5294 (while (and (not (bobp))
5310 (let ((prop 5295 (invisible-p (1- (point))))
5311 (get-char-property (1- (point)) 'invisible)))
5312 (if (eq buffer-invisibility-spec t)
5313 prop
5314 (or (memq prop buffer-invisibility-spec)
5315 (assq prop buffer-invisibility-spec)))))
5316 (goto-char 5296 (goto-char
5317 (if (get-text-property (1- (point)) 'invisible) 5297 (if (get-text-property (1- (point)) 'invisible)
5318 (or (previous-single-property-change (point) 'invisible) 5298 (or (previous-single-property-change (point) 'invisible)
@@ -5332,12 +5312,7 @@ If ARG is zero, move to the beginning of the current line."
5332 (while (and (not (eobp)) 5312 (while (and (not (eobp))
5333 (save-excursion 5313 (save-excursion
5334 (skip-chars-forward "^\n") 5314 (skip-chars-forward "^\n")
5335 (let ((prop 5315 (invisible-p (point))))
5336 (get-char-property (point) 'invisible)))
5337 (if (eq buffer-invisibility-spec t)
5338 prop
5339 (or (memq prop buffer-invisibility-spec)
5340 (assq prop buffer-invisibility-spec))))))
5341 (skip-chars-forward "^\n") 5316 (skip-chars-forward "^\n")
5342 (if (get-text-property (point) 'invisible) 5317 (if (get-text-property (point) 'invisible)
5343 (goto-char (or (next-single-property-change (point) 'invisible) 5318 (goto-char (or (next-single-property-change (point) 'invisible)