Function: buffer-substring
buffer-substring is a function defined in editfns.c.
Signature
(buffer-substring START END)
Documentation
Return the contents of part of the current buffer as a string.
The two arguments START and END are character positions; they can be in either order. The string returned is multibyte if the buffer is multibyte.
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.
Probably introduced at or before Emacs version 17.
Shortdoc
;; buffer
(buffer-substring (point-min) (+ (point-min) 10))
=> #("Buffer Bas" 0 10 (face shortdoc-heading shortdoc-section t outline-level 1))
Source Code
// Defined in /usr/src/emacs/src/editfns.c
{
register ptrdiff_t b, e;
validate_region (&start, &end);
b = XFIXNUM (start);
e = XFIXNUM (end);
return make_buffer_string (b, e, 1);
}