Document that `buffer-string' retains text properties

* doc/lispref/text.texi (Buffer Contents): Mention text properties
in the `buffer-string' documentation.
* src/editfns.c (Fbuffer_string): Mention text properties in the
doc string (bug#47220).
This commit is contained in:
Lars Ingebrigtsen 2021-03-18 05:59:12 +01:00
parent 6a75b6fcb1
commit 60af754170
2 changed files with 8 additions and 2 deletions

View file

@ -222,7 +222,9 @@ properties, just the characters themselves. @xref{Text Properties}.
@defun buffer-string
This function returns the contents of the entire accessible portion of
the current buffer, as a string.
the current buffer, as a string. If the text being copied has any
text properties, these are copied into the string along with the
characters they belong to.
@end defun
If you need to make sure the resulting string, when copied to a

View file

@ -1697,7 +1697,11 @@ they can be in either order. */)
DEFUN ("buffer-string", Fbuffer_string, Sbuffer_string, 0, 0, 0,
doc: /* Return the contents of the current buffer as a string.
If narrowing is in effect, this function returns only the visible part
of the buffer. */)
of the buffer.
This function copies the text properties of that part of the buffer
into the result string; if you dont want the text properties,
use `buffer-substring-no-properties' instead. */)
(void)
{
return make_buffer_string_both (BEGV, BEGV_BYTE, ZV, ZV_BYTE, 1);