aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Ingebrigtsen2022-04-28 13:04:28 +0200
committerLars Ingebrigtsen2022-04-28 13:04:28 +0200
commit6db90a412ac3aac6ff44d0d92ac26b2ecb228071 (patch)
treede2500aa9a941e42fe6aa64b99921c48f436e96a /src
parent8a007ebc2e62ce77dd34b22a017c1ce6f5d2672c (diff)
downloademacs-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.c13
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.
562If the optional second argument OBJECT is a buffer (or nil, which means 562If the optional second argument OBJECT is a buffer (or nil, which means
563the current buffer), POSITION is a buffer position (integer or marker). 563the current buffer), POSITION is a buffer position (integer or marker).
564
564If OBJECT is a string, POSITION is a 0-based index into it. 565If OBJECT is a string, POSITION is a 0-based index into it.
565If POSITION is at the end of OBJECT, the value is nil. 566
567If POSITION is at the end of OBJECT, the value is nil, but note that
568buffer narrowing does not affect the value. That is, if OBJECT is a
569buffer or nil, and the buffer is narrowed and POSITION is at the end
570of the narrowed buffer, the result may be non-nil.
566 571
567If you want to display the text properties at point in a human-readable 572If you want to display the text properties at point in a human-readable
568form, use the `describe-text-properties' command. */) 573form, 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.
591OBJECT should be a buffer or a string; if omitted or nil, it defaults 596OBJECT should be a buffer or a string; if omitted or nil, it defaults
592to the current buffer. 597to the current buffer.
593If POSITION is at the end of OBJECT, the value is nil. */) 598
599If POSITION is at the end of OBJECT, the value is nil, but note that
600buffer narrowing does not affect the value. That is, if the buffer is
601narrowed and POSITION is at the end of the narrowed buffer, the result
602may 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);