line-substring-with-bidi-context
line-substring-with-bidi-context is a compiled Lisp function in `simple.el
'.
(line-substring-with-bidi-context START END &optional NO-PROPERTIES)
Return buffer text between START and END with its bidi context.
START and END are assumed to belong to the same physical line
of buffer text. This function prepends and appends to the text
between START and END bidi control characters that preserve the
visual order of that text when it is inserted at some other place.