aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 166f5b72449..233137e368e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5413,33 +5413,7 @@ See Info node `(elisp)Garbage Collection'. */)
5413 /* Don't keep undo information around forever. 5413 /* Don't keep undo information around forever.
5414 Do this early on, so it is no problem if the user quits. */ 5414 Do this early on, so it is no problem if the user quits. */
5415 for_each_buffer (nextb) 5415 for_each_buffer (nextb)
5416 { 5416 compact_buffer (nextb);
5417 /* If a buffer's undo list is Qt, that means that undo is
5418 turned off in that buffer. Calling truncate_undo_list on
5419 Qt tends to return NULL, which effectively turns undo back on.
5420 So don't call truncate_undo_list if undo_list is Qt. */
5421 if (! NILP (nextb->BUFFER_INTERNAL_FIELD (name))
5422 && ! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt))
5423 truncate_undo_list (nextb);
5424
5425 /* Shrink buffer gaps, but skip indirect and dead buffers. */
5426 if (nextb->base_buffer == 0 && !NILP (nextb->BUFFER_INTERNAL_FIELD (name))
5427 && ! nextb->text->inhibit_shrinking)
5428 {
5429 /* If a buffer's gap size is more than 10% of the buffer
5430 size, or larger than 2000 bytes, then shrink it
5431 accordingly. Keep a minimum size of 20 bytes. */
5432 int size = min (2000, max (20, (nextb->text->z_byte / 10)));
5433
5434 if (nextb->text->gap_size > size)
5435 {
5436 struct buffer *save_current = current_buffer;
5437 current_buffer = nextb;
5438 make_gap (-(nextb->text->gap_size - size));
5439 current_buffer = save_current;
5440 }
5441 }
5442 }
5443 5417
5444 t1 = current_emacs_time (); 5418 t1 = current_emacs_time ();
5445 5419