diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-02-11 11:27:53 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-02-11 11:27:53 +0100 |
commit | 2956408f7559a21c2ddfc747dc3580747bcbb02f (patch) | |
tree | 70deb518666fae99174732225e910521e6652b5d | |
parent | 8d7b6e548989bd11aea558bad4f85c0d90da0cd9 (diff) | |
download | org-mode-2956408f7559a21c2ddfc747dc3580747bcbb02f.tar.gz |
Move `org-flag-region' to "org-macs.el"
* lisp/org.el (org-flag-region): Move function...
* lisp/org-macs.el (org-flag-region): ... here.
-rw-r--r-- | lisp/org-list.el | 1 | ||||
-rw-r--r-- | lisp/org-macs.el | 12 | ||||
-rw-r--r-- | lisp/org.el | 12 |
3 files changed, 12 insertions, 13 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el index 0a5afa0..c004a72 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -125,7 +125,6 @@ (declare-function org-export-get-next-element "ox" (blob info &optional n)) (declare-function org-export-with-backend "ox" (backend data &optional contents info)) (declare-function org-fix-tags-on-the-fly "org" ()) -(declare-function org-flag-region "org" (from to flag spec)) (declare-function org-get-indentation "org" (&optional line)) (declare-function org-get-todo-state "org" ()) (declare-function org-in-block-p "org" (names)) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index caa5b8b..a032dfe 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -758,6 +758,18 @@ Optional argument REGEXP selects variables to clone." ;;; Visibility +(defun org-flag-region (from to flag spec) + "Hide or show lines from FROM to TO, according to FLAG. +SPEC is the invisibility spec, as a symbol." + (remove-overlays from to 'invisible spec) + ;; Use `front-advance' since text right before to the beginning of + ;; the overlay belongs to the visible line than to the contents. + (when flag + (let ((o (make-overlay from to nil 'front-advance))) + (overlay-put o 'evaporate t) + (overlay-put o 'invisible spec) + (overlay-put o 'isearch-open-invisible #'delete-overlay)))) + (defun org-outline-overlay-data (&optional use-markers) "Return a list of the locations of all outline overlays. These are overlays with the `invisible' property value `outline'. diff --git a/lisp/org.el b/lisp/org.el index e47a7e0..672f85c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6608,18 +6608,6 @@ open and agenda-wise Org files." ;;; Visibility (headlines, blocks, drawers) -(defun org-flag-region (from to flag spec) - "Hide or show lines from FROM to TO, according to FLAG. -SPEC is the invisibility spec, as a symbol." - (remove-overlays from to 'invisible spec) - ;; Use `front-advance' since text right before to the beginning of - ;; the overlay belongs to the visible line than to the contents. - (when flag - (let ((o (make-overlay from to nil 'front-advance))) - (overlay-put o 'evaporate t) - (overlay-put o 'invisible spec) - (overlay-put o 'isearch-open-invisible #'delete-overlay)))) - ;;;; Headlines visibility (defun org-show-entry () |