Function: current-column

current-column is a function defined in indent.c.

Signature

(current-column)

Documentation

Return the horizontal position of point. Beginning of line is column 0.

This is calculated by adding together the widths of all the displayed representations of the character between the start of the previous line and point (e.g., control characters will have a width of 2 or 4, tabs will have a variable width). Ignores finite width of frame, which means that this function may return values greater than (frame-width). In a buffer with very long lines, the value will be an approximation, because calculating the exact number is very expensive. Whether the line is visible (if selective-display is t) has no effect; however, ^M is treated as end of line when selective-display is t. Text that has an invisible property is considered as having width 0, unless buffer-invisibility-spec specifies that it is replaced by an ellipsis.

View in manual

Probably introduced at or before Emacs version 29.1.

Source Code

// Defined in /usr/src/emacs/src/indent.c
{
  Lisp_Object temp;

  XSETFASTINT (temp, current_column ());
  return temp;
}