diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-10-11 03:11:21 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-10-11 03:11:21 +0000 |
commit | 2ecd36f536331d43a9a9f0b62d35f6d95b3a34f5 (patch) | |
tree | 259b375f1bbb2343099c2da8e2b188ac786b1737 /src/marker.c | |
parent | 4a573cc6134f2790e88d66194ad727a39cbe5059 (diff) | |
download | emacs-2ecd36f536331d43a9a9f0b62d35f6d95b3a34f5.tar.gz |
(Fbuffer_has_markers_at): New function.
(syms_of_marker): defsubr it.
Diffstat (limited to 'src/marker.c')
-rw-r--r-- | src/marker.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/marker.c b/src/marker.c index 856dc00ad10..a11068d69df 100644 --- a/src/marker.c +++ b/src/marker.c @@ -313,6 +313,32 @@ If TYPE is nil, it means the marker stays behind when you insert text at it.") XMARKER (marker)->insertion_type = ! NILP (type); return type; } + +DEFUN ("buffer-has-markers-at", Fbuffer_has_markers_at, Sbuffer_has_markers_at, + 1, 1, 0, + "Return t if there are markers pointing at POSITION in the currentbuffer.") + (position) + Lisp_Object position; +{ + register Lisp_Object tail; + register int charno; + + charno = XINT (position); + + if (charno < BEG) + charno = BEG; + if (charno > Z) + charno = Z; + if (charno > GPT) charno += GAP_SIZE; + + for (tail = BUF_MARKERS (current_buffer); + XSYMBOL (tail) != XSYMBOL (Qnil); + tail = XMARKER (tail)->chain) + if (XMARKER (tail)->bufpos == charno) + return Qt; + + return Qnil; +} syms_of_marker () { @@ -322,4 +348,5 @@ syms_of_marker () defsubr (&Scopy_marker); defsubr (&Smarker_insertion_type); defsubr (&Sset_marker_insertion_type); + defsubr (&Sbuffer_has_markers_at); } |