Commit cdf3e5a2 authored by Richard M. Stallman's avatar Richard M. Stallman

Style of comments corrected.

(interval_of): New function.
parent b745025d
/* Interface code for dealing with text properties.
Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
This file is part of GNU Emacs.
......@@ -479,6 +479,48 @@ erase_properties (i)
}
#endif
/* Returns the interval of the POSITION in OBJECT.
POSITION is BEG-based. */
INTERVAL
interval_of (position, object)
int position;
Lisp_Object object;
{
register INTERVAL i;
int beg, end;
if (NILP (object))
XSETBUFFER (object, current_buffer);
CHECK_STRING_OR_BUFFER (object, 0);
if (BUFFERP (object))
{
register struct buffer *b = XBUFFER (object);
beg = BUF_BEGV (b);
end = BUF_ZV (b);
i = BUF_INTERVALS (b);
}
else
{
register struct Lisp_String *s = XSTRING (object);
/* We expect position to be 1-based. */
beg = BEG;
end = s->size + BEG;
i = s->intervals;
}
if (!(beg <= position && position <= end))
args_out_of_range (position, position);
if (beg == end || NULL_INTERVAL_P (i))
return NULL_INTERVAL;
return find_interval (i, position);
}
DEFUN ("text-properties-at", Ftext_properties_at,
Stext_properties_at, 1, 2, 0,
"Return the list of properties held by the character at POSITION\n\
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment