diff options
| author | Richard M. Stallman | 1994-07-17 23:53:10 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-07-17 23:53:10 +0000 |
| commit | 46bb7c2b49a747d2d466fcc979abeab28fd0780d (patch) | |
| tree | ee300ed10b7223c997c4551aad222c8fd453fffa /src/textprop.c | |
| parent | a6ac02afc3576560cec29672a2d0aa0dd0f74306 (diff) | |
| download | emacs-46bb7c2b49a747d2d466fcc979abeab28fd0780d.tar.gz emacs-46bb7c2b49a747d2d466fcc979abeab28fd0780d.zip | |
(Fget_text_property): Simplify using Ftext_properties_at.
Diffstat (limited to 'src/textprop.c')
| -rw-r--r-- | src/textprop.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/textprop.c b/src/textprop.c index 1f8a0503c93..fc09dc41d81 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -501,25 +501,9 @@ OBJECT is optional and defaults to the current buffer.\n\ | |||
| 501 | If POSITION is at the end of OBJECT, the value is nil.") | 501 | If POSITION is at the end of OBJECT, the value is nil.") |
| 502 | (pos, prop, object) | 502 | (pos, prop, object) |
| 503 | Lisp_Object pos, object; | 503 | Lisp_Object pos, object; |
| 504 | register Lisp_Object prop; | 504 | Lisp_Object prop; |
| 505 | { | 505 | { |
| 506 | register INTERVAL i; | 506 | return textget (Ftext_properties_at (pos, object), prop); |
| 507 | register Lisp_Object tail; | ||
| 508 | |||
| 509 | if (NILP (object)) | ||
| 510 | XSET (object, Lisp_Buffer, current_buffer); | ||
| 511 | i = validate_interval_range (object, &pos, &pos, soft); | ||
| 512 | if (NULL_INTERVAL_P (i)) | ||
| 513 | return Qnil; | ||
| 514 | |||
| 515 | /* If POS is at the end of the interval, | ||
| 516 | it means it's the end of OBJECT. | ||
| 517 | There are no properties at the very end, | ||
| 518 | since no character follows. */ | ||
| 519 | if (XINT (pos) == LENGTH (i) + i->position) | ||
| 520 | return Qnil; | ||
| 521 | |||
| 522 | return textget (i->plist, prop); | ||
| 523 | } | 507 | } |
| 524 | 508 | ||
| 525 | DEFUN ("get-char-property", Fget_char_property, Sget_char_property, 2, 3, 0, | 509 | DEFUN ("get-char-property", Fget_char_property, Sget_char_property, 2, 3, 0, |