Function: ghostel--regex-prompt-end

ghostel--regex-prompt-end is a natively compiled function defined in ghostel.el.

Signature

(ghostel--regex-prompt-end POS)

Documentation

Return position past the prompt prefix on POS's line, or nil.

Matches ghostel-prompt-regexp anchored at BOL of POS's line. Returns nil when the regexp is nil or doesn't match.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel.el
;;; Prompt and cursor-state queries

(defun ghostel--regex-prompt-end (pos)
  "Return position past the prompt prefix on POS's line, or nil.
Matches `ghostel-prompt-regexp' anchored at BOL of POS's line.
Returns nil when the regexp is nil or doesn't match."
  (when ghostel-prompt-regexp
    (save-excursion
      (goto-char pos)
      (let ((bol (line-beginning-position))
            (eol (line-end-position)))
        (goto-char bol)
        (when (looking-at ghostel-prompt-regexp)
          (let ((end (match-end 0)))
            (and (<= end eol) end)))))))