In Emacs Lisp, if you have a buffer position stored in a variable, how do you find which column it is in?
Check out the documentation for columns and save-excursion .
save-excursion
(save-excursion (goto-char pos) (current-column))
Trey already nailed it (although I personally have not tried it), but here is what I wrote for this.
(defun calculate-column (point) (save-excursion (goto-char point) (beginning-of-line) (- point (point))))