|
@@ -728,7 +728,7 @@ When NEXT is non-nil, check the next line instead."
|
|
|
|
|
|
|
|
|
|
|
|
-;;; Overlays
|
|
|
+;;; Overlays and text properties
|
|
|
|
|
|
(defun org-overlay-display (ovl text &optional face evap)
|
|
|
"Make overlay OVL display TEXT with face FACE."
|
|
@@ -751,20 +751,22 @@ If DELETE is non-nil, delete all those overlays."
|
|
|
(delete (delete-overlay ov))
|
|
|
(t (push ov found))))))
|
|
|
|
|
|
-(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
|
|
|
- (lambda (&rest _) (org-show-context 'isearch))))))
|
|
|
-
|
|
|
+(defun org-find-text-property-region (pos prop)
|
|
|
+ "Find a region around POS containing same non-nil value of PROP text property.
|
|
|
+Return nil when PROP is not set at POS."
|
|
|
+ (let* ((beg (and (get-text-property pos prop) pos))
|
|
|
+ (end beg))
|
|
|
+ (when beg
|
|
|
+ (unless (or (equal beg (point-min))
|
|
|
+ (not (eq (get-text-property beg prop)
|
|
|
+ (get-text-property (1- beg) prop))))
|
|
|
+ (setq beg (previous-single-property-change pos prop nil (point-min))))
|
|
|
+ (unless (or (equal end (point-max))
|
|
|
+ ;; (not (eq (get-text-property end prop)
|
|
|
+ ;; (get-text-property (1+ end) prop)))
|
|
|
+ )
|
|
|
+ (setq end (next-single-property-change pos prop nil (point-max))))
|
|
|
+ (cons beg end))))
|
|
|
|
|
|
|
|
|
;;; Regexp matching
|