]> git.eshelyaron.com Git - emacs.git/commitdiff
Document that `buffer-string' retains text properties
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 18 Mar 2021 04:59:12 +0000 (05:59 +0100)
committerEli Zaretskii <eliz@gnu.org>
Thu, 18 Mar 2021 09:03:14 +0000 (11:03 +0200)
* 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).

(cherry picked from commit 60af754170f22f5d25510af069ed0ebfec95f992)

doc/lispref/text.texi
src/editfns.c

index 89582acd35a7c22052e6b5629a3bdd4a1cbdd0a7..6eda581777eb354b963eddb4a985afdafa109e0a 100644 (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
index 255537cdc6d6a091d2d83182777aba8687fdc2e3..621e35171d80411f002b6b664210518874d5513b 100644 (file)
@@ -1682,7 +1682,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 don’t want the text properties,
+use `buffer-substring-no-properties' instead.  */)
   (void)
 {
   return make_buffer_string_both (BEGV, BEGV_BYTE, ZV, ZV_BYTE, 1);