diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 20 |
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)) |