The following simple example creates a new editor command calledWhat Line.
(in-package 'editor)
(defcommand "What Line" (p)
"Computes the line number of the current point and
prints it in the Echo Area"
"Prints the line number of the current point"
(let* ((cpoint (current-point))
(svpoint (copy-point cpoint))
(count 0))
(beginning-of-buffer-command nil)
(loop
(if (point > cpoint svpoint)
(return))
(unless (next-line-command)
(return))
(incf count))
(move-point cpoint svpoint)
(message "Line Number: ~S " count)))