Function: copy-marker

copy-marker is a function defined in marker.c.

Signature

(copy-marker &optional MARKER TYPE)

Documentation

Return a new marker pointing at the same place as MARKER.

If argument is a number, makes a new marker pointing at that position in the current buffer. If MARKER is not specified, the new marker does not point anywhere. The optional argument TYPE specifies the insertion type of the new marker; see marker-insertion-type.

View in manual

Probably introduced at or before Emacs version 19.30.

Source Code

// Defined in /usr/src/emacs/src/marker.c
{
  register Lisp_Object new;

  if (!NILP (marker))
  CHECK_TYPE (FIXNUMP (marker) || MARKERP (marker), Qinteger_or_marker_p, marker);

  new = Fmake_marker ();
  Fset_marker (new, marker,
	       (MARKERP (marker) ? Fmarker_buffer (marker) : Qnil));
  XMARKER (new)->insertion_type = !NILP (type);
  return new;
}