diff options
| author | Lars Ingebrigtsen | 2021-03-18 05:59:12 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-03-18 05:59:12 +0100 |
| commit | 60af754170f22f5d25510af069ed0ebfec95f992 (patch) | |
| tree | 6fdff54b73dc040441b5a999082e08eb7a691905 | |
| parent | 6a75b6fcb10725fb1e352dec506b84e795baa7c8 (diff) | |
| download | emacs-60af754170f22f5d25510af069ed0ebfec95f992.tar.gz emacs-60af754170f22f5d25510af069ed0ebfec95f992.zip | |
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).
| -rw-r--r-- | doc/lispref/text.texi | 4 | ||||
| -rw-r--r-- | src/editfns.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index e47e851b101..44c4b90b2fc 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -222,7 +222,9 @@ properties, just the characters themselves. @xref{Text Properties}. | |||
| 222 | 222 | ||
| 223 | @defun buffer-string | 223 | @defun buffer-string |
| 224 | This function returns the contents of the entire accessible portion of | 224 | This function returns the contents of the entire accessible portion of |
| 225 | the current buffer, as a string. | 225 | the current buffer, as a string. If the text being copied has any |
| 226 | text properties, these are copied into the string along with the | ||
| 227 | characters they belong to. | ||
| 226 | @end defun | 228 | @end defun |
| 227 | 229 | ||
| 228 | If you need to make sure the resulting string, when copied to a | 230 | If you need to make sure the resulting string, when copied to a |
diff --git a/src/editfns.c b/src/editfns.c index fb20fc96550..bc6553a7d2c 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -1697,7 +1697,11 @@ they can be in either order. */) | |||
| 1697 | DEFUN ("buffer-string", Fbuffer_string, Sbuffer_string, 0, 0, 0, | 1697 | DEFUN ("buffer-string", Fbuffer_string, Sbuffer_string, 0, 0, 0, |
| 1698 | doc: /* Return the contents of the current buffer as a string. | 1698 | doc: /* Return the contents of the current buffer as a string. |
| 1699 | If narrowing is in effect, this function returns only the visible part | 1699 | If narrowing is in effect, this function returns only the visible part |
| 1700 | of the buffer. */) | 1700 | of the buffer. |
| 1701 | |||
| 1702 | This function copies the text properties of that part of the buffer | ||
| 1703 | into the result string; if you don’t want the text properties, | ||
| 1704 | use `buffer-substring-no-properties' instead. */) | ||
| 1701 | (void) | 1705 | (void) |
| 1702 | { | 1706 | { |
| 1703 | return make_buffer_string_both (BEGV, BEGV_BYTE, ZV, ZV_BYTE, 1); | 1707 | return make_buffer_string_both (BEGV, BEGV_BYTE, ZV, ZV_BYTE, 1); |