/* Interface code for dealing with text properties.
- Copyright (C) 1993-1995, 1997, 1999-2011 Free Software Foundation, Inc.
+ Copyright (C) 1993-1995, 1997, 1999-2012 Free Software Foundation, Inc.
This file is part of GNU Emacs.
}
if (BUFFERP (object))
{
- int noverlays;
+ ptrdiff_t noverlays;
Lisp_Object *overlay_vec;
struct buffer *obuf = current_buffer;
\f
DEFUN ("text-property-any", Ftext_property_any,
Stext_property_any, 4, 5, 0,
- doc: /* Check text from START to END for property PROPERTY equalling VALUE.
+ doc: /* Check text from START to END for property PROPERTY equaling VALUE.
If so, return the position of the first character whose property PROPERTY
is `eq' to VALUE. Otherwise return nil.
If the optional fifth argument OBJECT is a buffer (or nil, which means
DEFUN ("text-property-not-all", Ftext_property_not_all,
Stext_property_not_all, 4, 5, 0,
- doc: /* Check text from START to END for property PROPERTY not equalling VALUE.
+ doc: /* Check text from START to END for property PROPERTY not equaling VALUE.
If so, return the position of the first character whose property PROPERTY
is not `eq' to VALUE. Otherwise, return nil.
If the optional fifth argument OBJECT is a buffer (or nil, which means
{
Lisp_Object prev_pos, front_sticky;
int is_rear_sticky = 1, is_front_sticky = 0; /* defaults */
+ Lisp_Object defalt = Fassq (prop, Vtext_property_default_nonsticky);
if (NILP (buffer))
XSETBUFFER (buffer, current_buffer);
+ if (CONSP (defalt) && !NILP (XCDR (defalt)))
+ is_rear_sticky = 0;
+
if (XINT (pos) > BUF_BEGV (XBUFFER (buffer)))
/* Consider previous character. */
{
DEFVAR_LISP ("text-property-default-nonsticky",
Vtext_property_default_nonsticky,
- doc: /* Alist of properties vs the corresponding non-stickinesses.
+ doc: /* Alist of properties vs the corresponding non-stickiness.
Each element has the form (PROPERTY . NONSTICKINESS).
If a character in a buffer has PROPERTY, new text inserted adjacent to
the character doesn't inherit PROPERTY if NONSTICKINESS is non-nil,
inherits it if NONSTICKINESS is nil. The `front-sticky' and
`rear-nonsticky' properties of the character override NONSTICKINESS. */);
- /* Text property `syntax-table' should be nonsticky by default. */
+ /* Text properties `syntax-table'and `display' should be nonsticky
+ by default. */
Vtext_property_default_nonsticky
- = Fcons (Fcons (intern_c_string ("syntax-table"), Qt), Qnil);
+ = Fcons (Fcons (intern_c_string ("syntax-table"), Qt),
+ Fcons (Fcons (intern_c_string ("display"), Qt), Qnil));
staticpro (&interval_insert_behind_hooks);
staticpro (&interval_insert_in_front_hooks);
/* Common attributes one might give text */
- staticpro (&Qforeground);
- Qforeground = intern_c_string ("foreground");
- staticpro (&Qbackground);
- Qbackground = intern_c_string ("background");
- staticpro (&Qfont);
- Qfont = intern_c_string ("font");
- staticpro (&Qstipple);
- Qstipple = intern_c_string ("stipple");
- staticpro (&Qunderline);
- Qunderline = intern_c_string ("underline");
- staticpro (&Qread_only);
- Qread_only = intern_c_string ("read-only");
- staticpro (&Qinvisible);
- Qinvisible = intern_c_string ("invisible");
- staticpro (&Qintangible);
- Qintangible = intern_c_string ("intangible");
- staticpro (&Qcategory);
- Qcategory = intern_c_string ("category");
- staticpro (&Qlocal_map);
- Qlocal_map = intern_c_string ("local-map");
- staticpro (&Qfront_sticky);
- Qfront_sticky = intern_c_string ("front-sticky");
- staticpro (&Qrear_nonsticky);
- Qrear_nonsticky = intern_c_string ("rear-nonsticky");
- staticpro (&Qmouse_face);
- Qmouse_face = intern_c_string ("mouse-face");
- staticpro (&Qminibuffer_prompt);
- Qminibuffer_prompt = intern_c_string ("minibuffer-prompt");
+ DEFSYM (Qforeground, "foreground");
+ DEFSYM (Qbackground, "background");
+ DEFSYM (Qfont, "font");
+ DEFSYM (Qstipple, "stipple");
+ DEFSYM (Qunderline, "underline");
+ DEFSYM (Qread_only, "read-only");
+ DEFSYM (Qinvisible, "invisible");
+ DEFSYM (Qintangible, "intangible");
+ DEFSYM (Qcategory, "category");
+ DEFSYM (Qlocal_map, "local-map");
+ DEFSYM (Qfront_sticky, "front-sticky");
+ DEFSYM (Qrear_nonsticky, "rear-nonsticky");
+ DEFSYM (Qmouse_face, "mouse-face");
+ DEFSYM (Qminibuffer_prompt, "minibuffer-prompt");
/* Properties that text might use to specify certain actions */
- staticpro (&Qmouse_left);
- Qmouse_left = intern_c_string ("mouse-left");
- staticpro (&Qmouse_entered);
- Qmouse_entered = intern_c_string ("mouse-entered");
- staticpro (&Qpoint_left);
- Qpoint_left = intern_c_string ("point-left");
- staticpro (&Qpoint_entered);
- Qpoint_entered = intern_c_string ("point-entered");
+ DEFSYM (Qmouse_left, "mouse-left");
+ DEFSYM (Qmouse_entered, "mouse-entered");
+ DEFSYM (Qpoint_left, "point-left");
+ DEFSYM (Qpoint_entered, "point-entered");
defsubr (&Stext_properties_at);
defsubr (&Sget_text_property);