Function: markdown-line-number-at-pos

markdown-line-number-at-pos is a natively compiled function defined in markdown-mode.el.

Signature

(markdown-line-number-at-pos &optional POS)

Documentation

Return (narrowed) buffer line number at position POS.

If POS is nil, use current buffer location. This is an exact copy of line-number-at-pos for use in emacs21.

Source Code

;; Defined in /nix/store/p33zgg95aglc47pl6zlgs43vki0snxf8-emacs-packages-deps/share/emacs/site-lisp/elpa/markdown-mode-20260827.909/markdown-mode.el
(defun markdown-line-number-at-pos (&optional pos)
  "Return (narrowed) buffer line number at position POS.
If POS is nil, use current buffer location.
This is an exact copy of `line-number-at-pos' for use in emacs21."
  (let ((opoint (or pos (point))) start)
    (save-excursion
      (goto-char (point-min))
      (setq start (point))
      (goto-char opoint)
      (forward-line 0)
      (1+ (count-lines start (point))))))