diff options
| author | Lars Ingebrigtsen | 2022-04-28 13:04:28 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-04-28 13:04:28 +0200 |
| commit | 6db90a412ac3aac6ff44d0d92ac26b2ecb228071 (patch) | |
| tree | de2500aa9a941e42fe6aa64b99921c48f436e96a /src | |
| parent | 8a007ebc2e62ce77dd34b22a017c1ce6f5d2672c (diff) | |
| download | emacs-6db90a412ac3aac6ff44d0d92ac26b2ecb228071.tar.gz emacs-6db90a412ac3aac6ff44d0d92ac26b2ecb228071.zip | |
Document the non-effect of narrowing on get-text-property
* doc/lispref/text.texi (Examining Properties): Document
surprising non-effect of narrowing (bug#16413).
* src/textprop.c (Ftext_properties_at, Fget_text_property):
Mention narrowing.
Diffstat (limited to 'src')
| -rw-r--r-- | src/textprop.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/textprop.c b/src/textprop.c index c6c9e102e34..072aac28667 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -561,8 +561,13 @@ DEFUN ("text-properties-at", Ftext_properties_at, | |||
| 561 | doc: /* Return the list of properties of the character at POSITION in OBJECT. | 561 | doc: /* Return the list of properties of the character at POSITION in OBJECT. |
| 562 | If the optional second argument OBJECT is a buffer (or nil, which means | 562 | If the optional second argument OBJECT is a buffer (or nil, which means |
| 563 | the current buffer), POSITION is a buffer position (integer or marker). | 563 | the current buffer), POSITION is a buffer position (integer or marker). |
| 564 | |||
| 564 | If OBJECT is a string, POSITION is a 0-based index into it. | 565 | If OBJECT is a string, POSITION is a 0-based index into it. |
| 565 | If POSITION is at the end of OBJECT, the value is nil. | 566 | |
| 567 | If POSITION is at the end of OBJECT, the value is nil, but note that | ||
| 568 | buffer narrowing does not affect the value. That is, if OBJECT is a | ||
| 569 | buffer or nil, and the buffer is narrowed and POSITION is at the end | ||
| 570 | of the narrowed buffer, the result may be non-nil. | ||
| 566 | 571 | ||
| 567 | If you want to display the text properties at point in a human-readable | 572 | If you want to display the text properties at point in a human-readable |
| 568 | form, use the `describe-text-properties' command. */) | 573 | form, use the `describe-text-properties' command. */) |
| @@ -590,7 +595,11 @@ DEFUN ("get-text-property", Fget_text_property, Sget_text_property, 2, 3, 0, | |||
| 590 | doc: /* Return the value of POSITION's property PROP, in OBJECT. | 595 | doc: /* Return the value of POSITION's property PROP, in OBJECT. |
| 591 | OBJECT should be a buffer or a string; if omitted or nil, it defaults | 596 | OBJECT should be a buffer or a string; if omitted or nil, it defaults |
| 592 | to the current buffer. | 597 | to the current buffer. |
| 593 | If POSITION is at the end of OBJECT, the value is nil. */) | 598 | |
| 599 | If POSITION is at the end of OBJECT, the value is nil, but note that | ||
| 600 | buffer narrowing does not affect the value. That is, if the buffer is | ||
| 601 | narrowed and POSITION is at the end of the narrowed buffer, the result | ||
| 602 | may be non-nil. */) | ||
| 594 | (Lisp_Object position, Lisp_Object prop, Lisp_Object object) | 603 | (Lisp_Object position, Lisp_Object prop, Lisp_Object object) |
| 595 | { | 604 | { |
| 596 | return textget (Ftext_properties_at (position, object), prop); | 605 | return textget (Ftext_properties_at (position, object), prop); |