aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann1999-09-12 20:21:51 +0000
committerGerd Moellmann1999-09-12 20:21:51 +0000
commit2da8bf64bdaaf354d0cfb876f385683e93e95441 (patch)
treeb79f3ff7d8e1ca8e642dd12a3c92716fdadedc58
parentc99f60805759ad9930bd39fb8861e406de7c7bdc (diff)
downloademacs-2da8bf64bdaaf354d0cfb876f385683e93e95441.tar.gz
emacs-2da8bf64bdaaf354d0cfb876f385683e93e95441.zip
(Fbuffer_string): Use prompt_end_charpos instead
of minibuffer_prompt_length. (Fline_beginning_position): Ditto. (make_buffer_string_both): Take out the code to handle mini-buffer prompts. (Fbuffer_string): Handle the prompt here, instead.
-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,