Mercurial > emacs
comparison src/marker.c @ 110033:2c9ea5d32862
* src/marker.c (Fcopy_marker): Make the first arg optional.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 30 Aug 2010 14:47:49 +0200 |
parents | 8cfee7d2955f |
children | 5746a646bb03 |
comparison
equal
deleted
inserted
replaced
110032:fcae870dab3a | 110033:2c9ea5d32862 |
---|---|
804 abort (); | 804 abort (); |
805 | 805 |
806 return i; | 806 return i; |
807 } | 807 } |
808 | 808 |
809 DEFUN ("copy-marker", Fcopy_marker, Scopy_marker, 1, 2, 0, | 809 DEFUN ("copy-marker", Fcopy_marker, Scopy_marker, 0, 2, 0, |
810 doc: /* Return a new marker pointing at the same place as MARKER. | 810 doc: /* Return a new marker pointing at the same place as MARKER. |
811 If argument is a number, makes a new marker pointing | 811 If argument is a number, makes a new marker pointing |
812 at that position in the current buffer. | 812 at that position in the current buffer. |
813 If MARKER is not specified, the new marker does not point anywhere. | |
813 The optional argument TYPE specifies the insertion type of the new marker; | 814 The optional argument TYPE specifies the insertion type of the new marker; |
814 see `marker-insertion-type'. */) | 815 see `marker-insertion-type'. */) |
815 (register Lisp_Object marker, Lisp_Object type) | 816 (register Lisp_Object marker, Lisp_Object type) |
816 { | 817 { |
817 register Lisp_Object new; | 818 register Lisp_Object new; |
818 | 819 |
820 if (!NILP (marker)) | |
819 CHECK_TYPE (INTEGERP (marker) || MARKERP (marker), Qinteger_or_marker_p, marker); | 821 CHECK_TYPE (INTEGERP (marker) || MARKERP (marker), Qinteger_or_marker_p, marker); |
820 | 822 |
821 new = Fmake_marker (); | 823 new = Fmake_marker (); |
822 Fset_marker (new, marker, | 824 Fset_marker (new, marker, |
823 (MARKERP (marker) ? Fmarker_buffer (marker) : Qnil)); | 825 (MARKERP (marker) ? Fmarker_buffer (marker) : Qnil)); |