Function: buffer-string

buffer-string is a function defined in editfns.c.

Signature

(buffer-string)

Documentation

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.

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.

Other relevant functions are documented in the buffer group.

View in manual

Probably introduced at or before Emacs version 20.1.

Shortdoc

;; buffer
(buffer-string)
    -> [it depends]

Source Code

// Defined in /usr/src/emacs/src/editfns.c
{
  return make_buffer_string_both (BEGV, BEGV_BYTE, ZV, ZV_BYTE, 1);
}