summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-10-22 16:20:58 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-10-22 16:20:58 +0200
commit87116700e6e7c99b1c9db4165b1311b48e87c2c5 (patch)
tree6663ce2ef99a88f0edad4737912b30d7bbda3e26
parentfc551191a7dc3ab05dac7eae45cf8ec20ffd7b69 (diff)
downloadorg-mode-87116700e6e7c99b1c9db4165b1311b48e87c2c5.tar.gz
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.
-rw-r--r--lisp/org-macs.el21
-rw-r--r--lisp/org.el22
2 files changed, 21 insertions, 22 deletions
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 868e9dd..1dae1e6 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 eac3931..c7bff8a 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