diff 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
line wrap: on
line diff
--- a/src/marker.c	Fri Oct 11 03:11:00 1996 +0000
+++ b/src/marker.c	Fri Oct 11 03:11:21 1996 +0000
@@ -313,6 +313,32 @@
   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 @@
   defsubr (&Scopy_marker);
   defsubr (&Smarker_insertion_type);
   defsubr (&Sset_marker_insertion_type);
+  defsubr (&Sbuffer_has_markers_at);
 }