diff options
author | Karl Heuer <kwzh@gnu.org> | 1994-11-18 07:17:17 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1994-11-18 07:17:17 +0000 |
commit | c01d131386c3b8362364456a7a53dfda292323a7 (patch) | |
tree | edaa5e4d3cbb96402464db75e42dedc9a1c2172c /src/indent.c | |
parent | e1f26fa18f859ff4bda40363807fb96f34228352 (diff) | |
download | emacs-c01d131386c3b8362364456a7a53dfda292323a7.tar.gz |
(recompute_width_table): Do the right thing if no previous table existed.
Fix Lisp_Object vs. integer problem.
(width_run_cache_on_off): Let recompute_width_table create the vector.
Diffstat (limited to 'src/indent.c')
-rw-r--r-- | src/indent.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/indent.c b/src/indent.c index 5e369e8d976..4f93951c1bf 100644 --- a/src/indent.c +++ b/src/indent.c @@ -130,16 +130,16 @@ recompute_width_table (buf, disptab) struct Lisp_Vector *disptab; { int i; - struct Lisp_Vector *widthtab - = (VECTORP (buf->width_table) - ? XVECTOR (buf->width_table) - : XVECTOR (Fmake_vector (make_number (256), make_number (0)))); + struct Lisp_Vector *widthtab; + if (!VECTORP (buf->width_table)) + buf->width_table = Fmake_vector (make_number (256), make_number (0)); + widthtab = XVECTOR (buf->width_table); if (widthtab->size != 256) abort (); for (i = 0; i < 256; i++) - widthtab->contents[i] = character_width (i, disptab); + XSETFASTINT (widthtab->contents[i], character_width (i, disptab)); } /* Allocate or free the width run cache, as requested by the current @@ -163,8 +163,6 @@ width_run_cache_on_off () if (current_buffer->width_run_cache == 0) { current_buffer->width_run_cache = new_region_cache (); - current_buffer->width_table = Fmake_vector (make_number (256), - make_number (0)); recompute_width_table (current_buffer, buffer_display_table ()); } } |