aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorKen Raeburn2000-03-30 09:56:31 +0000
committerKen Raeburn2000-03-30 09:56:31 +0000
commit8801a864d2f7d9b6a77dfffa606f27f338127582 (patch)
tree470499e90d35dabee56b08f00c6841a886dccdee /src/buffer.c
parent326855a0f45fe45c4ddd9000046ed6a9aa31534b (diff)
downloademacs-8801a864d2f7d9b6a77dfffa606f27f338127582.tar.gz
emacs-8801a864d2f7d9b6a77dfffa606f27f338127582.zip
* lisp.h (XCONS, XSTRING, XSYMBOL, XFLOAT, XPROCESS, XWINDOW, XSUBR, XBUFFER):
Verify correct object type before returning pointer, using eassert. * frame.h (XFRAME): Likewise. * buffer.c (Frename_buffer, Fset_buffer_multibyte, swap_out_buffer_local_variables, Fmove_overlay): Don't apply XSYMBOL, XBUFFER, etc, to values that may be nil or of the wrong type. * data.c (set_internal): Likewise. * dispextern.h (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P): Likewise. * fileio.c (auto_save_1): Likewise. * insdel.c (check_markers): Likewise. * marker.c (buf_charpos_to_bytepos, unchain_marker): Likewise. * undo.c (record_insert): Likewise. * vmsproc.c (child_sig): Likewise. * window.c (unshow_buffer, window_loop): Likewise. * xterm.c (x_erase_phys_cursor): Likewise.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/buffer.c b/src/buffer.c
index d54555d3242..848e9990776 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -887,14 +887,14 @@ This does not change the name of the visited file (if any).")
887 error ("Empty string is invalid as a buffer name"); 887 error ("Empty string is invalid as a buffer name");
888 888
889 tem = Fget_buffer (newname); 889 tem = Fget_buffer (newname);
890 /* Don't short-circuit if UNIQUE is t. That is a useful way to rename
891 the buffer automatically so you can create another with the original name.
892 It makes UNIQUE equivalent to
893 (rename-buffer (generate-new-buffer-name NEWNAME)). */
894 if (NILP (unique) && XBUFFER (tem) == current_buffer)
895 return current_buffer->name;
896 if (!NILP (tem)) 890 if (!NILP (tem))
897 { 891 {
892 /* Don't short-circuit if UNIQUE is t. That is a useful way to
893 rename the buffer automatically so you can create another
894 with the original name. It makes UNIQUE equivalent to
895 (rename-buffer (generate-new-buffer-name NEWNAME)). */
896 if (NILP (unique) && XBUFFER (tem) == current_buffer)
897 return current_buffer->name;
898 if (!NILP (unique)) 898 if (!NILP (unique))
899 newname = Fgenerate_new_buffer_name (newname, current_buffer->name); 899 newname = Fgenerate_new_buffer_name (newname, current_buffer->name);
900 else 900 else
@@ -1815,7 +1815,7 @@ but the contents viewed as characters do change.")
1815 TEMP_SET_PT_BOTH (PT_BYTE, PT_BYTE); 1815 TEMP_SET_PT_BOTH (PT_BYTE, PT_BYTE);
1816 1816
1817 tail = BUF_MARKERS (current_buffer); 1817 tail = BUF_MARKERS (current_buffer);
1818 while (XSYMBOL (tail) != XSYMBOL (Qnil)) 1818 while (! NILP (tail))
1819 { 1819 {
1820 XMARKER (tail)->charpos = XMARKER (tail)->bytepos; 1820 XMARKER (tail)->charpos = XMARKER (tail)->bytepos;
1821 tail = XMARKER (tail)->chain; 1821 tail = XMARKER (tail)->chain;
@@ -1880,7 +1880,7 @@ but the contents viewed as characters do change.")
1880 It is also a signal that it should never create a marker. */ 1880 It is also a signal that it should never create a marker. */
1881 BUF_MARKERS (current_buffer) = Qnil; 1881 BUF_MARKERS (current_buffer) = Qnil;
1882 1882
1883 while (XSYMBOL (tail) != XSYMBOL (Qnil)) 1883 while (! NILP (tail))
1884 { 1884 {
1885 XMARKER (tail)->bytepos 1885 XMARKER (tail)->bytepos
1886 = advance_to_char_boundary (XMARKER (tail)->bytepos); 1886 = advance_to_char_boundary (XMARKER (tail)->bytepos);
@@ -1996,7 +1996,7 @@ swap_out_buffer_local_variables (b)
1996 1996
1997 /* Need not do anything if some other buffer's binding is now encached. */ 1997 /* Need not do anything if some other buffer's binding is now encached. */
1998 tem = XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->buffer; 1998 tem = XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->buffer;
1999 if (XBUFFER (tem) == current_buffer) 1999 if (BUFFERP (tem) && XBUFFER (tem) == current_buffer)
2000 { 2000 {
2001 /* Symbol is set up for this buffer's old local value. 2001 /* Symbol is set up for this buffer's old local value.
2002 Set it up for the current buffer with the default value. */ 2002 Set it up for the current buffer with the default value. */
@@ -3166,7 +3166,7 @@ buffer.")
3166 3166
3167 obuffer = Fmarker_buffer (OVERLAY_START (overlay)); 3167 obuffer = Fmarker_buffer (OVERLAY_START (overlay));
3168 b = XBUFFER (buffer); 3168 b = XBUFFER (buffer);
3169 ob = XBUFFER (obuffer); 3169 ob = BUFFERP (obuffer) ? XBUFFER (obuffer) : (struct buffer *) 0;
3170 3170
3171 /* If the overlay has changed buffers, do a thorough redisplay. */ 3171 /* If the overlay has changed buffers, do a thorough redisplay. */
3172 if (!EQ (buffer, obuffer)) 3172 if (!EQ (buffer, obuffer))