From 1d7e63566756032d3337687f7c8c4e8e35316dfa Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 22 Aug 2007 15:31:31 +0000 Subject: [PATCH] (text-invisible-p): Rename from line-move-invisible-p. (line-move-invisible-p): Keep as an obsolete alias, just to be safe. (line-move-1, line-move-finish, line-move-to-column) (move-end-of-line, move-beginning-of-line): Use new name. --- etc/NEWS | 2 ++ lisp/ChangeLog | 7 +++++++ lisp/simple.el | 25 +++++++++++++------------ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 32b555f14c9..dd7ccbb4c9f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -79,6 +79,8 @@ in to make it use the scrollbars from the system theme. * Lisp Changes in Emacs 22.2. +** The function text-invisible-p returns non-nil iff pos is invisible. + +++ ** inhibit-modification-hooks is bound to t while running modification hooks. As a happy consequence, after-change-functions and before-change-functions diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 823782e4358..bd7c4704c77 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-08-22 Stefan Monnier + + * simple.el (text-invisible-p): Rename from line-move-invisible-p. + (line-move-invisible-p): Keep as an obsolete alias, just to be safe. + (line-move-1, line-move-finish, line-move-to-column) + (move-end-of-line, move-beginning-of-line): Use new name. + 2007-08-22 Glenn Morris * files.el (backup-buffer-copy): Check backup directory is diff --git a/lisp/simple.el b/lisp/simple.el index 1ffa9a9ab23..43d210aa151 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3477,7 +3477,7 @@ Outline mode sets this." :type 'boolean :group 'editing-basics) -(defun line-move-invisible-p (pos) +(defun text-invisible-p (pos) "Return non-nil if the character after POS is currently invisible." (let ((prop (get-char-property pos 'invisible))) @@ -3485,6 +3485,7 @@ Outline mode sets this." prop (or (memq prop buffer-invisibility-spec) (assq prop buffer-invisibility-spec))))) +(define-obsolete-function-alias 'line-move-invisible-p 'text-invisible-p) ;; Returns non-nil if partial move was done. (defun line-move-partial (arg noerror to-end) @@ -3605,7 +3606,7 @@ Outline mode sets this." (while (and (> arg 0) (not done)) ;; If the following character is currently invisible, ;; skip all characters with that same `invisible' property value. - (while (and (not (eobp)) (line-move-invisible-p (point))) + (while (and (not (eobp)) (text-invisible-p (point))) (goto-char (next-char-property-change (point)))) ;; Move a line. ;; We don't use `end-of-line', since we want to escape @@ -3623,7 +3624,7 @@ Outline mode sets this." (setq done t))) ((and (> arg 1) ;; Use vertical-motion for last move (not (integerp selective-display)) - (not (line-move-invisible-p (point)))) + (not (text-invisible-p (point)))) ;; We avoid vertical-motion when possible ;; because that has to fontify. (forward-line 1)) @@ -3652,7 +3653,7 @@ Outline mode sets this." (setq done t))) ((and (< arg -1) ;; Use vertical-motion for last move (not (integerp selective-display)) - (not (line-move-invisible-p (1- (point))))) + (not (text-invisible-p (1- (point))))) (forward-line -1)) ((zerop (vertical-motion -1)) (if (not noerror) @@ -3664,7 +3665,7 @@ Outline mode sets this." ;; if our target is the middle of this line. (or (zerop (or goal-column temporary-goal-column)) (< arg 0)) - (not (bobp)) (line-move-invisible-p (1- (point)))) + (not (bobp)) (text-invisible-p (1- (point)))) (goto-char (previous-char-property-change (point)))))))) ;; This is the value the function returns. (= arg 0)) @@ -3696,7 +3697,7 @@ Outline mode sets this." (save-excursion ;; Like end-of-line but ignores fields. (skip-chars-forward "^\n") - (while (and (not (eobp)) (line-move-invisible-p (point))) + (while (and (not (eobp)) (text-invisible-p (point))) (goto-char (next-char-property-change (point))) (skip-chars-forward "^\n")) (point)))) @@ -3779,13 +3780,13 @@ and `current-column' to be able to ignore invisible text." (move-to-column col)) (when (and line-move-ignore-invisible - (not (bolp)) (line-move-invisible-p (1- (point)))) + (not (bolp)) (text-invisible-p (1- (point)))) (let ((normal-location (point)) (normal-column (current-column))) ;; If the following character is currently invisible, ;; skip all characters with that same `invisible' property value. (while (and (not (eobp)) - (line-move-invisible-p (point))) + (text-invisible-p (point))) (goto-char (next-char-property-change (point)))) ;; Have we advanced to a larger column position? (if (> (current-column) normal-column) @@ -3798,7 +3799,7 @@ and `current-column' to be able to ignore invisible text." ;; but with a more reasonable buffer position. (goto-char normal-location) (let ((line-beg (save-excursion (beginning-of-line) (point)))) - (while (and (not (bolp)) (line-move-invisible-p (1- (point)))) + (while (and (not (bolp)) (text-invisible-p (1- (point)))) (goto-char (previous-char-property-change (point) line-beg)))))))) (defun move-end-of-line (arg) @@ -3819,7 +3820,7 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." (and (line-move arg t) (not (bobp)) (progn - (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) + (while (and (not (bobp)) (text-invisible-p (1- (point)))) (goto-char (previous-char-property-change (point)))) (backward-char 1))) (point))))) @@ -3855,13 +3856,13 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." ;; Move to beginning-of-line, ignoring fields and invisibles. (skip-chars-backward "^\n") - (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) + (while (and (not (bobp)) (text-invisible-p (1- (point)))) (goto-char (previous-char-property-change (point))) (skip-chars-backward "^\n")) (setq start (point)) ;; Now find first visible char in the line - (while (and (not (eobp)) (line-move-invisible-p (point))) + (while (and (not (eobp)) (text-invisible-p (point))) (goto-char (next-char-property-change (point)))) (setq first-vis (point)) -- 2.39.5