Function: text-properties-at

text-properties-at is a function defined in textprop.c.

Signature

(text-properties-at POSITION &optional OBJECT)

Documentation

Return the list of properties of the character at POSITION in OBJECT.

If the optional second argument OBJECT is a buffer (or nil, which means the current buffer), POSITION is a buffer position (integer or marker). If OBJECT is a string, POSITION is a 0-based index into it. If POSITION is at the end of OBJECT, the value is nil.

If you want to display the text properties at point in a human-readable form, use the describe-text-properties command.

Other relevant functions are documented in the text-properties group.

Shortdoc

;; text-properties
(text-properties-at (point))
    => nil

Aliases

kproperty:properties

Source Code

// Defined in /usr/src/emacs/src/textprop.c
{
  register INTERVAL i;

  if (NILP (object))
    XSETBUFFER (object, current_buffer);

  i = validate_interval_range (object, &position, &position, soft);
  if (!i)
    return Qnil;
  /* If POSITION is at the end of the interval,
     it means it's the end of OBJECT.
     There are no properties at the very end,
     since no character follows.  */
  if (XFIXNUM (position) == LENGTH (i) + i->position)
    return Qnil;

  return i->plist;
}