Function: regi-pos
regi-pos is a byte-compiled function defined in regi.el.gz.
Signature
(regi-pos &optional POSITION COL-P)
Documentation
Return the character position at various buffer positions.
Optional POSITION can be one of the following symbols:
bol == beginning of line
boi == beginning of indentation
eol == end of line [default]
bonl == beginning of next line
bopl == beginning of previous line
Optional COL-P non-nil returns current-column instead of character position.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/regi.el.gz
(defun regi-pos (&optional position col-p)
"Return the character position at various buffer positions.
Optional POSITION can be one of the following symbols:
`bol' == beginning of line
`boi' == beginning of indentation
`eol' == end of line [default]
`bonl' == beginning of next line
`bopl' == beginning of previous line
Optional COL-P non-nil returns `current-column' instead of character position."
(save-excursion
(cond
((eq position 'bol) (beginning-of-line))
((eq position 'boi) (back-to-indentation))
((eq position 'bonl) (forward-line 1))
((eq position 'bopl) (forward-line -1))
(t (end-of-line)))
(if col-p (current-column) (point))))