Function: outline-search-text-property

outline-search-text-property is a byte-compiled function defined in outline.el.gz.

Signature

(outline-search-text-property PROPERTY &optional VALUE BOUND MOVE BACKWARD LOOKING-AT)

Documentation

Search for the next text property PROPERTY with VALUE.

The rest of arguments are described in outline-search-function.

Source Code

;; Defined in /usr/src/emacs/lisp/outline.el.gz
(defun outline-search-text-property (property &optional value bound move backward looking-at)
  "Search for the next text property PROPERTY with VALUE.
The rest of arguments are described in `outline-search-function'."
  (if looking-at
      (when (if value (eq (get-text-property (point) property) value)
              (get-text-property (point) property))
        (set-match-data (list (pos-bol) (pos-eol)))
        t)
    ;; Go to the end when in the middle of heading
    (when (and (not backward)
               (if value (eq (get-text-property (point) property) value)
                 (get-text-property (point) property))
               (not (or (bobp)
                        (not (if value
                                 (eq (get-text-property (1- (point)) property) value)
                               (get-text-property (1- (point)) property))))))
      (goto-char (1+ (pos-eol))))
    (let ((prop-match (if backward
                          (text-property-search-backward property value (and value t))
                        (text-property-search-forward property value (and value t)))))
      (if prop-match
          (let ((beg (prop-match-beginning prop-match))
                (end (prop-match-end prop-match)))
            (if (or (null bound) (if backward (>= beg bound) (<= end bound)))
                (cond (backward
                       (goto-char beg)
                       (goto-char (pos-bol))
                       (set-match-data (list (point) end))
                       t)
                      (t
                       (goto-char end)
                       (goto-char (if (bolp) (1- (point)) (pos-eol)))
                       (set-match-data (list beg (point)))
                       t))
              (when move (goto-char bound))
              nil))
        (when move (goto-char (or bound (if backward (point-min) (point-max)))))
        nil))))