(defun pos-at-beginning-of-line (N) "Return the position at beginning of line N." (save-excursion (goto-char (point-min))(line-beginning-position N))) (defun pos-at-end-of-line (N) "Return the position at end of line N." (save-excursion (goto-char (point-min))(line-end-position N)))