Mercurial > hg > xemacs-beta
comparison src/gutter.c @ 444:576fb035e263 r21-2-37
Import from CVS: tag r21-2-37
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:36:19 +0200 |
parents | abe6d1db359e |
children | 1ccc32a20af4 |
comparison
equal
deleted
inserted
replaced
443:a8296e22da4e | 444:576fb035e263 |
---|---|
247 } | 247 } |
248 | 248 |
249 return Fconcat (nargs, args); | 249 return Fconcat (nargs, args); |
250 } | 250 } |
251 | 251 |
252 /* Sizing gutters is a pain so we try and help the user by determining | |
253 what height will accommodate all lines. This is useless on left and | |
254 right gutters as we always have a maximal number of lines. */ | |
255 static int | |
256 calculate_gutter_size_from_display_lines (enum gutter_pos pos, | |
257 display_line_dynarr* ddla) | |
258 { | |
259 int size = 0; | |
260 struct display_line *dl; | |
261 | |
262 /* For top and bottom the calculation is easy. */ | |
263 if (pos == TOP_GUTTER || pos == BOTTOM_GUTTER) | |
264 { | |
265 /* grab coordinates of last line */ | |
266 if (Dynarr_length (ddla)) | |
267 { | |
268 dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); | |
269 size = (dl->ypos + dl->descent - dl->clip) | |
270 - (Dynarr_atp (ddla, 0)->ypos - Dynarr_atp (ddla, 0)->ascent); | |
271 } | |
272 } | |
273 /* For left and right we have to do some maths. */ | |
274 else | |
275 { | |
276 int start_pos = 0, end_pos = 0, line; | |
277 for (line = 0; line < Dynarr_length (ddla); line++) | |
278 { | |
279 int block; | |
280 dl = Dynarr_atp (ddla, line); | |
281 | |
282 for (block = 0; block < Dynarr_largest (dl->display_blocks); block++) | |
283 { | |
284 struct display_block *db = Dynarr_atp (dl->display_blocks, block); | |
285 | |
286 if (db->type == TEXT) | |
287 { | |
288 start_pos = min (db->start_pos, start_pos); | |
289 end_pos = max (db->end_pos, end_pos); | |
290 } | |
291 } | |
292 } | |
293 size = end_pos - start_pos; | |
294 } | |
295 | |
296 return size; | |
297 } | |
298 | |
299 static Lisp_Object | |
300 calculate_gutter_size (struct window *w, enum gutter_pos pos) | |
301 { | |
302 struct frame* f = XFRAME (WINDOW_FRAME (w)); | |
303 int count; | |
304 display_line_dynarr* ddla; | |
305 Lisp_Object ret = Qnil; | |
306 | |
307 /* degenerate case */ | |
308 if (NILP (RAW_WINDOW_GUTTER (w, pos)) | |
309 || | |
310 !FRAME_VISIBLE_P (f) | |
311 || | |
312 NILP (w->buffer)) | |
313 return Qnil; | |
314 | |
315 /* Redisplay code that we use relies on GC not happening. Make it | |
316 so. */ | |
317 count = specpdl_depth (); | |
318 record_unwind_protect (restore_gc_inhibit, | |
319 make_int (gc_currently_forbidden)); | |
320 gc_currently_forbidden = 1; | |
321 | |
322 ddla = Dynarr_new (display_line); | |
323 /* generate some display lines */ | |
324 generate_displayable_area (w, WINDOW_GUTTER (w, pos), | |
325 FRAME_LEFT_BORDER_END (f), | |
326 FRAME_TOP_BORDER_END (f), | |
327 FRAME_RIGHT_BORDER_START (f) | |
328 - FRAME_LEFT_BORDER_END (f), | |
329 FRAME_BOTTOM_BORDER_START (f) | |
330 - FRAME_TOP_BORDER_END (f), | |
331 ddla, 0, 0); | |
332 | |
333 /* Let GC happen again. */ | |
334 unbind_to (count, Qnil); | |
335 | |
336 ret = make_int (calculate_gutter_size_from_display_lines (pos, ddla)); | |
337 free_display_lines (ddla); | |
338 | |
339 return ret; | |
340 } | |
341 | |
252 static void | 342 static void |
253 output_gutter (struct frame *f, enum gutter_pos pos, int force) | 343 output_gutter (struct frame *f, enum gutter_pos pos, int force) |
254 { | 344 { |
255 Lisp_Object frame; | 345 Lisp_Object frame; |
256 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); | 346 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); |
337 width - 2 * border_width, height - (ypos - y) - border_width); | 427 width - 2 * border_width, height - (ypos - y) - border_width); |
338 /* If, for some reason, we have more to display than we have | 428 /* If, for some reason, we have more to display than we have |
339 room for, and we are allowed to resize the gutter, then make | 429 room for, and we are allowed to resize the gutter, then make |
340 sure this happens before the next time we try and | 430 sure this happens before the next time we try and |
341 output. This can happen when face font sizes change. */ | 431 output. This can happen when face font sizes change. */ |
342 if (dl && dl->clip > 0 && EQ (w->gutter_size[pos], Qautodetect)) | 432 if (dl && EQ (w->gutter_size[pos], Qautodetect) |
433 && (dl->clip > 0 || | |
434 calculate_gutter_size_from_display_lines (pos, ddla) > | |
435 WINDOW_GUTTER_SIZE_INTERNAL (w, pos))) | |
343 { | 436 { |
344 /* #### Ideally we would just mark the specifier as dirty | 437 /* #### Ideally we would just mark the specifier as dirty |
345 and everything else would "just work". Unfortunately we have | 438 and everything else would "just work". Unfortunately we have |
346 two problems with this. One is that the specifier cache | 439 two problems with this. One is that the specifier cache |
347 won't be recalculated unless the specifier code thinks the | 440 won't be recalculated unless the specifier code thinks the |
374 sync_display_line_structs (w, line, 1, cdla, ddla); | 467 sync_display_line_structs (w, line, 1, cdla, ddla); |
375 } | 468 } |
376 } | 469 } |
377 | 470 |
378 w->gutter_extent_modiff [pos] = 0; | 471 w->gutter_extent_modiff [pos] = 0; |
379 } | |
380 | |
381 /* Sizing gutters is a pain so we try and help the user by determining | |
382 what height will accommodate all lines. This is useless on left and | |
383 right gutters as we always have a maximal number of lines. */ | |
384 static Lisp_Object | |
385 calculate_gutter_size (struct window *w, enum gutter_pos pos) | |
386 { | |
387 struct frame* f = XFRAME (WINDOW_FRAME (w)); | |
388 int ypos, count; | |
389 display_line_dynarr* ddla; | |
390 struct display_line *dl; | |
391 | |
392 /* we cannot autodetect gutter sizes for the left and right as there | |
393 is no reasonable metric to use */ | |
394 assert (pos == TOP_GUTTER || pos == BOTTOM_GUTTER); | |
395 /* degenerate case */ | |
396 if (NILP (RAW_WINDOW_GUTTER (w, pos)) | |
397 || | |
398 !FRAME_VISIBLE_P (f) | |
399 || | |
400 NILP (w->buffer)) | |
401 return Qnil; | |
402 | |
403 /* Redisplay code that we use relies on GC not happening. Make it | |
404 so. */ | |
405 count = specpdl_depth (); | |
406 record_unwind_protect (restore_gc_inhibit, | |
407 make_int (gc_currently_forbidden)); | |
408 gc_currently_forbidden = 1; | |
409 | |
410 ddla = Dynarr_new (display_line); | |
411 /* generate some display lines */ | |
412 generate_displayable_area (w, WINDOW_GUTTER (w, pos), | |
413 FRAME_LEFT_BORDER_END (f), | |
414 0, | |
415 FRAME_RIGHT_BORDER_START (f) | |
416 - FRAME_LEFT_BORDER_END (f), | |
417 200, | |
418 ddla, 0, 0); | |
419 | |
420 /* Let GC happen again. */ | |
421 unbind_to (count, Qnil); | |
422 | |
423 /* grab coordinates of last line */ | |
424 if (Dynarr_length (ddla)) | |
425 { | |
426 dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); | |
427 ypos = dl->ypos + dl->descent - dl->clip; | |
428 free_display_lines (ddla); | |
429 return make_int (ypos); | |
430 } | |
431 else | |
432 { | |
433 free_display_lines (ddla); | |
434 return Qnil; | |
435 } | |
436 } | 472 } |
437 | 473 |
438 static void | 474 static void |
439 clear_gutter (struct frame *f, enum gutter_pos pos) | 475 clear_gutter (struct frame *f, enum gutter_pos pos) |
440 { | 476 { |
684 : Vdefault_gutter_width); | 720 : Vdefault_gutter_width); |
685 set_specifier_fallback (Vgutter_border_width[cur], | 721 set_specifier_fallback (Vgutter_border_width[cur], |
686 list1 (Fcons (Qnil, Qzero))); | 722 list1 (Fcons (Qnil, Qzero))); |
687 set_specifier_fallback (Vgutter_border_width[new], | 723 set_specifier_fallback (Vgutter_border_width[new], |
688 Vdefault_gutter_border_width); | 724 Vdefault_gutter_border_width); |
689 /* We don't really want the left and right gutters to default to | 725 set_specifier_fallback (Vgutter_visible_p[cur], list1 (Fcons (Qnil, Qt))); |
690 visible. */ | 726 set_specifier_fallback (Vgutter_visible_p[new], Vdefault_gutter_visible_p); |
691 set_specifier_fallback (Vgutter_visible_p[cur], | |
692 cur == TOP_GUTTER || cur == BOTTOM_GUTTER ? | |
693 list1 (Fcons (Qnil, Qt)) | |
694 : list1 (Fcons (Qnil, Qnil))); | |
695 set_specifier_fallback (Vgutter_visible_p[new], | |
696 Vdefault_gutter_visible_p); | |
697 | 727 |
698 Vdefault_gutter_position = position; | 728 Vdefault_gutter_position = position; |
699 unhold_frame_size_changes (); | 729 unhold_frame_size_changes (); |
700 } | 730 } |
701 | 731 |
1156 automatically knew about specifier fallbacks, so we didn't | 1186 automatically knew about specifier fallbacks, so we didn't |
1157 have to do it ourselves. */ | 1187 have to do it ourselves. */ |
1158 set_specifier_caching (Vdefault_gutter, | 1188 set_specifier_caching (Vdefault_gutter, |
1159 offsetof (struct window, default_gutter), | 1189 offsetof (struct window, default_gutter), |
1160 default_gutter_specs_changed, | 1190 default_gutter_specs_changed, |
1161 0, 0); | 1191 0, 0, 1); |
1162 | 1192 |
1163 DEFVAR_SPECIFIER ("top-gutter", | 1193 DEFVAR_SPECIFIER ("top-gutter", |
1164 &Vgutter[TOP_GUTTER] /* | 1194 &Vgutter[TOP_GUTTER] /* |
1165 Specifier for the gutter at the top of the frame. | 1195 Specifier for the gutter at the top of the frame. |
1166 Use `set-specifier' to change this. | 1196 Use `set-specifier' to change this. |
1168 */ ); | 1198 */ ); |
1169 Vgutter[TOP_GUTTER] = Fmake_specifier (Qgutter); | 1199 Vgutter[TOP_GUTTER] = Fmake_specifier (Qgutter); |
1170 set_specifier_caching (Vgutter[TOP_GUTTER], | 1200 set_specifier_caching (Vgutter[TOP_GUTTER], |
1171 offsetof (struct window, gutter[TOP_GUTTER]), | 1201 offsetof (struct window, gutter[TOP_GUTTER]), |
1172 top_gutter_specs_changed, | 1202 top_gutter_specs_changed, |
1173 0, 0); | 1203 0, 0, 1); |
1174 | 1204 |
1175 DEFVAR_SPECIFIER ("bottom-gutter", | 1205 DEFVAR_SPECIFIER ("bottom-gutter", |
1176 &Vgutter[BOTTOM_GUTTER] /* | 1206 &Vgutter[BOTTOM_GUTTER] /* |
1177 Specifier for the gutter at the bottom of the frame. | 1207 Specifier for the gutter at the bottom of the frame. |
1178 Use `set-specifier' to change this. | 1208 Use `set-specifier' to change this. |
1185 */ ); | 1215 */ ); |
1186 Vgutter[BOTTOM_GUTTER] = Fmake_specifier (Qgutter); | 1216 Vgutter[BOTTOM_GUTTER] = Fmake_specifier (Qgutter); |
1187 set_specifier_caching (Vgutter[BOTTOM_GUTTER], | 1217 set_specifier_caching (Vgutter[BOTTOM_GUTTER], |
1188 offsetof (struct window, gutter[BOTTOM_GUTTER]), | 1218 offsetof (struct window, gutter[BOTTOM_GUTTER]), |
1189 bottom_gutter_specs_changed, | 1219 bottom_gutter_specs_changed, |
1190 0, 0); | 1220 0, 0, 1); |
1191 | 1221 |
1192 DEFVAR_SPECIFIER ("left-gutter", | 1222 DEFVAR_SPECIFIER ("left-gutter", |
1193 &Vgutter[LEFT_GUTTER] /* | 1223 &Vgutter[LEFT_GUTTER] /* |
1194 Specifier for the gutter at the left edge of the frame. | 1224 Specifier for the gutter at the left edge of the frame. |
1195 Use `set-specifier' to change this. | 1225 Use `set-specifier' to change this. |
1202 */ ); | 1232 */ ); |
1203 Vgutter[LEFT_GUTTER] = Fmake_specifier (Qgutter); | 1233 Vgutter[LEFT_GUTTER] = Fmake_specifier (Qgutter); |
1204 set_specifier_caching (Vgutter[LEFT_GUTTER], | 1234 set_specifier_caching (Vgutter[LEFT_GUTTER], |
1205 offsetof (struct window, gutter[LEFT_GUTTER]), | 1235 offsetof (struct window, gutter[LEFT_GUTTER]), |
1206 left_gutter_specs_changed, | 1236 left_gutter_specs_changed, |
1207 0, 0); | 1237 0, 0, 1); |
1208 | 1238 |
1209 DEFVAR_SPECIFIER ("right-gutter", | 1239 DEFVAR_SPECIFIER ("right-gutter", |
1210 &Vgutter[RIGHT_GUTTER] /* | 1240 &Vgutter[RIGHT_GUTTER] /* |
1211 Specifier for the gutter at the right edge of the frame. | 1241 Specifier for the gutter at the right edge of the frame. |
1212 Use `set-specifier' to change this. | 1242 Use `set-specifier' to change this. |
1219 */ ); | 1249 */ ); |
1220 Vgutter[RIGHT_GUTTER] = Fmake_specifier (Qgutter); | 1250 Vgutter[RIGHT_GUTTER] = Fmake_specifier (Qgutter); |
1221 set_specifier_caching (Vgutter[RIGHT_GUTTER], | 1251 set_specifier_caching (Vgutter[RIGHT_GUTTER], |
1222 offsetof (struct window, gutter[RIGHT_GUTTER]), | 1252 offsetof (struct window, gutter[RIGHT_GUTTER]), |
1223 right_gutter_specs_changed, | 1253 right_gutter_specs_changed, |
1224 0, 0); | 1254 0, 0, 1); |
1225 | 1255 |
1226 /* initially, top inherits from default; this can be | 1256 /* initially, top inherits from default; this can be |
1227 changed with `set-default-gutter-position'. */ | 1257 changed with `set-default-gutter-position'. */ |
1228 fb = list1 (Fcons (Qnil, Qnil)); | 1258 fb = list1 (Fcons (Qnil, Qnil)); |
1229 set_specifier_fallback (Vdefault_gutter, fb); | 1259 set_specifier_fallback (Vdefault_gutter, fb); |
1259 */ ); | 1289 */ ); |
1260 Vdefault_gutter_height = Fmake_specifier (Qgutter_size); | 1290 Vdefault_gutter_height = Fmake_specifier (Qgutter_size); |
1261 set_specifier_caching (Vdefault_gutter_height, | 1291 set_specifier_caching (Vdefault_gutter_height, |
1262 offsetof (struct window, default_gutter_height), | 1292 offsetof (struct window, default_gutter_height), |
1263 default_gutter_size_changed_in_window, | 1293 default_gutter_size_changed_in_window, |
1264 0, 0); | 1294 0, 0, 1); |
1265 | 1295 |
1266 DEFVAR_SPECIFIER ("default-gutter-width", &Vdefault_gutter_width /* | 1296 DEFVAR_SPECIFIER ("default-gutter-width", &Vdefault_gutter_width /* |
1267 *Width of the default gutter, if it's oriented vertically. | 1297 *Width of the default gutter, if it's oriented vertically. |
1268 This is a specifier; use `set-specifier' to change it. | 1298 This is a specifier; use `set-specifier' to change it. |
1269 | 1299 |
1270 See `default-gutter-height' for more information. | 1300 See `default-gutter-height' for more information. |
1271 */ ); | 1301 */ ); |
1272 Vdefault_gutter_width = Fmake_specifier (Qnatnum); | 1302 Vdefault_gutter_width = Fmake_specifier (Qgutter_size); |
1273 set_specifier_caching (Vdefault_gutter_width, | 1303 set_specifier_caching (Vdefault_gutter_width, |
1274 offsetof (struct window, default_gutter_width), | 1304 offsetof (struct window, default_gutter_width), |
1275 default_gutter_size_changed_in_window, | 1305 default_gutter_size_changed_in_window, |
1276 0, 0); | 1306 0, 0, 1); |
1277 | 1307 |
1278 DEFVAR_SPECIFIER ("top-gutter-height", | 1308 DEFVAR_SPECIFIER ("top-gutter-height", |
1279 &Vgutter_size[TOP_GUTTER] /* | 1309 &Vgutter_size[TOP_GUTTER] /* |
1280 *Height of the top gutter. | 1310 *Height of the top gutter. |
1281 This is a specifier; use `set-specifier' to change it. | 1311 This is a specifier; use `set-specifier' to change it. |
1283 See `default-gutter-height' for more information. | 1313 See `default-gutter-height' for more information. |
1284 */ ); | 1314 */ ); |
1285 Vgutter_size[TOP_GUTTER] = Fmake_specifier (Qgutter_size); | 1315 Vgutter_size[TOP_GUTTER] = Fmake_specifier (Qgutter_size); |
1286 set_specifier_caching (Vgutter_size[TOP_GUTTER], | 1316 set_specifier_caching (Vgutter_size[TOP_GUTTER], |
1287 offsetof (struct window, gutter_size[TOP_GUTTER]), | 1317 offsetof (struct window, gutter_size[TOP_GUTTER]), |
1288 gutter_geometry_changed_in_window, 0, 0); | 1318 gutter_geometry_changed_in_window, 0, 0, 1); |
1289 | 1319 |
1290 DEFVAR_SPECIFIER ("bottom-gutter-height", | 1320 DEFVAR_SPECIFIER ("bottom-gutter-height", |
1291 &Vgutter_size[BOTTOM_GUTTER] /* | 1321 &Vgutter_size[BOTTOM_GUTTER] /* |
1292 *Height of the bottom gutter. | 1322 *Height of the bottom gutter. |
1293 This is a specifier; use `set-specifier' to change it. | 1323 This is a specifier; use `set-specifier' to change it. |
1295 See `default-gutter-height' for more information. | 1325 See `default-gutter-height' for more information. |
1296 */ ); | 1326 */ ); |
1297 Vgutter_size[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_size); | 1327 Vgutter_size[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_size); |
1298 set_specifier_caching (Vgutter_size[BOTTOM_GUTTER], | 1328 set_specifier_caching (Vgutter_size[BOTTOM_GUTTER], |
1299 offsetof (struct window, gutter_size[BOTTOM_GUTTER]), | 1329 offsetof (struct window, gutter_size[BOTTOM_GUTTER]), |
1300 gutter_geometry_changed_in_window, 0, 0); | 1330 gutter_geometry_changed_in_window, 0, 0, 1); |
1301 | 1331 |
1302 DEFVAR_SPECIFIER ("left-gutter-width", | 1332 DEFVAR_SPECIFIER ("left-gutter-width", |
1303 &Vgutter_size[LEFT_GUTTER] /* | 1333 &Vgutter_size[LEFT_GUTTER] /* |
1304 *Width of left gutter. | 1334 *Width of left gutter. |
1305 This is a specifier; use `set-specifier' to change it. | 1335 This is a specifier; use `set-specifier' to change it. |
1306 | 1336 |
1307 See `default-gutter-height' for more information. | 1337 See `default-gutter-height' for more information. |
1308 */ ); | 1338 */ ); |
1309 Vgutter_size[LEFT_GUTTER] = Fmake_specifier (Qnatnum); | 1339 Vgutter_size[LEFT_GUTTER] = Fmake_specifier (Qgutter_size); |
1310 set_specifier_caching (Vgutter_size[LEFT_GUTTER], | 1340 set_specifier_caching (Vgutter_size[LEFT_GUTTER], |
1311 offsetof (struct window, gutter_size[LEFT_GUTTER]), | 1341 offsetof (struct window, gutter_size[LEFT_GUTTER]), |
1312 gutter_geometry_changed_in_window, 0, 0); | 1342 gutter_geometry_changed_in_window, 0, 0, 1); |
1313 | 1343 |
1314 DEFVAR_SPECIFIER ("right-gutter-width", | 1344 DEFVAR_SPECIFIER ("right-gutter-width", |
1315 &Vgutter_size[RIGHT_GUTTER] /* | 1345 &Vgutter_size[RIGHT_GUTTER] /* |
1316 *Width of right gutter. | 1346 *Width of right gutter. |
1317 This is a specifier; use `set-specifier' to change it. | 1347 This is a specifier; use `set-specifier' to change it. |
1318 | 1348 |
1319 See `default-gutter-height' for more information. | 1349 See `default-gutter-height' for more information. |
1320 */ ); | 1350 */ ); |
1321 Vgutter_size[RIGHT_GUTTER] = Fmake_specifier (Qnatnum); | 1351 Vgutter_size[RIGHT_GUTTER] = Fmake_specifier (Qgutter_size); |
1322 set_specifier_caching (Vgutter_size[RIGHT_GUTTER], | 1352 set_specifier_caching (Vgutter_size[RIGHT_GUTTER], |
1323 offsetof (struct window, gutter_size[RIGHT_GUTTER]), | 1353 offsetof (struct window, gutter_size[RIGHT_GUTTER]), |
1324 gutter_geometry_changed_in_window, 0, 0); | 1354 gutter_geometry_changed_in_window, 0, 0, 1); |
1325 | 1355 |
1326 fb = Qnil; | 1356 fb = Qnil; |
1327 #ifdef HAVE_TTY | 1357 #ifdef HAVE_TTY |
1328 fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb); | 1358 fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb); |
1329 #endif | 1359 #endif |
1337 if (!NILP (fb)) | 1367 if (!NILP (fb)) |
1338 set_specifier_fallback (Vdefault_gutter_height, fb); | 1368 set_specifier_fallback (Vdefault_gutter_height, fb); |
1339 | 1369 |
1340 fb = Qnil; | 1370 fb = Qnil; |
1341 #ifdef HAVE_TTY | 1371 #ifdef HAVE_TTY |
1342 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); | 1372 fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb); |
1343 #endif | 1373 #endif |
1344 #ifdef HAVE_X_WINDOWS | 1374 #ifdef HAVE_X_WINDOWS |
1345 fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_GUTTER_WIDTH)), fb); | 1375 fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb); |
1346 #endif | 1376 #endif |
1347 #ifdef HAVE_MS_WINDOWS | 1377 #ifdef HAVE_MS_WINDOWS |
1348 fb = Fcons (Fcons (list1 (Qmsprinter), Qzero), fb); | 1378 fb = Fcons (Fcons (list1 (Qmsprinter), Qautodetect), fb); |
1349 fb = Fcons (Fcons (list1 (Qmswindows), | 1379 fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb); |
1350 make_int (DEFAULT_GUTTER_WIDTH)), fb); | |
1351 #endif | 1380 #endif |
1352 if (!NILP (fb)) | 1381 if (!NILP (fb)) |
1353 set_specifier_fallback (Vdefault_gutter_width, fb); | 1382 set_specifier_fallback (Vdefault_gutter_width, fb); |
1354 | 1383 |
1355 set_specifier_fallback (Vgutter_size[TOP_GUTTER], Vdefault_gutter_height); | 1384 set_specifier_fallback (Vgutter_size[TOP_GUTTER], Vdefault_gutter_height); |
1374 */ ); | 1403 */ ); |
1375 Vdefault_gutter_border_width = Fmake_specifier (Qnatnum); | 1404 Vdefault_gutter_border_width = Fmake_specifier (Qnatnum); |
1376 set_specifier_caching (Vdefault_gutter_border_width, | 1405 set_specifier_caching (Vdefault_gutter_border_width, |
1377 offsetof (struct window, default_gutter_border_width), | 1406 offsetof (struct window, default_gutter_border_width), |
1378 default_gutter_border_width_changed_in_window, | 1407 default_gutter_border_width_changed_in_window, |
1379 0, 0); | 1408 0, 0, 0); |
1380 | 1409 |
1381 DEFVAR_SPECIFIER ("top-gutter-border-width", | 1410 DEFVAR_SPECIFIER ("top-gutter-border-width", |
1382 &Vgutter_border_width[TOP_GUTTER] /* | 1411 &Vgutter_border_width[TOP_GUTTER] /* |
1383 *Border width of the top gutter. | 1412 *Border width of the top gutter. |
1384 This is a specifier; use `set-specifier' to change it. | 1413 This is a specifier; use `set-specifier' to change it. |
1387 */ ); | 1416 */ ); |
1388 Vgutter_border_width[TOP_GUTTER] = Fmake_specifier (Qnatnum); | 1417 Vgutter_border_width[TOP_GUTTER] = Fmake_specifier (Qnatnum); |
1389 set_specifier_caching (Vgutter_border_width[TOP_GUTTER], | 1418 set_specifier_caching (Vgutter_border_width[TOP_GUTTER], |
1390 offsetof (struct window, | 1419 offsetof (struct window, |
1391 gutter_border_width[TOP_GUTTER]), | 1420 gutter_border_width[TOP_GUTTER]), |
1392 gutter_geometry_changed_in_window, 0, 0); | 1421 gutter_geometry_changed_in_window, 0, 0, 0); |
1393 | 1422 |
1394 DEFVAR_SPECIFIER ("bottom-gutter-border-width", | 1423 DEFVAR_SPECIFIER ("bottom-gutter-border-width", |
1395 &Vgutter_border_width[BOTTOM_GUTTER] /* | 1424 &Vgutter_border_width[BOTTOM_GUTTER] /* |
1396 *Border width of the bottom gutter. | 1425 *Border width of the bottom gutter. |
1397 This is a specifier; use `set-specifier' to change it. | 1426 This is a specifier; use `set-specifier' to change it. |
1400 */ ); | 1429 */ ); |
1401 Vgutter_border_width[BOTTOM_GUTTER] = Fmake_specifier (Qnatnum); | 1430 Vgutter_border_width[BOTTOM_GUTTER] = Fmake_specifier (Qnatnum); |
1402 set_specifier_caching (Vgutter_border_width[BOTTOM_GUTTER], | 1431 set_specifier_caching (Vgutter_border_width[BOTTOM_GUTTER], |
1403 offsetof (struct window, | 1432 offsetof (struct window, |
1404 gutter_border_width[BOTTOM_GUTTER]), | 1433 gutter_border_width[BOTTOM_GUTTER]), |
1405 gutter_geometry_changed_in_window, 0, 0); | 1434 gutter_geometry_changed_in_window, 0, 0, 0); |
1406 | 1435 |
1407 DEFVAR_SPECIFIER ("left-gutter-border-width", | 1436 DEFVAR_SPECIFIER ("left-gutter-border-width", |
1408 &Vgutter_border_width[LEFT_GUTTER] /* | 1437 &Vgutter_border_width[LEFT_GUTTER] /* |
1409 *Border width of left gutter. | 1438 *Border width of left gutter. |
1410 This is a specifier; use `set-specifier' to change it. | 1439 This is a specifier; use `set-specifier' to change it. |
1413 */ ); | 1442 */ ); |
1414 Vgutter_border_width[LEFT_GUTTER] = Fmake_specifier (Qnatnum); | 1443 Vgutter_border_width[LEFT_GUTTER] = Fmake_specifier (Qnatnum); |
1415 set_specifier_caching (Vgutter_border_width[LEFT_GUTTER], | 1444 set_specifier_caching (Vgutter_border_width[LEFT_GUTTER], |
1416 offsetof (struct window, | 1445 offsetof (struct window, |
1417 gutter_border_width[LEFT_GUTTER]), | 1446 gutter_border_width[LEFT_GUTTER]), |
1418 gutter_geometry_changed_in_window, 0, 0); | 1447 gutter_geometry_changed_in_window, 0, 0, 0); |
1419 | 1448 |
1420 DEFVAR_SPECIFIER ("right-gutter-border-width", | 1449 DEFVAR_SPECIFIER ("right-gutter-border-width", |
1421 &Vgutter_border_width[RIGHT_GUTTER] /* | 1450 &Vgutter_border_width[RIGHT_GUTTER] /* |
1422 *Border width of right gutter. | 1451 *Border width of right gutter. |
1423 This is a specifier; use `set-specifier' to change it. | 1452 This is a specifier; use `set-specifier' to change it. |
1426 */ ); | 1455 */ ); |
1427 Vgutter_border_width[RIGHT_GUTTER] = Fmake_specifier (Qnatnum); | 1456 Vgutter_border_width[RIGHT_GUTTER] = Fmake_specifier (Qnatnum); |
1428 set_specifier_caching (Vgutter_border_width[RIGHT_GUTTER], | 1457 set_specifier_caching (Vgutter_border_width[RIGHT_GUTTER], |
1429 offsetof (struct window, | 1458 offsetof (struct window, |
1430 gutter_border_width[RIGHT_GUTTER]), | 1459 gutter_border_width[RIGHT_GUTTER]), |
1431 gutter_geometry_changed_in_window, 0, 0); | 1460 gutter_geometry_changed_in_window, 0, 0, 0); |
1432 | 1461 |
1433 fb = Qnil; | 1462 fb = Qnil; |
1434 #ifdef HAVE_TTY | 1463 #ifdef HAVE_TTY |
1435 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); | 1464 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); |
1436 #endif | 1465 #endif |
1468 Vdefault_gutter_visible_p = Fmake_specifier (Qgutter_visible); | 1497 Vdefault_gutter_visible_p = Fmake_specifier (Qgutter_visible); |
1469 set_specifier_caching (Vdefault_gutter_visible_p, | 1498 set_specifier_caching (Vdefault_gutter_visible_p, |
1470 offsetof (struct window, | 1499 offsetof (struct window, |
1471 default_gutter_visible_p), | 1500 default_gutter_visible_p), |
1472 default_gutter_visible_p_changed_in_window, | 1501 default_gutter_visible_p_changed_in_window, |
1473 0, 0); | 1502 0, 0, 0); |
1474 | 1503 |
1475 DEFVAR_SPECIFIER ("top-gutter-visible-p", | 1504 DEFVAR_SPECIFIER ("top-gutter-visible-p", |
1476 &Vgutter_visible_p[TOP_GUTTER] /* | 1505 &Vgutter_visible_p[TOP_GUTTER] /* |
1477 *Whether the top gutter is visible. | 1506 *Whether the top gutter is visible. |
1478 This is a specifier; use `set-specifier' to change it. | 1507 This is a specifier; use `set-specifier' to change it. |
1481 */ ); | 1510 */ ); |
1482 Vgutter_visible_p[TOP_GUTTER] = Fmake_specifier (Qgutter_visible); | 1511 Vgutter_visible_p[TOP_GUTTER] = Fmake_specifier (Qgutter_visible); |
1483 set_specifier_caching (Vgutter_visible_p[TOP_GUTTER], | 1512 set_specifier_caching (Vgutter_visible_p[TOP_GUTTER], |
1484 offsetof (struct window, | 1513 offsetof (struct window, |
1485 gutter_visible_p[TOP_GUTTER]), | 1514 gutter_visible_p[TOP_GUTTER]), |
1486 top_gutter_specs_changed, 0, 0); | 1515 top_gutter_specs_changed, 0, 0, 0); |
1487 | 1516 |
1488 DEFVAR_SPECIFIER ("bottom-gutter-visible-p", | 1517 DEFVAR_SPECIFIER ("bottom-gutter-visible-p", |
1489 &Vgutter_visible_p[BOTTOM_GUTTER] /* | 1518 &Vgutter_visible_p[BOTTOM_GUTTER] /* |
1490 *Whether the bottom gutter is visible. | 1519 *Whether the bottom gutter is visible. |
1491 This is a specifier; use `set-specifier' to change it. | 1520 This is a specifier; use `set-specifier' to change it. |
1494 */ ); | 1523 */ ); |
1495 Vgutter_visible_p[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_visible); | 1524 Vgutter_visible_p[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_visible); |
1496 set_specifier_caching (Vgutter_visible_p[BOTTOM_GUTTER], | 1525 set_specifier_caching (Vgutter_visible_p[BOTTOM_GUTTER], |
1497 offsetof (struct window, | 1526 offsetof (struct window, |
1498 gutter_visible_p[BOTTOM_GUTTER]), | 1527 gutter_visible_p[BOTTOM_GUTTER]), |
1499 bottom_gutter_specs_changed, 0, 0); | 1528 bottom_gutter_specs_changed, 0, 0, 0); |
1500 | 1529 |
1501 DEFVAR_SPECIFIER ("left-gutter-visible-p", | 1530 DEFVAR_SPECIFIER ("left-gutter-visible-p", |
1502 &Vgutter_visible_p[LEFT_GUTTER] /* | 1531 &Vgutter_visible_p[LEFT_GUTTER] /* |
1503 *Whether the left gutter is visible. | 1532 *Whether the left gutter is visible. |
1504 This is a specifier; use `set-specifier' to change it. | 1533 This is a specifier; use `set-specifier' to change it. |
1507 */ ); | 1536 */ ); |
1508 Vgutter_visible_p[LEFT_GUTTER] = Fmake_specifier (Qgutter_visible); | 1537 Vgutter_visible_p[LEFT_GUTTER] = Fmake_specifier (Qgutter_visible); |
1509 set_specifier_caching (Vgutter_visible_p[LEFT_GUTTER], | 1538 set_specifier_caching (Vgutter_visible_p[LEFT_GUTTER], |
1510 offsetof (struct window, | 1539 offsetof (struct window, |
1511 gutter_visible_p[LEFT_GUTTER]), | 1540 gutter_visible_p[LEFT_GUTTER]), |
1512 left_gutter_specs_changed, 0, 0); | 1541 left_gutter_specs_changed, 0, 0, 0); |
1513 | 1542 |
1514 DEFVAR_SPECIFIER ("right-gutter-visible-p", | 1543 DEFVAR_SPECIFIER ("right-gutter-visible-p", |
1515 &Vgutter_visible_p[RIGHT_GUTTER] /* | 1544 &Vgutter_visible_p[RIGHT_GUTTER] /* |
1516 *Whether the right gutter is visible. | 1545 *Whether the right gutter is visible. |
1517 This is a specifier; use `set-specifier' to change it. | 1546 This is a specifier; use `set-specifier' to change it. |
1520 */ ); | 1549 */ ); |
1521 Vgutter_visible_p[RIGHT_GUTTER] = Fmake_specifier (Qgutter_visible); | 1550 Vgutter_visible_p[RIGHT_GUTTER] = Fmake_specifier (Qgutter_visible); |
1522 set_specifier_caching (Vgutter_visible_p[RIGHT_GUTTER], | 1551 set_specifier_caching (Vgutter_visible_p[RIGHT_GUTTER], |
1523 offsetof (struct window, | 1552 offsetof (struct window, |
1524 gutter_visible_p[RIGHT_GUTTER]), | 1553 gutter_visible_p[RIGHT_GUTTER]), |
1525 right_gutter_specs_changed, 0, 0); | 1554 right_gutter_specs_changed, 0, 0, 0); |
1526 | 1555 |
1527 /* initially, top inherits from default; this can be | 1556 /* initially, top inherits from default; this can be |
1528 changed with `set-default-gutter-position'. */ | 1557 changed with `set-default-gutter-position'. */ |
1529 fb = list1 (Fcons (Qnil, Qt)); | 1558 fb = list1 (Fcons (Qnil, Qt)); |
1530 set_specifier_fallback (Vdefault_gutter_visible_p, fb); | 1559 set_specifier_fallback (Vdefault_gutter_visible_p, fb); |