X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/9be191c94f5f8756680949d010f0735113ff0dae..9a5114ac7e384d28a13c99725380b6024abde5cf:/src/marker.c diff --git a/src/marker.c b/src/marker.c index fb97c064cf..a11068d69d 100644 --- a/src/marker.c +++ b/src/marker.c @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #include @@ -312,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 () { @@ -321,4 +348,5 @@ syms_of_marker () defsubr (&Scopy_marker); defsubr (&Smarker_insertion_type); defsubr (&Sset_marker_insertion_type); + defsubr (&Sbuffer_has_markers_at); }