Function: ghostel--wrap-fragments

ghostel--wrap-fragments is a natively compiled function defined in ghostel-links.el.

Signature

(ghostel--wrap-fragments BEG END)

Documentation

Return the buffer ranges covering BEG..END, split at soft-wrap newlines.

Each element is a (START . STOP) cons; the wrap newlines themselves are left out so link properties never cover a row break.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel-links.el
(defun ghostel--wrap-fragments (beg end)
  "Return the buffer ranges covering BEG..END, split at soft-wrap newlines.
Each element is a (START . STOP) cons; the wrap newlines themselves
are left out so link properties never cover a row break."
  (let ((fragments nil)
        (pos beg))
    (while (< pos end)
      (let ((wrap (text-property-not-all pos end 'ghostel-wrap nil)))
        (if (and wrap (eq (char-after wrap) ?\n))
            (progn
              (when (< pos wrap) (push (cons pos wrap) fragments))
              (setq pos (1+ wrap)))
          (push (cons pos end) fragments)
          (setq pos end))))
    (nreverse fragments)))