From 87116700e6e7c99b1c9db4165b1311b48e87c2c5 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 22 Oct 2017 16:20:58 +0200 Subject: [PATCH] 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. --- lisp/org-macs.el | 21 +++++++++++++++++++++ lisp/org.el | 22 ---------------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 868e9dd94..1dae1e6e6 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -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 diff --git a/lisp/org.el b/lisp/org.el index eac39313f..c7bff8aac 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -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 -- 2.11.4.GIT