[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/buffer.c
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/src/buffer.c |
Date: |
Thu, 26 Jun 2003 19:16:45 -0400 |
Index: emacs/src/buffer.c
diff -c emacs/src/buffer.c:1.426 emacs/src/buffer.c:1.427
*** emacs/src/buffer.c:1.426 Tue Jun 3 09:30:08 2003
--- emacs/src/buffer.c Thu Jun 26 19:16:44 2003
***************
*** 413,419 ****
reset_buffer_local_variables (b, 1);
b->mark = Fmake_marker ();
! BUF_MARKERS (b) = Qnil;
b->name = name;
/* Put this in the alist of all live buffers. */
--- 413,419 ----
reset_buffer_local_variables (b, 1);
b->mark = Fmake_marker ();
! BUF_MARKERS (b) = NULL;
b->name = name;
/* Put this in the alist of all live buffers. */
***************
*** 1408,1435 ****
/* Unchain all markers that belong to this indirect buffer.
Don't unchain the markers that belong to the base buffer
or its other indirect buffers. */
! for (tem = BUF_MARKERS (b); !NILP (tem); )
{
! Lisp_Object next;
! m = XMARKER (tem);
! next = m->chain;
if (m->buffer == b)
! unchain_marker (tem);
! tem = next;
}
}
else
{
/* Unchain all markers of this buffer and its indirect buffers.
and leave them pointing nowhere. */
! for (tem = BUF_MARKERS (b); !NILP (tem); )
{
! m = XMARKER (tem);
m->buffer = 0;
! tem = m->chain;
! m->chain = Qnil;
}
! BUF_MARKERS (b) = Qnil;
BUF_INTERVALS (b) = NULL_INTERVAL;
/* Perhaps we should explicitly free the interval tree here... */
--- 1408,1433 ----
/* Unchain all markers that belong to this indirect buffer.
Don't unchain the markers that belong to the base buffer
or its other indirect buffers. */
! for (m = BUF_MARKERS (b); m; )
{
! struct Lisp_Marker *next = m->next;
if (m->buffer == b)
! unchain_marker (m);
! m = next;
}
}
else
{
/* Unchain all markers of this buffer and its indirect buffers.
and leave them pointing nowhere. */
! for (m = BUF_MARKERS (b); m; )
{
! struct Lisp_Marker *next = m->next;
m->buffer = 0;
! m->next = NULL;
! m = next;
}
! BUF_MARKERS (b) = NULL;
BUF_INTERVALS (b) = NULL_INTERVAL;
/* Perhaps we should explicitly free the interval tree here... */
***************
*** 1773,1779 ****
/* Look down buffer's list of local Lisp variables
to find and update any that forward into C variables. */
! for (tail = b->local_var_alist; !NILP (tail); tail = XCDR (tail))
{
valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
if ((BUFFER_LOCAL_VALUEP (valcontents)
--- 1771,1777 ----
/* Look down buffer's list of local Lisp variables
to find and update any that forward into C variables. */
! for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail))
{
valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
if ((BUFFER_LOCAL_VALUEP (valcontents)
***************
*** 1788,1794 ****
/* Do the same with any others that were local to the previous buffer */
if (old_buf)
! for (tail = old_buf->local_var_alist; !NILP (tail); tail = XCDR (tail))
{
valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
if ((BUFFER_LOCAL_VALUEP (valcontents)
--- 1786,1792 ----
/* Do the same with any others that were local to the previous buffer */
if (old_buf)
! for (tail = old_buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
{
valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
if ((BUFFER_LOCAL_VALUEP (valcontents)
***************
*** 2046,2052 ****
(flag)
Lisp_Object flag;
{
! Lisp_Object tail, markers;
struct buffer *other;
int undo_enabled_p = !EQ (current_buffer->undo_list, Qt);
int begv, zv;
--- 2044,2050 ----
(flag)
Lisp_Object flag;
{
! struct Lisp_Marker *tail, *markers;
struct buffer *other;
int undo_enabled_p = !EQ (current_buffer->undo_list, Qt);
int begv, zv;
***************
*** 2093,2104 ****
GPT = GPT_BYTE;
TEMP_SET_PT_BOTH (PT_BYTE, PT_BYTE);
! tail = BUF_MARKERS (current_buffer);
! while (! NILP (tail))
! {
! XMARKER (tail)->charpos = XMARKER (tail)->bytepos;
! tail = XMARKER (tail)->chain;
! }
/* Convert multibyte form of 8-bit characters to unibyte. */
pos = BEG;
--- 2091,2099 ----
GPT = GPT_BYTE;
TEMP_SET_PT_BOTH (PT_BYTE, PT_BYTE);
!
! for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next)
! tail->charpos = tail->bytepos;
/* Convert multibyte form of 8-bit characters to unibyte. */
pos = BEG;
***************
*** 2246,2265 ****
/* This prevents BYTE_TO_CHAR (that is, buf_bytepos_to_charpos) from
getting confused by the markers that have not yet been updated.
It is also a signal that it should never create a marker. */
! BUF_MARKERS (current_buffer) = Qnil;
! while (! NILP (tail))
{
! XMARKER (tail)->bytepos
! = advance_to_char_boundary (XMARKER (tail)->bytepos);
! XMARKER (tail)->charpos = BYTE_TO_CHAR (XMARKER (tail)->bytepos);
!
! tail = XMARKER (tail)->chain;
}
/* Make sure no markers were put on the chain
while the chain value was incorrect. */
! if (! EQ (BUF_MARKERS (current_buffer), Qnil))
abort ();
BUF_MARKERS (current_buffer) = markers;
--- 2241,2257 ----
/* This prevents BYTE_TO_CHAR (that is, buf_bytepos_to_charpos) from
getting confused by the markers that have not yet been updated.
It is also a signal that it should never create a marker. */
! BUF_MARKERS (current_buffer) = NULL;
! for (; tail; tail = tail->next)
{
! tail->bytepos = advance_to_char_boundary (tail->bytepos);
! tail->charpos = BYTE_TO_CHAR (tail->bytepos);
}
/* Make sure no markers were put on the chain
while the chain value was incorrect. */
! if (BUF_MARKERS (current_buffer))
abort ();
BUF_MARKERS (current_buffer) = markers;