[gnu.emacs.bug] set-window-point bug

kjones@UUNET.UU.NET (Kyle Jones) (06/09/89)

GNU Emacs 18.52.0 of Thu Apr  6 1989 on pm700 (berkeley-unix)

In src/window.c

DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0,
  "Make point value in WINDOW be at position POS in WINDOW's buffer.")
  (window, pos)
     Lisp_Object window, pos;
{
  register struct window *w = decode_window (window);

  CHECK_NUMBER_COERCE_MARKER (pos, 1);
  if (w == XWINDOW (selected_window))
    Fgoto_char (pos);
  else
    Fset_marker (w->pointm, pos, w->buffer);
  return pos;
}

The function's use of Fgoto_char(pos) changes the value of point in the
wrong buffer if the current buffer is not the same buffer as that of the
selected window, i.e.
	(not (eq (window-buffer (selected-window)) (current-buffer)))