Function: ghostel--logical-line-at-point

ghostel--logical-line-at-point is a natively compiled function defined in ghostel-links.el.

Signature

(ghostel--logical-line-at-point)

Documentation

Return (STRING . CHUNKS) for point's logical line, or nil if unwrapped.

STRING is the line's text with soft-wrap newlines removed and CHUNKS maps its offsets back to buffer positions, as returned by ghostel--wrap-joined-region. Nil when no soft wrap is involved, so callers can fall back to ordinary single-line behavior.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel-links.el
(defun ghostel--logical-line-at-point ()
  "Return (STRING . CHUNKS) for point's logical line, or nil if unwrapped.
STRING is the line's text with soft-wrap newlines removed and CHUNKS
maps its offsets back to buffer positions, as returned by
`ghostel--wrap-joined-region'.  Nil when no soft wrap is involved, so
callers can fall back to ordinary single-line behavior."
  (let ((bol (line-beginning-position))
        (eol (line-end-position)))
    (when (or (get-text-property eol 'ghostel-wrap)
              (and (> bol (point-min))
                   (get-text-property (1- bol) 'ghostel-wrap)))
      (let ((begin (ghostel--soft-wrap-line-beginning
                    (point) ghostel--soft-wrap-row-limit))
            (end (ghostel--soft-wrap-line-end
                  (point) ghostel--soft-wrap-row-limit)))
        (ghostel--wrap-joined-region begin end ghostel--soft-wrap-row-limit)))))