Function: window-point

window-point is a function defined in window.c.

Signature

(window-point &optional WINDOW)

Documentation

Return current value of point in WINDOW.

WINDOW must be a live window and defaults to the selected one.

For a nonselected window, this is the value point would have if that window were selected.

Note that, when WINDOW is selected, the value returned is the same as that returned by point for WINDOW's buffer. It would be more strictly correct to return the top-level value of point, outside of any save-excursion forms. But that is hard to define.

Probably introduced at or before Emacs version 17.

Source Code

// Defined in /usr/src/emacs/src/window.c
{
  register struct window *w = decode_live_window (window);

  if (w == XWINDOW (selected_window))
    return make_fixnum (BUF_PT (XBUFFER (w->contents)));
  else
    return Fmarker_position (w->pointm);
}