Move some invisibility check functions to "org-macs.el"

* lisp/org.el (org-invisible-p):
(org-truely-invisible-p):
(org-invisible-p2): Move...

* lisp/org-macs.el: ... there.
This commit is contained in:
Nicolas Goaziou 2017-10-22 16:20:58 +02:00
parent fc551191a7
commit 87116700e6
2 changed files with 21 additions and 22 deletions

View File

@ -659,6 +659,27 @@ the value in cdr."
(get-text-property (or (next-single-property-change 0 prop s) 0)
prop s)))
(defun org-invisible-p (&optional pos)
"Non-nil if the character after POS is invisible.
If POS is nil, use `point' instead."
(get-char-property (or pos (point)) 'invisible))
(defun org-truely-invisible-p ()
"Check if point is at a character currently not visible.
This version does not only check the character property, but also
`visible-mode'."
(unless (bound-and-true-p visible-mode)
(org-invisible-p)))
(defun org-invisible-p2 ()
"Check if point is at a character currently not visible.
If the point is at EOL (and not at the beginning of a buffer too),
move it back by one char before doing this check."
(save-excursion
(when (and (eolp) (not (bobp)))
(backward-char 1))
(org-invisible-p)))
;;; Local variables

View File

@ -6837,11 +6837,6 @@ Use `\\[org-edit-special]' to edit table.el tables"))
(defvar org-called-with-limited-levels nil
"Non-nil when `org-with-limited-levels' is currently active.")
(defun org-invisible-p (&optional pos)
"Non-nil if the character after POS is invisible.
If POS is nil, use `point' instead."
(get-char-property (or pos (point)) 'invisible))
(defun org-cycle-internal-local ()
"Do the local cycling action."
(let ((goal-column 0) eoh eol eos has-children children-skipped struct)
@ -23504,23 +23499,6 @@ interactive command with similar behavior."
(define-key org-mode-map "\C-y" 'org-yank)
(defun org-truely-invisible-p ()
"Check if point is at a character currently not visible.
This version does not only check the character property, but also
`visible-mode'."
(unless (bound-and-true-p visible-mode)
(org-invisible-p)))
(defun org-invisible-p2 ()
"Check if point is at a character currently not visible.
If the point is at EOL (and not at the beginning of a buffer too),
move it back by one char before doing this check."
(save-excursion
(when (and (eolp) (not (bobp)))
(backward-char 1))
(org-invisible-p)))
(defun org-back-to-heading (&optional invisible-ok)
"Call `outline-back-to-heading', but provide a better error message."
(condition-case nil