Move `org-flag-region' to "org-macs.el"

* lisp/org.el (org-flag-region): Move function...
* lisp/org-macs.el (org-flag-region): ... here.
This commit is contained in:
Nicolas Goaziou 2018-02-11 11:27:53 +01:00
parent 8d7b6e5489
commit 2956408f75
3 changed files with 12 additions and 13 deletions

View File

@ -125,7 +125,6 @@
(declare-function org-export-get-next-element "ox" (blob info &optional n)) (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-export-with-backend "ox" (backend data &optional contents info))
(declare-function org-fix-tags-on-the-fly "org" ()) (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-indentation "org" (&optional line))
(declare-function org-get-todo-state "org" ()) (declare-function org-get-todo-state "org" ())
(declare-function org-in-block-p "org" (names)) (declare-function org-in-block-p "org" (names))

View File

@ -758,6 +758,18 @@ Optional argument REGEXP selects variables to clone."
;;; Visibility ;;; 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) (defun org-outline-overlay-data (&optional use-markers)
"Return a list of the locations of all outline overlays. "Return a list of the locations of all outline overlays.
These are overlays with the `invisible' property value `outline'. These are overlays with the `invisible' property value `outline'.

View File

@ -6608,18 +6608,6 @@ open and agenda-wise Org files."
;;; Visibility (headlines, blocks, drawers) ;;; 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 ;;;; Headlines visibility
(defun org-show-entry () (defun org-show-entry ()