aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/editfns.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 8194e06b762..7b5eefc1d0e 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -301,10 +301,10 @@ the return value is never within the prompt either.")
301 Fforward_line (make_number (XINT (n) - 1)); 301 Fforward_line (make_number (XINT (n) - 1));
302 end = PT; 302 end = PT;
303 303
304 if (INTEGERP (current_buffer->minibuffer_prompt_length) 304 if (INTEGERP (current_buffer->prompt_end_charpos)
305 && orig >= XFASTINT (current_buffer->minibuffer_prompt_length) 305 && orig >= XFASTINT (current_buffer->prompt_end_charpos)
306 && end < XFASTINT (current_buffer->minibuffer_prompt_length)) 306 && end < XFASTINT (current_buffer->prompt_end_charpos))
307 end = XFASTINT (current_buffer->minibuffer_prompt_length); 307 end = XFASTINT (current_buffer->prompt_end_charpos);
308 308
309 SET_PT_BOTH (orig, orig_byte); 309 SET_PT_BOTH (orig, orig_byte);
310 310
@@ -1622,13 +1622,6 @@ make_buffer_string_both (start, start_byte, end, end_byte, props)
1622{ 1622{
1623 Lisp_Object result, tem, tem1; 1623 Lisp_Object result, tem, tem1;
1624 1624
1625 if (INTEGERP (current_buffer->minibuffer_prompt_length))
1626 {
1627 int len = XFASTINT (current_buffer->minibuffer_prompt_length);
1628 start = min (end, max (len, start));
1629 start_byte = CHAR_TO_BYTE (start);
1630 }
1631
1632 if (start < GPT && GPT < end) 1625 if (start < GPT && GPT < end)
1633 move_gap (start); 1626 move_gap (start);
1634 1627
@@ -1729,10 +1722,19 @@ they can be in either order.")
1729DEFUN ("buffer-string", Fbuffer_string, Sbuffer_string, 0, 0, 0, 1722DEFUN ("buffer-string", Fbuffer_string, Sbuffer_string, 0, 0, 0,
1730 "Return the contents of the current buffer as a string.\n\ 1723 "Return the contents of the current buffer as a string.\n\
1731If narrowing is in effect, this function returns only the visible part\n\ 1724If narrowing is in effect, this function returns only the visible part\n\
1732of the buffer.") 1725of the buffer. If in a mini-buffer, don't include the prompt in the\n\
1726string returned.")
1733 () 1727 ()
1734{ 1728{
1735 return make_buffer_string (BEGV, ZV, 1); 1729 int start = BEGV;
1730
1731 if (INTEGERP (current_buffer->prompt_end_charpos))
1732 {
1733 int len = XFASTINT (current_buffer->prompt_end_charpos);
1734 start = min (ZV, max (len, start));
1735 }
1736
1737 return make_buffer_string (start, ZV, 1);
1736} 1738}
1737 1739
1738DEFUN ("insert-buffer-substring", Finsert_buffer_substring, Sinsert_buffer_substring, 1740DEFUN ("insert-buffer-substring", Finsert_buffer_substring, Sinsert_buffer_substring,