+(defun beginning-of-line-pos()
+ ;; Return the point position corresponding to the beginning
+ ;; of the current line.
+ (save-excursion
+ (beginning-of-line)
+ (point)
+ )
+)
+
+(defun end-of-line-pos()
+ ;; Return the point position corresponding to the end
+ ;; of the current line.
+ (save-excursion
+ (end-of-line)
+ (point)
+ )
+)
+
+(defun pos-offset()
+ ;; How far are we from the beginning of the line?
+ (- (point) (beginning-of-line-pos))
+)
+
+(defun first-char-offset()
+ ;; How far is the first character on this line
+ ;; from the beginning of the line?
+ (save-excursion
+ (+ (pos-offset) (skip-chars-forward " \t"))
+ )
+)
+
+(defun first-char-pos()
+ ;; What's the position of the first character on this line?
+ (+ (beginning-of-line-pos) (first-char-offset))
+)