Function: TeX-current-offset

TeX-current-offset is a byte-compiled function defined in tex.el.

Signature

(TeX-current-offset &optional POS)

Documentation

Calculate line offset of POS, or of point if POS is nil.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex.el
;; Used for marking the last region.

(defun TeX-current-offset (&optional pos)
  "Calculate line offset of POS, or of point if POS is nil."
  (save-restriction
    (widen)
    (save-excursion
      (let ((inhibit-field-text-motion t))
        (if pos (goto-char pos))
        (+ (count-lines (point-min) (point))
           (if (bolp) 0 -1))))))