aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-12-24 15:41:28 +0400
committerDmitry Antipov2012-12-24 15:41:28 +0400
commitf9e7c67e4ccdaf160c0506748f776d628a38eeba (patch)
tree5450281668646d918080a93c474bc461c84c9b84 /src/buffer.c
parentdab2e22def49ff65ec803c070df4984424808aed (diff)
downloademacs-f9e7c67e4ccdaf160c0506748f776d628a38eeba.tar.gz
emacs-f9e7c67e4ccdaf160c0506748f776d628a38eeba.zip
* buffer.h (BUF_COMPACT): New macro to follow the common style.
* buffer.c (Fget_buffer_create): Use it to set compact field of struct buffer_text to avoid accessing an uninitialized value when compact_buffer is called for the first time. (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 3cf590d4db7..21c42fc82b7 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -575,6 +575,7 @@ even if it is dead. The return value is never nil. */)
575 BUF_CHARS_MODIFF (b) = 1; 575 BUF_CHARS_MODIFF (b) = 1;
576 BUF_OVERLAY_MODIFF (b) = 1; 576 BUF_OVERLAY_MODIFF (b) = 1;
577 BUF_SAVE_MODIFF (b) = 1; 577 BUF_SAVE_MODIFF (b) = 1;
578 BUF_COMPACT (b) = 1;
578 set_buffer_intervals (b, NULL); 579 set_buffer_intervals (b, NULL);
579 BUF_UNCHANGED_MODIFIED (b) = 1; 580 BUF_UNCHANGED_MODIFIED (b) = 1;
580 BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1; 581 BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1;
@@ -1669,7 +1670,7 @@ compact_buffer (struct buffer *buffer)
1669 which aren't changed since last compaction. */ 1670 which aren't changed since last compaction. */
1670 if (BUFFER_LIVE_P (buffer) 1671 if (BUFFER_LIVE_P (buffer)
1671 && (buffer->base_buffer == NULL) 1672 && (buffer->base_buffer == NULL)
1672 && (buffer->text->compact != buffer->text->modiff)) 1673 && (BUF_COMPACT (buffer) != BUF_MODIFF (buffer)))
1673 { 1674 {
1674 /* If a buffer's undo list is Qt, that means that undo is 1675 /* If a buffer's undo list is Qt, that means that undo is
1675 turned off in that buffer. Calling truncate_undo_list on 1676 turned off in that buffer. Calling truncate_undo_list on
@@ -1694,7 +1695,7 @@ compact_buffer (struct buffer *buffer)
1694 current_buffer = save_current; 1695 current_buffer = save_current;
1695 } 1696 }
1696 } 1697 }
1697 buffer->text->compact = buffer->text->modiff; 1698 BUF_COMPACT (buffer) = BUF_MODIFF (buffer);
1698 } 1699 }
1699} 1700}
1700 1701