Mercurial > emacs
comparison src/marker.c @ 16418:cf4260218aec
(Fbuffer_has_markers_at): New function.
(syms_of_marker): defsubr it.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 11 Oct 1996 03:11:21 +0000 |
parents | ee40177f6c68 |
children | 6e2ea54ad704 |
comparison
equal
deleted
inserted
replaced
16417:fb6785d0c256 | 16418:cf4260218aec |
---|---|
311 CHECK_MARKER (marker, 0); | 311 CHECK_MARKER (marker, 0); |
312 | 312 |
313 XMARKER (marker)->insertion_type = ! NILP (type); | 313 XMARKER (marker)->insertion_type = ! NILP (type); |
314 return type; | 314 return type; |
315 } | 315 } |
316 | |
317 DEFUN ("buffer-has-markers-at", Fbuffer_has_markers_at, Sbuffer_has_markers_at, | |
318 1, 1, 0, | |
319 "Return t if there are markers pointing at POSITION in the currentbuffer.") | |
320 (position) | |
321 Lisp_Object position; | |
322 { | |
323 register Lisp_Object tail; | |
324 register int charno; | |
325 | |
326 charno = XINT (position); | |
327 | |
328 if (charno < BEG) | |
329 charno = BEG; | |
330 if (charno > Z) | |
331 charno = Z; | |
332 if (charno > GPT) charno += GAP_SIZE; | |
333 | |
334 for (tail = BUF_MARKERS (current_buffer); | |
335 XSYMBOL (tail) != XSYMBOL (Qnil); | |
336 tail = XMARKER (tail)->chain) | |
337 if (XMARKER (tail)->bufpos == charno) | |
338 return Qt; | |
339 | |
340 return Qnil; | |
341 } | |
316 | 342 |
317 syms_of_marker () | 343 syms_of_marker () |
318 { | 344 { |
319 defsubr (&Smarker_position); | 345 defsubr (&Smarker_position); |
320 defsubr (&Smarker_buffer); | 346 defsubr (&Smarker_buffer); |
321 defsubr (&Sset_marker); | 347 defsubr (&Sset_marker); |
322 defsubr (&Scopy_marker); | 348 defsubr (&Scopy_marker); |
323 defsubr (&Smarker_insertion_type); | 349 defsubr (&Smarker_insertion_type); |
324 defsubr (&Sset_marker_insertion_type); | 350 defsubr (&Sset_marker_insertion_type); |
325 } | 351 defsubr (&Sbuffer_has_markers_at); |
352 } |