Function: outline-xref--fetch-headings

outline-xref--fetch-headings is a byte-compiled function defined in outline.el.gz.

Signature

(outline-xref--fetch-headings SEARCH-FUNCTION BUFFER)

Documentation

Return a list of Xref values matching SEARCH-FUNCTION in BUFFER.

Source Code

;; Defined in /usr/src/emacs/lisp/outline.el.gz
;;; Xref outline navigation

(defun outline-xref--fetch-headings (search-function buffer)
  "Return a list of Xref values matching SEARCH-FUNCTION in BUFFER."
  (let (headings)
    (with-current-buffer buffer
      (save-excursion
        (goto-char (point-min))
        (while (funcall search-function nil t)
          (let* ((line-beg (line-beginning-position))
                 (line-end (line-end-position))
                 (summary (progn
                            (font-lock-ensure line-beg line-end)
                            (buffer-substring line-beg line-end)))
                 (location (xref-make-buffer-location buffer line-beg))
                 (length (length summary)))
            (push (xref-make-match summary location length) headings))
          (forward-line 1))))
    (nreverse headings)))