Mercurial > emacs
comparison src/xdisp.c @ 34479:aab24f62ad6b
(setup_echo_area_for_printing, with_echo_area_buffer):
Bind `inhibit-read-only' to t.
(unwind_with_echo_area_buffer): Use AREF.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 12 Dec 2000 13:31:47 +0000 |
parents | 8f8d6aa6af8b |
children | 41ad2cf8ccb8 |
comparison
equal
deleted
inserted
replaced
34478:1b32037b8a8d | 34479:aab24f62ad6b |
---|---|
5918 set_marker_both (w->pointm, buffer, BEG, BEG_BYTE); | 5918 set_marker_both (w->pointm, buffer, BEG, BEG_BYTE); |
5919 } | 5919 } |
5920 | 5920 |
5921 current_buffer->undo_list = Qt; | 5921 current_buffer->undo_list = Qt; |
5922 current_buffer->read_only = Qnil; | 5922 current_buffer->read_only = Qnil; |
5923 specbind (Qinhibit_read_only, Qt); | |
5923 | 5924 |
5924 if (clear_buffer_p && Z > BEG) | 5925 if (clear_buffer_p && Z > BEG) |
5925 del_range (BEG, Z); | 5926 del_range (BEG, Z); |
5926 | 5927 |
5927 xassert (BEGV >= BEG); | 5928 xassert (BEGV >= BEG); |
5985 | 5986 |
5986 static Lisp_Object | 5987 static Lisp_Object |
5987 unwind_with_echo_area_buffer (vector) | 5988 unwind_with_echo_area_buffer (vector) |
5988 Lisp_Object vector; | 5989 Lisp_Object vector; |
5989 { | 5990 { |
5990 int i = 0; | 5991 set_buffer_internal_1 (XBUFFER (AREF (vector, 0))); |
5991 | 5992 Vdeactivate_mark = AREF (vector, 1); |
5992 set_buffer_internal_1 (XBUFFER (XVECTOR (vector)->contents[i])); ++i; | 5993 windows_or_buffers_changed = XFASTINT (AREF (vector, 2)); |
5993 Vdeactivate_mark = XVECTOR (vector)->contents[i]; ++i; | 5994 |
5994 windows_or_buffers_changed = XFASTINT (XVECTOR (vector)->contents[i]); ++i; | 5995 if (WINDOWP (AREF (vector, 3))) |
5995 | |
5996 if (WINDOWP (XVECTOR (vector)->contents[i])) | |
5997 { | 5996 { |
5998 struct window *w; | 5997 struct window *w; |
5999 Lisp_Object buffer, charpos, bytepos; | 5998 Lisp_Object buffer, charpos, bytepos; |
6000 | 5999 |
6001 w = XWINDOW (XVECTOR (vector)->contents[i]); ++i; | 6000 w = XWINDOW (AREF (vector, 3)); |
6002 buffer = XVECTOR (vector)->contents[i]; ++i; | 6001 buffer = AREF (vector, 4); |
6003 charpos = XVECTOR (vector)->contents[i]; ++i; | 6002 charpos = AREF (vector, 5); |
6004 bytepos = XVECTOR (vector)->contents[i]; ++i; | 6003 bytepos = AREF (vector, 6); |
6005 | 6004 |
6006 w->buffer = buffer; | 6005 w->buffer = buffer; |
6007 set_marker_both (w->pointm, buffer, | 6006 set_marker_both (w->pointm, buffer, |
6008 XFASTINT (charpos), XFASTINT (bytepos)); | 6007 XFASTINT (charpos), XFASTINT (bytepos)); |
6009 } | 6008 } |
6031 else | 6030 else |
6032 echo_area_buffer[0] = echo_buffer[0]; | 6031 echo_area_buffer[0] = echo_buffer[0]; |
6033 | 6032 |
6034 /* Switch to that buffer and clear it. */ | 6033 /* Switch to that buffer and clear it. */ |
6035 set_buffer_internal (XBUFFER (echo_area_buffer[0])); | 6034 set_buffer_internal (XBUFFER (echo_area_buffer[0])); |
6035 | |
6036 if (Z > BEG) | 6036 if (Z > BEG) |
6037 del_range (BEG, Z); | 6037 { |
6038 int count = BINDING_STACK_SIZE (); | |
6039 specbind (Qinhibit_read_only, Qt); | |
6040 del_range (BEG, Z); | |
6041 unbind_to (count, Qnil); | |
6042 } | |
6038 TEMP_SET_PT_BOTH (BEG, BEG_BYTE); | 6043 TEMP_SET_PT_BOTH (BEG, BEG_BYTE); |
6039 | 6044 |
6040 /* Set up the buffer for the multibyteness we need. */ | 6045 /* Set up the buffer for the multibyteness we need. */ |
6041 if (multibyte_p | 6046 if (multibyte_p |
6042 != !NILP (current_buffer->enable_multibyte_characters)) | 6047 != !NILP (current_buffer->enable_multibyte_characters)) |