aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1994-11-18 07:17:17 +0000
committerKarl Heuer1994-11-18 07:17:17 +0000
commit228a2e1a479455a6ce156ea19aa72ebfd01be7d4 (patch)
tree9e211b6e4d2d058db4efb8cfcf3a966aba5c48b0 /src
parentb5088f8084d2e9250650a4b58ac2111ac1ff2d96 (diff)
downloademacs-228a2e1a479455a6ce156ea19aa72ebfd01be7d4.tar.gz
emacs-228a2e1a479455a6ce156ea19aa72ebfd01be7d4.zip
(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')
-rw-r--r--src/indent.c12
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)
130 struct Lisp_Vector *disptab; 130 struct Lisp_Vector *disptab;
131{ 131{
132 int i; 132 int i;
133 struct Lisp_Vector *widthtab 133 struct Lisp_Vector *widthtab;
134 = (VECTORP (buf->width_table)
135 ? XVECTOR (buf->width_table)
136 : XVECTOR (Fmake_vector (make_number (256), make_number (0))));
137 134
135 if (!VECTORP (buf->width_table))
136 buf->width_table = Fmake_vector (make_number (256), make_number (0));
137 widthtab = XVECTOR (buf->width_table);
138 if (widthtab->size != 256) 138 if (widthtab->size != 256)
139 abort (); 139 abort ();
140 140
141 for (i = 0; i < 256; i++) 141 for (i = 0; i < 256; i++)
142 widthtab->contents[i] = character_width (i, disptab); 142 XSETFASTINT (widthtab->contents[i], character_width (i, disptab));
143} 143}
144 144
145/* Allocate or free the width run cache, as requested by the current 145/* Allocate or free the width run cache, as requested by the current
@@ -163,8 +163,6 @@ width_run_cache_on_off ()
163 if (current_buffer->width_run_cache == 0) 163 if (current_buffer->width_run_cache == 0)
164 { 164 {
165 current_buffer->width_run_cache = new_region_cache (); 165 current_buffer->width_run_cache = new_region_cache ();
166 current_buffer->width_table = Fmake_vector (make_number (256),
167 make_number (0));
168 recompute_width_table (current_buffer, buffer_display_table ()); 166 recompute_width_table (current_buffer, buffer_display_table ());
169 } 167 }
170 } 168 }