1 |
/* Lisp functions pertaining to editing. |
/* Lisp functions pertaining to editing. |
2 |
Copyright (C) 1985,86,87,89,93,94,95,96,97,98, 1999, 2000, 2001, 2002 |
Copyright (C) 1985,86,87,89,93,94,95,96,97,98, 1999, 2000, 2001, 02, 2003 |
3 |
Free Software Foundation, Inc. |
Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of GNU Emacs. |
This file is part of GNU Emacs. |
399 |
Lisp_Object position, object; |
Lisp_Object position, object; |
400 |
register Lisp_Object prop; |
register Lisp_Object prop; |
401 |
{ |
{ |
|
struct window *w = 0; |
|
|
|
|
402 |
CHECK_NUMBER_COERCE_MARKER (position); |
CHECK_NUMBER_COERCE_MARKER (position); |
403 |
|
|
404 |
if (NILP (object)) |
if (NILP (object)) |
405 |
XSETBUFFER (object, current_buffer); |
XSETBUFFER (object, current_buffer); |
406 |
|
else if (WINDOWP (object)) |
407 |
|
object = XWINDOW (object)->buffer; |
408 |
|
|
409 |
if (WINDOWP (object)) |
if (!BUFFERP (object)) |
410 |
{ |
/* pos-property only makes sense in buffers right now, since strings |
411 |
w = XWINDOW (object); |
have no overlays and no notion of insertion for which stickiness |
412 |
object = w->buffer; |
could be obeyed. */ |
413 |
} |
return Fget_text_property (position, prop, object); |
414 |
if (BUFFERP (object)) |
else |
415 |
{ |
{ |
416 |
int posn = XINT (position); |
int posn = XINT (position); |
417 |
int noverlays; |
int noverlays; |
457 |
} |
} |
458 |
} |
} |
459 |
|
|
460 |
|
{ /* Now check the text-properties. */ |
461 |
|
int stickiness = text_property_stickiness (prop, position, object); |
462 |
|
if (stickiness > 0) |
463 |
|
return Fget_text_property (position, prop, object); |
464 |
|
else if (stickiness < 0 |
465 |
|
&& XINT (position) > BUF_BEGV (XBUFFER (object))) |
466 |
|
return Fget_text_property (make_number (XINT (position) - 1), |
467 |
|
prop, object); |
468 |
|
else |
469 |
|
return Qnil; |
470 |
|
} |
471 |
} |
} |
|
|
|
|
{ /* Now check the text-properties. */ |
|
|
int stickiness = text_property_stickiness (prop, position); |
|
|
if (stickiness > 0) |
|
|
return Fget_text_property (position, prop, Qnil); |
|
|
else if (stickiness < 0 && XINT (position) > BEGV) |
|
|
return Fget_text_property (make_number (XINT (position) - 1), |
|
|
prop, Qnil); |
|
|
else |
|
|
return Qnil; |
|
|
} |
|
472 |
} |
} |
473 |
|
|
474 |
/* Find the field surrounding POS in *BEG and *END. If POS is nil, |
/* Find the field surrounding POS in *BEG and *END. If POS is nil, |