Browse Source

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

* lisp/org.el (org-flag-region): Move function...
* lisp/org-macs.el (org-flag-region): ... here.
Nicolas Goaziou 1 year ago
parent
commit
2956408f75
3 changed files with 12 additions and 13 deletions
  1. 0 1
      lisp/org-list.el
  2. 12 0
      lisp/org-macs.el
  3. 0 12
      lisp/org.el

+ 0 - 1
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))

+ 12 - 0
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'.

+ 0 - 12
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 ()