From 2956408f7559a21c2ddfc747dc3580747bcbb02f Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 11 Feb 2018 11:27:53 +0100 Subject: [PATCH] Move `org-flag-region' to "org-macs.el" * lisp/org.el (org-flag-region): Move function... * lisp/org-macs.el (org-flag-region): ... here. --- lisp/org-list.el | 1 - lisp/org-macs.el | 12 ++++++++++++ lisp/org.el | 12 ------------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lisp/org-list.el b/lisp/org-list.el index 0a5afa0b3..c004a72ac 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 caa5b8bc2..a032dfef0 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 e47a7e0ac..672f85cd1 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 ()