comparison src/gutter.c @ 5495:1f0b15040456

Merge.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 01 May 2011 18:44:03 +0100
parents 308d34e9f07d
children 56144c8593a8
comparison
equal deleted inserted replaced
5494:861f2601a38b 5495:1f0b15040456
1 /* Gutter implementation. 1 /* Gutter implementation.
2 Copyright (C) 1999, 2000 Andy Piper. 2 Copyright (C) 1999, 2000 Andy Piper.
3 Copyright (C) 2010 Ben Wing.
3 4
4 This file is part of XEmacs. 5 This file is part of XEmacs.
5 6
6 XEmacs is free software; you can redistribute it and/or modify it 7 XEmacs is free software: you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any 9 Free Software Foundation, either version 3 of the License, or (at your
9 later version. 10 option) any later version.
10 11
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT 12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details. 15 for more details.
15 16
16 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
17 along with XEmacs; see the file COPYING. If not, write to 18 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20 19
21 /* Synched up with: Not in FSF. */ 20 /* Synched up with: Not in FSF. */
22 21
23 /* written by Andy Piper <andy@xemacs.org> with specifiers partially 22 /* written by Andy Piper <andy@xemacs.org> with specifiers partially
24 ripped-off from toolbar.c */ 23 ripped-off from toolbar.c */
33 #include "glyphs.h" 32 #include "glyphs.h"
34 #include "redisplay.h" 33 #include "redisplay.h"
35 #include "window.h" 34 #include "window.h"
36 #include "gutter.h" 35 #include "gutter.h"
37 36
38 Lisp_Object Vgutter[4]; 37 Lisp_Object Vgutter[NUM_EDGES];
39 Lisp_Object Vgutter_size[4]; 38 Lisp_Object Vgutter_size[NUM_EDGES];
40 Lisp_Object Vgutter_visible_p[4]; 39 Lisp_Object Vgutter_visible_p[NUM_EDGES];
41 Lisp_Object Vgutter_border_width[4]; 40 Lisp_Object Vgutter_border_width[NUM_EDGES];
42 41
43 Lisp_Object Vdefault_gutter, Vdefault_gutter_visible_p; 42 Lisp_Object Vdefault_gutter, Vdefault_gutter_visible_p;
44 Lisp_Object Vdefault_gutter_width, Vdefault_gutter_height; 43 Lisp_Object Vdefault_gutter_width, Vdefault_gutter_height;
45 Lisp_Object Vdefault_gutter_border_width; 44 Lisp_Object Vdefault_gutter_border_width;
46 45
49 Lisp_Object Qgutter_size; 48 Lisp_Object Qgutter_size;
50 Lisp_Object Qgutter_visible; 49 Lisp_Object Qgutter_visible;
51 Lisp_Object Qdefault_gutter_position_changed_hook; 50 Lisp_Object Qdefault_gutter_position_changed_hook;
52 51
53 static void 52 static void
54 update_gutter_geometry (struct frame *f, enum gutter_pos pos); 53 update_gutter_geometry (struct frame *f, enum edge_pos pos);
55
56 #define SET_GUTTER_WAS_VISIBLE_FLAG(frame, pos, flag) \
57 do { \
58 switch (pos) \
59 { \
60 case TOP_GUTTER: \
61 (frame)->top_gutter_was_visible = flag; \
62 break; \
63 case BOTTOM_GUTTER: \
64 (frame)->bottom_gutter_was_visible = flag; \
65 break; \
66 case LEFT_GUTTER: \
67 (frame)->left_gutter_was_visible = flag; \
68 break; \
69 case RIGHT_GUTTER: \
70 (frame)->right_gutter_was_visible = flag; \
71 break; \
72 default: \
73 ABORT (); \
74 } \
75 } while (0)
76
77 static int gutter_was_visible (struct frame* frame, enum gutter_pos pos)
78 {
79 switch (pos)
80 {
81 case TOP_GUTTER:
82 return frame->top_gutter_was_visible;
83 case BOTTOM_GUTTER:
84 return frame->bottom_gutter_was_visible;
85 case LEFT_GUTTER:
86 return frame->left_gutter_was_visible;
87 case RIGHT_GUTTER:
88 return frame->right_gutter_was_visible;
89 default:
90 ABORT ();
91 return 0; /* To keep the compiler happy */
92 }
93 }
94 54
95 #if 0 55 #if 0
96 static Lisp_Object 56 static Lisp_Object
97 frame_topmost_window (struct frame *f) 57 frame_topmost_window (struct frame *f)
98 { 58 {
169 us the actual height, width and contents of the gutter, but if we 129 us the actual height, width and contents of the gutter, but if we
170 use this for calculating the gutter positions we run into trouble 130 use this for calculating the gutter positions we run into trouble
171 if it is not the window nearest the gutter. Instead we predetermine 131 if it is not the window nearest the gutter. Instead we predetermine
172 the nearest window and then use that.*/ 132 the nearest window and then use that.*/
173 static void 133 static void
174 get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y, 134 get_gutter_coords (struct frame *f, enum edge_pos pos, int *x, int *y,
175 int *width, int *height) 135 int *width, int *height)
176 { 136 {
177 struct window 137 /* We use the bottommost window (not the minibuffer, but the bottommost
178 * bot = XWINDOW (frame_bottommost_window (f)); 138 non-minibuffer window) rather than any FRAME_BOTTOM_GUTTER_START
139 because the gutter goes *above* the minibuffer -- for this same reason,
140 FRAME_BOTTOM_GUTTER_START isn't currently defined. */
141 struct window *bot = XWINDOW (frame_bottommost_window (f));
179 /* The top and bottom gutters take precedence over the left and 142 /* The top and bottom gutters take precedence over the left and
180 right. */ 143 right. */
181 switch (pos) 144 switch (pos)
182 { 145 {
183 case TOP_GUTTER: 146 case TOP_EDGE:
184 *x = FRAME_LEFT_BORDER_END (f); 147 *x = FRAME_LEFT_GUTTER_START (f);
185 *y = FRAME_TOP_BORDER_END (f); 148 *y = FRAME_TOP_GUTTER_START (f);
186 *width = FRAME_RIGHT_BORDER_START (f) 149 *width = FRAME_RIGHT_GUTTER_END (f) - *x;
187 - FRAME_LEFT_BORDER_END (f);
188 *height = FRAME_TOP_GUTTER_BOUNDS (f); 150 *height = FRAME_TOP_GUTTER_BOUNDS (f);
189 break; 151 break;
190 152
191 case BOTTOM_GUTTER: 153 case BOTTOM_EDGE:
192 *x = FRAME_LEFT_BORDER_END (f); 154 *x = FRAME_LEFT_GUTTER_START (f);
155 #ifdef BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER
156 *y = FRAME_BOTTOM_GUTTER_START (f);
157 #else
193 *y = WINDOW_BOTTOM (bot); 158 *y = WINDOW_BOTTOM (bot);
194 *width = FRAME_RIGHT_BORDER_START (f) 159 #endif
195 - FRAME_LEFT_BORDER_END (f); 160 *width = FRAME_RIGHT_GUTTER_END (f) - *x;
196 *height = FRAME_BOTTOM_GUTTER_BOUNDS (f); 161 *height = FRAME_BOTTOM_GUTTER_BOUNDS (f);
197 break; 162 break;
198 163
199 case LEFT_GUTTER: 164 case LEFT_EDGE:
200 *x = FRAME_LEFT_BORDER_END (f); 165 *x = FRAME_LEFT_GUTTER_START (f);
201 *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); 166 *y = FRAME_TOP_GUTTER_END (f);
202 *width = FRAME_LEFT_GUTTER_BOUNDS (f); 167 *width = FRAME_LEFT_GUTTER_BOUNDS (f);
203 *height = WINDOW_BOTTOM (bot) 168 *height = WINDOW_BOTTOM (bot) - *y;
204 - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f));
205 break; 169 break;
206 170
207 case RIGHT_GUTTER: 171 case RIGHT_EDGE:
208 *x = FRAME_RIGHT_BORDER_START (f) 172 *x = FRAME_RIGHT_GUTTER_START (f);
209 - FRAME_RIGHT_GUTTER_BOUNDS (f); 173 *y = FRAME_TOP_GUTTER_END (f);
210 *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f);
211 *width = FRAME_RIGHT_GUTTER_BOUNDS (f); 174 *width = FRAME_RIGHT_GUTTER_BOUNDS (f);
212 *height = WINDOW_BOTTOM (bot) 175 *height = WINDOW_BOTTOM (bot) - *y;
213 - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f));
214 break; 176 break;
215 177
216 default: 178 default:
217 ABORT (); 179 ABORT ();
218 } 180 }
227 window. 0 means the display_box is in the gutter but the 189 window. 0 means the display_box is in the gutter but the
228 display_glyph_area is not. */ 190 display_glyph_area is not. */
229 int display_boxes_in_gutter_p (struct frame *f, struct display_box* db, 191 int display_boxes_in_gutter_p (struct frame *f, struct display_box* db,
230 struct display_glyph_area* dga) 192 struct display_glyph_area* dga)
231 { 193 {
232 enum gutter_pos pos; 194 enum edge_pos pos;
233 GUTTER_POS_LOOP (pos) 195 EDGE_POS_LOOP (pos)
234 { 196 {
235 if (FRAME_GUTTER_VISIBLE (f, pos)) 197 if (FRAME_GUTTER_VISIBLE (f, pos))
236 { 198 {
237 int x, y, width, height; 199 int x, y, width, height;
238 get_gutter_coords (f, pos, &x, &y, &width, &height); 200 get_gutter_coords (f, pos, &x, &y, &width, &height);
254 } 216 }
255 217
256 /* Convert the gutter specifier into something we can actually 218 /* Convert the gutter specifier into something we can actually
257 display. */ 219 display. */
258 static Lisp_Object construct_window_gutter_spec (struct window* w, 220 static Lisp_Object construct_window_gutter_spec (struct window* w,
259 enum gutter_pos pos) 221 enum edge_pos pos)
260 { 222 {
261 Lisp_Object rest, *args; 223 Lisp_Object rest, *args;
262 int nargs = 0; 224 int nargs = 0;
263 Lisp_Object gutter = RAW_WINDOW_GUTTER (w, pos); 225 Lisp_Object gutter = RAW_WINDOW_GUTTER (w, pos);
264 226
286 248
287 /* Sizing gutters is a pain so we try and help the user by determining 249 /* Sizing gutters is a pain so we try and help the user by determining
288 what height will accommodate all lines. This is useless on left and 250 what height will accommodate all lines. This is useless on left and
289 right gutters as we always have a maximal number of lines. */ 251 right gutters as we always have a maximal number of lines. */
290 static int 252 static int
291 calculate_gutter_size_from_display_lines (enum gutter_pos pos, 253 calculate_gutter_size_from_display_lines (enum edge_pos pos,
292 display_line_dynarr* ddla) 254 display_line_dynarr* ddla)
293 { 255 {
294 int size = 0; 256 int size = 0;
295 struct display_line *dl; 257 struct display_line *dl;
296 258
297 /* For top and bottom the calculation is easy. */ 259 /* For top and bottom the calculation is easy. */
298 if (pos == TOP_GUTTER || pos == BOTTOM_GUTTER) 260 if (pos == TOP_EDGE || pos == BOTTOM_EDGE)
299 { 261 {
300 /* grab coordinates of last line */ 262 /* grab coordinates of last line */
301 if (Dynarr_length (ddla)) 263 if (Dynarr_length (ddla))
302 { 264 {
303 dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1); 265 dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1);
330 292
331 return size; 293 return size;
332 } 294 }
333 295
334 static Lisp_Object 296 static Lisp_Object
335 calculate_gutter_size (struct window *w, enum gutter_pos pos) 297 calculate_gutter_size (struct window *w, enum edge_pos pos)
336 { 298 {
337 struct frame* f = XFRAME (WINDOW_FRAME (w)); 299 struct frame* f = XFRAME (WINDOW_FRAME (w));
338 display_line_dynarr *ddla; 300 display_line_dynarr *ddla;
339 Lisp_Object ret = Qnil; 301 Lisp_Object ret = Qnil;
340 302
357 count = enter_redisplay_critical_section (); 319 count = enter_redisplay_critical_section ();
358 320
359 ddla = Dynarr_new (display_line); 321 ddla = Dynarr_new (display_line);
360 /* generate some display lines */ 322 /* generate some display lines */
361 generate_displayable_area (w, WINDOW_GUTTER (w, pos), 323 generate_displayable_area (w, WINDOW_GUTTER (w, pos),
362 FRAME_LEFT_BORDER_END (f), 324 FRAME_LEFT_GUTTER_START (f),
363 FRAME_TOP_BORDER_END (f), 325 FRAME_TOP_GUTTER_START (f),
364 FRAME_RIGHT_BORDER_START (f) 326 FRAME_RIGHT_GUTTER_END (f)
365 - FRAME_LEFT_BORDER_END (f), 327 - FRAME_LEFT_GUTTER_START (f),
366 FRAME_BOTTOM_BORDER_START (f) 328 #ifdef BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER
367 - FRAME_TOP_BORDER_END (f), 329 FRAME_BOTTOM_GUTTER_END (f)
330 #else
331 /* #### GEOM! This is how it used to read,
332 and this includes both gutter and
333 minibuffer below it. Not clear whether
334 it was intended that way. --ben */
335 FRAME_BOTTOM_INTERNAL_BORDER_START (f)
336 #endif
337 - FRAME_TOP_GUTTER_START (f),
368 ddla, 0, DEFAULT_INDEX); 338 ddla, 0, DEFAULT_INDEX);
369 339
370 /* Let GC happen again. */ 340 /* Let GC happen again. */
371 exit_redisplay_critical_section (count); 341 exit_redisplay_critical_section (count);
372 342
376 346
377 return ret; 347 return ret;
378 } 348 }
379 349
380 static void 350 static void
381 output_gutter (struct frame *f, enum gutter_pos pos, int force) 351 output_gutter (struct frame *f, enum edge_pos pos, int force)
382 { 352 {
383 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); 353 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f);
384 struct device *d = XDEVICE (f->device); 354 struct device *d = XDEVICE (f->device);
385 struct window* w = XWINDOW (window); 355 struct window* w = XWINDOW (window);
386 int x, y, width, height, ypos; 356 int x, y, width, height, ypos;
423 cdla_len != Dynarr_length (ddla) || 393 cdla_len != Dynarr_length (ddla) ||
424 (f->extents_changed && w->gutter_extent_modiff[pos])) 394 (f->extents_changed && w->gutter_extent_modiff[pos]))
425 { 395 {
426 #ifdef DEBUG_GUTTERS 396 #ifdef DEBUG_GUTTERS
427 stderr_out ("gutter redisplay [%s %dx%d@%d+%d] triggered by %s,\n", 397 stderr_out ("gutter redisplay [%s %dx%d@%d+%d] triggered by %s,\n",
428 pos == TOP_GUTTER ? "TOP" : 398 pos == TOP_EDGE ? "TOP" :
429 pos == BOTTOM_GUTTER ? "BOTTOM" : 399 pos == BOTTOM_EDGE ? "BOTTOM" :
430 pos == LEFT_GUTTER ? "LEFT" : "RIGHT", 400 pos == LEFT_EDGE ? "LEFT" : "RIGHT",
431 width, height, x, y, force ? "force" : 401 width, height, x, y, force ? "force" :
432 f->faces_changed ? "f->faces_changed" : 402 f->faces_changed ? "f->faces_changed" :
433 f->frame_changed ? "f->frame_changed" : 403 f->frame_changed ? "f->frame_changed" :
434 f->gutter_changed ? "f->gutter_changed" : 404 f->gutter_changed ? "f->gutter_changed" :
435 f->glyphs_changed ? "f->glyphs_changed" : 405 f->glyphs_changed ? "f->glyphs_changed" :
448 } 418 }
449 419
450 /* If the number of display lines has shrunk, adjust. */ 420 /* If the number of display lines has shrunk, adjust. */
451 if (cdla_len > Dynarr_length (ddla)) 421 if (cdla_len > Dynarr_length (ddla))
452 { 422 {
453 Dynarr_set_length (cdla, Dynarr_length (ddla)); 423 Dynarr_set_lengthr (cdla, Dynarr_length (ddla));
454 } 424 }
455 425
456 /* grab coordinates of last line and blank after it. */ 426 /* grab coordinates of last line and blank after it. */
457 if (Dynarr_length (ddla) > 0) 427 if (Dynarr_length (ddla) > 0)
458 { 428 {
509 479
510 w->gutter_extent_modiff [pos] = 0; 480 w->gutter_extent_modiff [pos] = 0;
511 } 481 }
512 482
513 static void 483 static void
514 clear_gutter (struct frame *f, enum gutter_pos pos) 484 clear_gutter (struct frame *f, enum edge_pos pos)
515 { 485 {
516 int x, y, width, height; 486 int x, y, width, height;
517 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); 487 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f);
518 face_index findex = get_builtin_face_cache_index (XWINDOW (window), 488 face_index findex = get_builtin_face_cache_index (XWINDOW (window),
519 Vwidget_face); 489 Vwidget_face);
520 get_gutter_coords (f, pos, &x, &y, &width, &height); 490 get_gutter_coords (f, pos, &x, &y, &width, &height);
521 491
522 SET_GUTTER_WAS_VISIBLE_FLAG (f, pos, 0); 492 f->gutter_was_visible[pos] = 0;
523 493
524 redisplay_clear_region (window, findex, x, y, width, height); 494 redisplay_clear_region (window, findex, x, y, width, height);
525 } 495 }
526 496
527 /* [[#### I don't currently believe that redisplay needs to mark the 497 /* [[#### I don't currently believe that redisplay needs to mark the
534 /* See the comment in image_instantiate_cache_result as to why marking 504 /* See the comment in image_instantiate_cache_result as to why marking
535 the glyph will also mark the image_instance. */ 505 the glyph will also mark the image_instance. */
536 void 506 void
537 mark_gutters (struct frame *f) 507 mark_gutters (struct frame *f)
538 { 508 {
539 enum gutter_pos pos; 509 enum edge_pos pos;
540 GUTTER_POS_LOOP (pos) 510 EDGE_POS_LOOP (pos)
541 { 511 {
542 if (f->current_display_lines[pos]) 512 if (f->current_display_lines[pos])
543 mark_redisplay_structs (f->current_display_lines[pos]); 513 mark_redisplay_structs (f->current_display_lines[pos]);
544 /* [[#### Do we really need to mark the desired lines?]] 514 /* [[#### Do we really need to mark the desired lines?]]
545 ALWAYS mark everything. --ben */ 515 ALWAYS mark everything. --ben */
561 Lisp_Object frmcons, devcons, concons; 531 Lisp_Object frmcons, devcons, concons;
562 532
563 FRAME_LOOP_NO_BREAK (frmcons, devcons, concons) 533 FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
564 { 534 {
565 struct frame *f = XFRAME (XCAR (frmcons)); 535 struct frame *f = XFRAME (XCAR (frmcons));
566 enum gutter_pos pos; 536 enum edge_pos pos;
567 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f); 537 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f);
568 struct window* w = XWINDOW (window); 538 struct window* w = XWINDOW (window);
569 539
570 GUTTER_POS_LOOP (pos) 540 EDGE_POS_LOOP (pos)
571 { 541 {
572 if (EQ (WINDOW_GUTTER (w, pos), obj)) 542 if (EQ (WINDOW_GUTTER (w, pos), obj))
573 { 543 {
574 w->gutter_extent_modiff[pos]++; 544 w->gutter_extent_modiff[pos]++;
575 } 545 }
578 } 548 }
579 549
580 /* We have to change the gutter geometry separately to the gutter 550 /* We have to change the gutter geometry separately to the gutter
581 update since it needs to occur outside of redisplay proper. */ 551 update since it needs to occur outside of redisplay proper. */
582 static void 552 static void
583 update_gutter_geometry (struct frame *f, enum gutter_pos pos) 553 update_gutter_geometry (struct frame *f, enum edge_pos pos)
584 { 554 {
585 /* If the gutter geometry has changed then re-layout the 555 /* If the gutter geometry has changed then re-layout the
586 frame. If we are in display there is almost no point in doing 556 frame. If we are in display there is almost no point in doing
587 anything else since the frame size changes will be delayed 557 anything else since the frame size changes will be delayed
588 until we are out of redisplay proper. */ 558 until we are out of redisplay proper. */
589 if (FRAME_GUTTER_BOUNDS (f, pos) != f->current_gutter_bounds[pos]) 559 if (FRAME_GUTTER_BOUNDS (f, pos) != f->current_gutter_bounds[pos])
590 { 560 {
591 int width, height; 561 int width, height;
592 pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), 562 pixel_to_frame_unit_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f),
593 &width, &height); 563 &width, &height);
594 change_frame_size (f, height, width, 0); 564 change_frame_size (f, width, height, 0);
595 MARK_FRAME_LAYOUT_CHANGED (f); 565 MARK_FRAME_LAYOUT_CHANGED (f);
596 } 566 }
597 567
598 /* Mark sizes as up-to-date. */ 568 /* Mark sizes as up-to-date. */
599 f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos); 569 f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos);
604 { 574 {
605 if (f->gutter_changed 575 if (f->gutter_changed
606 || f->frame_layout_changed 576 || f->frame_layout_changed
607 || f->windows_structure_changed) 577 || f->windows_structure_changed)
608 { 578 {
609 enum gutter_pos pos; 579 enum edge_pos pos;
610 580
611 /* If the gutter geometry has changed then re-layout the 581 /* If the gutter geometry has changed then re-layout the
612 frame. If we are in display there is almost no point in doing 582 frame. If we are in display there is almost no point in doing
613 anything else since the frame size changes will be delayed 583 anything else since the frame size changes will be delayed
614 until we are out of redisplay proper. */ 584 until we are out of redisplay proper. */
615 GUTTER_POS_LOOP (pos) 585 EDGE_POS_LOOP (pos)
616 { 586 {
617 update_gutter_geometry (f, pos); 587 update_gutter_geometry (f, pos);
618 } 588 }
619 } 589 }
620 } 590 }
626 f->gutter_changed || f->glyphs_changed || 596 f->gutter_changed || f->glyphs_changed ||
627 f->size_changed || f->subwindows_changed || 597 f->size_changed || f->subwindows_changed ||
628 f->windows_changed || f->windows_structure_changed || 598 f->windows_changed || f->windows_structure_changed ||
629 f->extents_changed || f->frame_layout_changed) 599 f->extents_changed || f->frame_layout_changed)
630 { 600 {
631 enum gutter_pos pos; 601 enum edge_pos pos;
632 602
633 /* We don't actually care about these when outputting the gutter 603 /* We don't actually care about these when outputting the gutter
634 so locally disable them. */ 604 so locally disable them. */
635 int local_clip_changed = f->clip_changed; 605 int local_clip_changed = f->clip_changed;
636 int local_buffers_changed = f->buffers_changed; 606 int local_buffers_changed = f->buffers_changed;
637 f->clip_changed = 0; 607 f->clip_changed = 0;
638 f->buffers_changed = 0; 608 f->buffers_changed = 0;
639 609
640 /* and output */ 610 /* and output */
641 GUTTER_POS_LOOP (pos) 611 EDGE_POS_LOOP (pos)
642 { 612 {
643 if (FRAME_GUTTER_VISIBLE (f, pos)) 613 if (FRAME_GUTTER_VISIBLE (f, pos))
644 output_gutter (f, pos, 0); 614 output_gutter (f, pos, 0);
645 615
646 else if (gutter_was_visible (f, pos)) 616 else if (f->gutter_was_visible[pos])
647 clear_gutter (f, pos); 617 clear_gutter (f, pos);
648 } 618 }
649 619
650 f->clip_changed = local_clip_changed; 620 f->clip_changed = local_clip_changed;
651 f->buffers_changed = local_buffers_changed; 621 f->buffers_changed = local_buffers_changed;
654 } 624 }
655 625
656 void 626 void
657 reset_gutter_display_lines (struct frame* f) 627 reset_gutter_display_lines (struct frame* f)
658 { 628 {
659 enum gutter_pos pos; 629 enum edge_pos pos;
660 GUTTER_POS_LOOP (pos) 630 EDGE_POS_LOOP (pos)
661 { 631 {
662 if (f->current_display_lines[pos]) 632 if (f->current_display_lines[pos])
663 Dynarr_reset (f->current_display_lines[pos]); 633 Dynarr_reset (f->current_display_lines[pos]);
664 } 634 }
665 } 635 }
666 636
667 static void 637 static void
668 redraw_exposed_gutter (struct frame *f, enum gutter_pos pos, int x, int y, 638 redraw_exposed_gutter (struct frame *f, enum edge_pos pos, int x, int y,
669 int width, int height) 639 int width, int height)
670 { 640 {
671 int g_x, g_y, g_width, g_height; 641 int g_x, g_y, g_width, g_height;
672 642
673 get_gutter_coords (f, pos, &g_x, &g_y, &g_width, &g_height); 643 get_gutter_coords (f, pos, &g_x, &g_y, &g_width, &g_height);
694 664
695 void 665 void
696 redraw_exposed_gutters (struct frame *f, int x, int y, int width, 666 redraw_exposed_gutters (struct frame *f, int x, int y, int width,
697 int height) 667 int height)
698 { 668 {
699 enum gutter_pos pos; 669 enum edge_pos pos;
700 670
701 /* We are already inside the critical section -- our caller did that. */ 671 /* We are already inside the critical section -- our caller did that. */
702 GUTTER_POS_LOOP (pos) 672 EDGE_POS_LOOP (pos)
703 { 673 {
704 if (FRAME_GUTTER_VISIBLE (f, pos)) 674 if (FRAME_GUTTER_VISIBLE (f, pos))
705 redraw_exposed_gutter (f, pos, x, y, width, height); 675 redraw_exposed_gutter (f, pos, x, y, width, height);
706 } 676 }
707 } 677 }
708 678
709 void 679 void
710 free_frame_gutters (struct frame *f) 680 free_frame_gutters (struct frame *f)
711 { 681 {
712 enum gutter_pos pos; 682 enum edge_pos pos;
713 GUTTER_POS_LOOP (pos) 683 EDGE_POS_LOOP (pos)
714 { 684 {
715 if (f->current_display_lines[pos]) 685 if (f->current_display_lines[pos])
716 { 686 {
717 free_display_lines (f->current_display_lines[pos]); 687 free_display_lines (f->current_display_lines[pos]);
718 f->current_display_lines[pos] = 0; 688 f->current_display_lines[pos] = 0;
723 f->desired_display_lines[pos] = 0; 693 f->desired_display_lines[pos] = 0;
724 } 694 }
725 } 695 }
726 } 696 }
727 697
728 static enum gutter_pos 698 static enum edge_pos
729 decode_gutter_position (Lisp_Object position) 699 decode_gutter_position (Lisp_Object position)
730 { 700 {
731 if (EQ (position, Qtop)) return TOP_GUTTER; 701 if (EQ (position, Qtop)) return TOP_EDGE;
732 if (EQ (position, Qbottom)) return BOTTOM_GUTTER; 702 if (EQ (position, Qbottom)) return BOTTOM_EDGE;
733 if (EQ (position, Qleft)) return LEFT_GUTTER; 703 if (EQ (position, Qleft)) return LEFT_EDGE;
734 if (EQ (position, Qright)) return RIGHT_GUTTER; 704 if (EQ (position, Qright)) return RIGHT_EDGE;
735 invalid_constant ("Invalid gutter position", position); 705 invalid_constant ("Invalid gutter position", position);
736 706
737 RETURN_NOT_REACHED (TOP_GUTTER); 707 RETURN_NOT_REACHED (TOP_EDGE);
738 } 708 }
739 709
740 DEFUN ("set-default-gutter-position", Fset_default_gutter_position, 1, 1, 0, /* 710 DEFUN ("set-default-gutter-position", Fset_default_gutter_position, 1, 1, 0, /*
741 Set the position that the `default-gutter' will be displayed at. 711 Set the position that the `default-gutter' will be displayed at.
742 Valid positions are `top', `bottom', `left' and `right'. 712 Valid positions are `top', `bottom', `left' and `right'.
743 See `default-gutter-position'. 713 See `default-gutter-position'.
744 */ 714 */
745 (position)) 715 (position))
746 { 716 {
747 enum gutter_pos cur = decode_gutter_position (Vdefault_gutter_position); 717 enum edge_pos cur = decode_gutter_position (Vdefault_gutter_position);
748 enum gutter_pos new_ = decode_gutter_position (position); 718 enum edge_pos new_ = decode_gutter_position (position);
749 719
750 if (cur != new_) 720 if (cur != new_)
751 { 721 {
752 /* The following calls will automatically cause the dirty 722 /* The following calls will automatically cause the dirty
753 flags to be set; we delay frame size changes to avoid 723 flags to be set; we delay frame size changes to avoid
757 727
758 set_specifier_fallback (Vgutter[cur], list1 (Fcons (Qnil, Qnil))); 728 set_specifier_fallback (Vgutter[cur], list1 (Fcons (Qnil, Qnil)));
759 set_specifier_fallback (Vgutter[new_], Vdefault_gutter); 729 set_specifier_fallback (Vgutter[new_], Vdefault_gutter);
760 set_specifier_fallback (Vgutter_size[cur], list1 (Fcons (Qnil, Qzero))); 730 set_specifier_fallback (Vgutter_size[cur], list1 (Fcons (Qnil, Qzero)));
761 set_specifier_fallback (Vgutter_size[new_], 731 set_specifier_fallback (Vgutter_size[new_],
762 new_ == TOP_GUTTER || new_ == BOTTOM_GUTTER 732 new_ == TOP_EDGE || new_ == BOTTOM_EDGE
763 ? Vdefault_gutter_height 733 ? Vdefault_gutter_height
764 : Vdefault_gutter_width); 734 : Vdefault_gutter_width);
765 set_specifier_fallback (Vgutter_border_width[cur], 735 set_specifier_fallback (Vgutter_border_width[cur],
766 list1 (Fcons (Qnil, Qzero))); 736 list1 (Fcons (Qnil, Qzero)));
767 set_specifier_fallback (Vgutter_border_width[new_], 737 set_specifier_fallback (Vgutter_border_width[new_],
794 the current window. 764 the current window.
795 */ 765 */
796 (pos, locale)) 766 (pos, locale))
797 { 767 {
798 int x, y, width, height; 768 int x, y, width, height;
799 enum gutter_pos p = TOP_GUTTER; 769 enum edge_pos p = TOP_EDGE;
800 struct frame *f = decode_frame (FW_FRAME (locale)); 770 struct frame *f = decode_frame (FW_FRAME (locale));
801 771
802 if (NILP (pos)) 772 if (NILP (pos))
803 pos = Vdefault_gutter_position; 773 pos = Vdefault_gutter_position;
804 p = decode_gutter_position (pos); 774 p = decode_gutter_position (pos);
815 the current window. 785 the current window.
816 */ 786 */
817 (pos, locale)) 787 (pos, locale))
818 { 788 {
819 int x, y, width, height; 789 int x, y, width, height;
820 enum gutter_pos p = TOP_GUTTER; 790 enum edge_pos p = TOP_EDGE;
821 struct frame *f = decode_frame (FW_FRAME (locale)); 791 struct frame *f = decode_frame (FW_FRAME (locale));
822 792
823 if (NILP (pos)) 793 if (NILP (pos))
824 pos = Vdefault_gutter_position; 794 pos = Vdefault_gutter_position;
825 p = decode_gutter_position (pos); 795 p = decode_gutter_position (pos);
877 /* 847 /*
878 Helper for invalidating the real specifier when default 848 Helper for invalidating the real specifier when default
879 specifier caching changes 849 specifier caching changes
880 */ 850 */
881 static void 851 static void
882 recompute_overlaying_specifier (Lisp_Object real_one[4]) 852 recompute_overlaying_specifier (Lisp_Object real_one[NUM_EDGES])
883 { 853 {
884 enum gutter_pos pos = decode_gutter_position (Vdefault_gutter_position); 854 enum edge_pos pos = decode_gutter_position (Vdefault_gutter_position);
885 Fset_specifier_dirty_flag (real_one[pos]); 855 Fset_specifier_dirty_flag (real_one[pos]);
886 } 856 }
887 857
888 static void gutter_specs_changed (Lisp_Object specifier, struct window *w, 858 static void gutter_specs_changed (Lisp_Object specifier, struct window *w,
889 Lisp_Object oldval, enum gutter_pos pos); 859 Lisp_Object oldval, enum edge_pos pos);
890 860
891 static void 861 static void
892 gutter_specs_changed_1 (Lisp_Object arg) 862 gutter_specs_changed_1 (Lisp_Object arg)
893 { 863 {
894 gutter_specs_changed (X1ST (arg), XWINDOW (X2ND (arg)), 864 gutter_specs_changed (X1ST (arg), XWINDOW (X2ND (arg)),
895 X3RD (arg), (enum gutter_pos) XINT (X4TH (arg))); 865 X3RD (arg), (enum edge_pos) XINT (X4TH (arg)));
896 free_list (arg); 866 free_list (arg);
897 } 867 }
898 868
899 static void 869 static void
900 gutter_specs_changed (Lisp_Object specifier, struct window *w, 870 gutter_specs_changed (Lisp_Object specifier, struct window *w,
901 Lisp_Object oldval, enum gutter_pos pos) 871 Lisp_Object oldval, enum edge_pos pos)
902 { 872 {
903 if (in_display) 873 if (in_display)
904 register_post_redisplay_action (gutter_specs_changed_1, 874 register_post_redisplay_action (gutter_specs_changed_1,
905 list4 (specifier, wrap_window (w), 875 list4 (specifier, wrap_window (w),
906 oldval, make_int (pos))); 876 oldval, make_int (pos)));
923 /* We define all of these so we can access which actual gutter changed. */ 893 /* We define all of these so we can access which actual gutter changed. */
924 static void 894 static void
925 top_gutter_specs_changed (Lisp_Object specifier, struct window *w, 895 top_gutter_specs_changed (Lisp_Object specifier, struct window *w,
926 Lisp_Object oldval) 896 Lisp_Object oldval)
927 { 897 {
928 gutter_specs_changed (specifier, w, oldval, TOP_GUTTER); 898 gutter_specs_changed (specifier, w, oldval, TOP_EDGE);
929 } 899 }
930 900
931 static void 901 static void
932 bottom_gutter_specs_changed (Lisp_Object specifier, struct window *w, 902 bottom_gutter_specs_changed (Lisp_Object specifier, struct window *w,
933 Lisp_Object oldval) 903 Lisp_Object oldval)
934 { 904 {
935 gutter_specs_changed (specifier, w, oldval, BOTTOM_GUTTER); 905 gutter_specs_changed (specifier, w, oldval, BOTTOM_EDGE);
936 } 906 }
937 907
938 static void 908 static void
939 left_gutter_specs_changed (Lisp_Object specifier, struct window *w, 909 left_gutter_specs_changed (Lisp_Object specifier, struct window *w,
940 Lisp_Object oldval) 910 Lisp_Object oldval)
941 { 911 {
942 gutter_specs_changed (specifier, w, oldval, LEFT_GUTTER); 912 gutter_specs_changed (specifier, w, oldval, LEFT_EDGE);
943 } 913 }
944 914
945 static void 915 static void
946 right_gutter_specs_changed (Lisp_Object specifier, struct window *w, 916 right_gutter_specs_changed (Lisp_Object specifier, struct window *w,
947 Lisp_Object oldval) 917 Lisp_Object oldval)
948 { 918 {
949 gutter_specs_changed (specifier, w, oldval, RIGHT_GUTTER); 919 gutter_specs_changed (specifier, w, oldval, RIGHT_EDGE);
950 } 920 }
951 921
952 static void 922 static void
953 default_gutter_specs_changed (Lisp_Object UNUSED (specifier), 923 default_gutter_specs_changed (Lisp_Object UNUSED (specifier),
954 struct window *UNUSED (w), 924 struct window *UNUSED (w),
977 register_post_redisplay_action (gutter_geometry_changed_in_window_1, 947 register_post_redisplay_action (gutter_geometry_changed_in_window_1,
978 list3 (specifier, wrap_window (w), 948 list3 (specifier, wrap_window (w),
979 oldval)); 949 oldval));
980 else 950 else
981 { 951 {
982 enum gutter_pos pos; 952 enum edge_pos pos;
983 GUTTER_POS_LOOP (pos) 953 EDGE_POS_LOOP (pos)
984 { 954 {
985 w->real_gutter_size[pos] = w->gutter_size[pos]; 955 w->real_gutter_size[pos] = w->gutter_size[pos];
986 if (EQ (w->real_gutter_size[pos], Qautodetect) 956 if (EQ (w->real_gutter_size[pos], Qautodetect)
987 && !NILP (w->gutter_visible_p[pos])) 957 && !NILP (w->gutter_visible_p[pos]))
988 { 958 {
1149 } 1119 }
1150 1120
1151 void 1121 void
1152 init_frame_gutters (struct frame *f) 1122 init_frame_gutters (struct frame *f)
1153 { 1123 {
1154 enum gutter_pos pos; 1124 enum edge_pos pos;
1155 struct window* w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)); 1125 struct window* w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f));
1156 /* We are here as far in frame creation so cached specifiers are 1126 /* We are here as far in frame creation so cached specifiers are
1157 already recomputed, and possibly modified by resource 1127 already recomputed, and possibly modified by resource
1158 initialization. We need to recalculate autodetected gutters. */ 1128 initialization. We need to recalculate autodetected gutters. */
1159 GUTTER_POS_LOOP (pos) 1129 EDGE_POS_LOOP (pos)
1160 { 1130 {
1161 w->real_gutter[pos] = construct_window_gutter_spec (w, pos); 1131 w->real_gutter[pos] = construct_window_gutter_spec (w, pos);
1162 w->real_gutter_size[pos] = w->gutter_size[pos]; 1132 w->real_gutter_size[pos] = w->gutter_size[pos];
1163 if (EQ (w->gutter_size[pos], Qautodetect) 1133 if (EQ (w->gutter_size[pos], Qautodetect)
1164 && !NILP (w->gutter_visible_p[pos])) 1134 && !NILP (w->gutter_visible_p[pos]))
1168 MARK_WINDOWS_CHANGED (w); 1138 MARK_WINDOWS_CHANGED (w);
1169 } 1139 }
1170 } 1140 }
1171 1141
1172 /* Keep a record of the current sizes of things. */ 1142 /* Keep a record of the current sizes of things. */
1173 GUTTER_POS_LOOP (pos) 1143 EDGE_POS_LOOP (pos)
1174 { 1144 {
1175 f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos); 1145 f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos);
1176 } 1146 }
1177 } 1147 }
1178 1148
1276 offsetof (struct window, default_gutter), 1246 offsetof (struct window, default_gutter),
1277 default_gutter_specs_changed, 1247 default_gutter_specs_changed,
1278 0, 0, 1); 1248 0, 0, 1);
1279 1249
1280 DEFVAR_SPECIFIER ("top-gutter", 1250 DEFVAR_SPECIFIER ("top-gutter",
1281 &Vgutter[TOP_GUTTER] /* 1251 &Vgutter[TOP_EDGE] /*
1282 Specifier for the gutter at the top of the frame. 1252 Specifier for the gutter at the top of the frame.
1283 Use `set-specifier' to change this. 1253 Use `set-specifier' to change this.
1284 See `default-gutter' for a description of a valid gutter instantiator. 1254 See `default-gutter' for a description of a valid gutter instantiator.
1285 */ ); 1255 */ );
1286 Vgutter[TOP_GUTTER] = Fmake_specifier (Qgutter); 1256 Vgutter[TOP_EDGE] = Fmake_specifier (Qgutter);
1287 set_specifier_caching (Vgutter[TOP_GUTTER], 1257 set_specifier_caching (Vgutter[TOP_EDGE],
1288 offsetof (struct window, gutter[TOP_GUTTER]), 1258 offsetof (struct window, gutter[TOP_EDGE]),
1289 top_gutter_specs_changed, 1259 top_gutter_specs_changed,
1290 0, 0, 1); 1260 0, 0, 1);
1291 1261
1292 DEFVAR_SPECIFIER ("bottom-gutter", 1262 DEFVAR_SPECIFIER ("bottom-gutter",
1293 &Vgutter[BOTTOM_GUTTER] /* 1263 &Vgutter[BOTTOM_EDGE] /*
1294 Specifier for the gutter at the bottom of the frame. 1264 Specifier for the gutter at the bottom of the frame.
1295 Use `set-specifier' to change this. 1265 Use `set-specifier' to change this.
1296 See `default-gutter' for a description of a valid gutter instantiator. 1266 See `default-gutter' for a description of a valid gutter instantiator.
1297 1267
1298 Note that, unless the `default-gutter-position' is `bottom', by 1268 Note that, unless the `default-gutter-position' is `bottom', by
1299 default the height of the bottom gutter (controlled by 1269 default the height of the bottom gutter (controlled by
1300 `bottom-gutter-height') is 0; thus, a bottom gutter will not be 1270 `bottom-gutter-height') is 0; thus, a bottom gutter will not be
1301 displayed even if you provide a value for `bottom-gutter'. 1271 displayed even if you provide a value for `bottom-gutter'.
1302 */ ); 1272 */ );
1303 Vgutter[BOTTOM_GUTTER] = Fmake_specifier (Qgutter); 1273 Vgutter[BOTTOM_EDGE] = Fmake_specifier (Qgutter);
1304 set_specifier_caching (Vgutter[BOTTOM_GUTTER], 1274 set_specifier_caching (Vgutter[BOTTOM_EDGE],
1305 offsetof (struct window, gutter[BOTTOM_GUTTER]), 1275 offsetof (struct window, gutter[BOTTOM_EDGE]),
1306 bottom_gutter_specs_changed, 1276 bottom_gutter_specs_changed,
1307 0, 0, 1); 1277 0, 0, 1);
1308 1278
1309 DEFVAR_SPECIFIER ("left-gutter", 1279 DEFVAR_SPECIFIER ("left-gutter",
1310 &Vgutter[LEFT_GUTTER] /* 1280 &Vgutter[LEFT_EDGE] /*
1311 Specifier for the gutter at the left edge of the frame. 1281 Specifier for the gutter at the left edge of the frame.
1312 Use `set-specifier' to change this. 1282 Use `set-specifier' to change this.
1313 See `default-gutter' for a description of a valid gutter instantiator. 1283 See `default-gutter' for a description of a valid gutter instantiator.
1314 1284
1315 Note that, unless the `default-gutter-position' is `left', by 1285 Note that, unless the `default-gutter-position' is `left', by
1316 default the height of the left gutter (controlled by 1286 default the height of the left gutter (controlled by
1317 `left-gutter-width') is 0; thus, a left gutter will not be 1287 `left-gutter-width') is 0; thus, a left gutter will not be
1318 displayed even if you provide a value for `left-gutter'. 1288 displayed even if you provide a value for `left-gutter'.
1319 */ ); 1289 */ );
1320 Vgutter[LEFT_GUTTER] = Fmake_specifier (Qgutter); 1290 Vgutter[LEFT_EDGE] = Fmake_specifier (Qgutter);
1321 set_specifier_caching (Vgutter[LEFT_GUTTER], 1291 set_specifier_caching (Vgutter[LEFT_EDGE],
1322 offsetof (struct window, gutter[LEFT_GUTTER]), 1292 offsetof (struct window, gutter[LEFT_EDGE]),
1323 left_gutter_specs_changed, 1293 left_gutter_specs_changed,
1324 0, 0, 1); 1294 0, 0, 1);
1325 1295
1326 DEFVAR_SPECIFIER ("right-gutter", 1296 DEFVAR_SPECIFIER ("right-gutter",
1327 &Vgutter[RIGHT_GUTTER] /* 1297 &Vgutter[RIGHT_EDGE] /*
1328 Specifier for the gutter at the right edge of the frame. 1298 Specifier for the gutter at the right edge of the frame.
1329 Use `set-specifier' to change this. 1299 Use `set-specifier' to change this.
1330 See `default-gutter' for a description of a valid gutter instantiator. 1300 See `default-gutter' for a description of a valid gutter instantiator.
1331 1301
1332 Note that, unless the `default-gutter-position' is `right', by 1302 Note that, unless the `default-gutter-position' is `right', by
1333 default the height of the right gutter (controlled by 1303 default the height of the right gutter (controlled by
1334 `right-gutter-width') is 0; thus, a right gutter will not be 1304 `right-gutter-width') is 0; thus, a right gutter will not be
1335 displayed even if you provide a value for `right-gutter'. 1305 displayed even if you provide a value for `right-gutter'.
1336 */ ); 1306 */ );
1337 Vgutter[RIGHT_GUTTER] = Fmake_specifier (Qgutter); 1307 Vgutter[RIGHT_EDGE] = Fmake_specifier (Qgutter);
1338 set_specifier_caching (Vgutter[RIGHT_GUTTER], 1308 set_specifier_caching (Vgutter[RIGHT_EDGE],
1339 offsetof (struct window, gutter[RIGHT_GUTTER]), 1309 offsetof (struct window, gutter[RIGHT_EDGE]),
1340 right_gutter_specs_changed, 1310 right_gutter_specs_changed,
1341 0, 0, 1); 1311 0, 0, 1);
1342 1312
1343 /* initially, top inherits from default; this can be 1313 /* initially, top inherits from default; this can be
1344 changed with `set-default-gutter-position'. */ 1314 changed with `set-default-gutter-position'. */
1345 fb = list1 (Fcons (Qnil, Qnil)); 1315 fb = list1 (Fcons (Qnil, Qnil));
1346 set_specifier_fallback (Vdefault_gutter, fb); 1316 set_specifier_fallback (Vdefault_gutter, fb);
1347 set_specifier_fallback (Vgutter[TOP_GUTTER], Vdefault_gutter); 1317 set_specifier_fallback (Vgutter[TOP_EDGE], Vdefault_gutter);
1348 set_specifier_fallback (Vgutter[BOTTOM_GUTTER], fb); 1318 set_specifier_fallback (Vgutter[BOTTOM_EDGE], fb);
1349 set_specifier_fallback (Vgutter[LEFT_GUTTER], fb); 1319 set_specifier_fallback (Vgutter[LEFT_EDGE], fb);
1350 set_specifier_fallback (Vgutter[RIGHT_GUTTER], fb); 1320 set_specifier_fallback (Vgutter[RIGHT_EDGE], fb);
1351 1321
1352 DEFVAR_SPECIFIER ("default-gutter-height", &Vdefault_gutter_height /* 1322 DEFVAR_SPECIFIER ("default-gutter-height", &Vdefault_gutter_height /*
1353 *Height of the default gutter, if it's oriented horizontally. 1323 *Height of the default gutter, if it's oriented horizontally.
1354 This is a specifier; use `set-specifier' to change it. 1324 This is a specifier; use `set-specifier' to change it.
1355 1325
1391 offsetof (struct window, default_gutter_width), 1361 offsetof (struct window, default_gutter_width),
1392 default_gutter_size_changed_in_window, 1362 default_gutter_size_changed_in_window,
1393 0, 0, 1); 1363 0, 0, 1);
1394 1364
1395 DEFVAR_SPECIFIER ("top-gutter-height", 1365 DEFVAR_SPECIFIER ("top-gutter-height",
1396 &Vgutter_size[TOP_GUTTER] /* 1366 &Vgutter_size[TOP_EDGE] /*
1397 *Height of the top gutter. 1367 *Height of the top gutter.
1398 This is a specifier; use `set-specifier' to change it. 1368 This is a specifier; use `set-specifier' to change it.
1399 1369
1400 See `default-gutter-height' for more information. 1370 See `default-gutter-height' for more information.
1401 */ ); 1371 */ );
1402 Vgutter_size[TOP_GUTTER] = Fmake_specifier (Qgutter_size); 1372 Vgutter_size[TOP_EDGE] = Fmake_specifier (Qgutter_size);
1403 set_specifier_caching (Vgutter_size[TOP_GUTTER], 1373 set_specifier_caching (Vgutter_size[TOP_EDGE],
1404 offsetof (struct window, gutter_size[TOP_GUTTER]), 1374 offsetof (struct window, gutter_size[TOP_EDGE]),
1405 gutter_geometry_changed_in_window, 0, 0, 1); 1375 gutter_geometry_changed_in_window, 0, 0, 1);
1406 1376
1407 DEFVAR_SPECIFIER ("bottom-gutter-height", 1377 DEFVAR_SPECIFIER ("bottom-gutter-height",
1408 &Vgutter_size[BOTTOM_GUTTER] /* 1378 &Vgutter_size[BOTTOM_EDGE] /*
1409 *Height of the bottom gutter. 1379 *Height of the bottom gutter.
1410 This is a specifier; use `set-specifier' to change it. 1380 This is a specifier; use `set-specifier' to change it.
1411 1381
1412 See `default-gutter-height' for more information. 1382 See `default-gutter-height' for more information.
1413 */ ); 1383 */ );
1414 Vgutter_size[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_size); 1384 Vgutter_size[BOTTOM_EDGE] = Fmake_specifier (Qgutter_size);
1415 set_specifier_caching (Vgutter_size[BOTTOM_GUTTER], 1385 set_specifier_caching (Vgutter_size[BOTTOM_EDGE],
1416 offsetof (struct window, gutter_size[BOTTOM_GUTTER]), 1386 offsetof (struct window, gutter_size[BOTTOM_EDGE]),
1417 gutter_geometry_changed_in_window, 0, 0, 1); 1387 gutter_geometry_changed_in_window, 0, 0, 1);
1418 1388
1419 DEFVAR_SPECIFIER ("left-gutter-width", 1389 DEFVAR_SPECIFIER ("left-gutter-width",
1420 &Vgutter_size[LEFT_GUTTER] /* 1390 &Vgutter_size[LEFT_EDGE] /*
1421 *Width of left gutter. 1391 *Width of left gutter.
1422 This is a specifier; use `set-specifier' to change it. 1392 This is a specifier; use `set-specifier' to change it.
1423 1393
1424 See `default-gutter-height' for more information. 1394 See `default-gutter-height' for more information.
1425 */ ); 1395 */ );
1426 Vgutter_size[LEFT_GUTTER] = Fmake_specifier (Qgutter_size); 1396 Vgutter_size[LEFT_EDGE] = Fmake_specifier (Qgutter_size);
1427 set_specifier_caching (Vgutter_size[LEFT_GUTTER], 1397 set_specifier_caching (Vgutter_size[LEFT_EDGE],
1428 offsetof (struct window, gutter_size[LEFT_GUTTER]), 1398 offsetof (struct window, gutter_size[LEFT_EDGE]),
1429 gutter_geometry_changed_in_window, 0, 0, 1); 1399 gutter_geometry_changed_in_window, 0, 0, 1);
1430 1400
1431 DEFVAR_SPECIFIER ("right-gutter-width", 1401 DEFVAR_SPECIFIER ("right-gutter-width",
1432 &Vgutter_size[RIGHT_GUTTER] /* 1402 &Vgutter_size[RIGHT_EDGE] /*
1433 *Width of right gutter. 1403 *Width of right gutter.
1434 This is a specifier; use `set-specifier' to change it. 1404 This is a specifier; use `set-specifier' to change it.
1435 1405
1436 See `default-gutter-height' for more information. 1406 See `default-gutter-height' for more information.
1437 */ ); 1407 */ );
1438 Vgutter_size[RIGHT_GUTTER] = Fmake_specifier (Qgutter_size); 1408 Vgutter_size[RIGHT_EDGE] = Fmake_specifier (Qgutter_size);
1439 set_specifier_caching (Vgutter_size[RIGHT_GUTTER], 1409 set_specifier_caching (Vgutter_size[RIGHT_EDGE],
1440 offsetof (struct window, gutter_size[RIGHT_GUTTER]), 1410 offsetof (struct window, gutter_size[RIGHT_EDGE]),
1441 gutter_geometry_changed_in_window, 0, 0, 1); 1411 gutter_geometry_changed_in_window, 0, 0, 1);
1442 1412
1443 fb = Qnil; 1413 fb = Qnil;
1444 #ifdef HAVE_TTY 1414 #ifdef HAVE_TTY
1445 fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb); 1415 fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb);
1472 fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb); 1442 fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb);
1473 #endif 1443 #endif
1474 if (!NILP (fb)) 1444 if (!NILP (fb))
1475 set_specifier_fallback (Vdefault_gutter_width, fb); 1445 set_specifier_fallback (Vdefault_gutter_width, fb);
1476 1446
1477 set_specifier_fallback (Vgutter_size[TOP_GUTTER], Vdefault_gutter_height); 1447 set_specifier_fallback (Vgutter_size[TOP_EDGE], Vdefault_gutter_height);
1478 fb = list1 (Fcons (Qnil, Qzero)); 1448 fb = list1 (Fcons (Qnil, Qzero));
1479 set_specifier_fallback (Vgutter_size[BOTTOM_GUTTER], fb); 1449 set_specifier_fallback (Vgutter_size[BOTTOM_EDGE], fb);
1480 set_specifier_fallback (Vgutter_size[LEFT_GUTTER], fb); 1450 set_specifier_fallback (Vgutter_size[LEFT_EDGE], fb);
1481 set_specifier_fallback (Vgutter_size[RIGHT_GUTTER], fb); 1451 set_specifier_fallback (Vgutter_size[RIGHT_EDGE], fb);
1482 1452
1483 DEFVAR_SPECIFIER ("default-gutter-border-width", 1453 DEFVAR_SPECIFIER ("default-gutter-border-width",
1484 &Vdefault_gutter_border_width /* 1454 &Vdefault_gutter_border_width /*
1485 *Width of the border around the default gutter. 1455 *Width of the border around the default gutter.
1486 This is a specifier; use `set-specifier' to change it. 1456 This is a specifier; use `set-specifier' to change it.
1499 offsetof (struct window, default_gutter_border_width), 1469 offsetof (struct window, default_gutter_border_width),
1500 default_gutter_border_width_changed_in_window, 1470 default_gutter_border_width_changed_in_window,
1501 0, 0, 0); 1471 0, 0, 0);
1502 1472
1503 DEFVAR_SPECIFIER ("top-gutter-border-width", 1473 DEFVAR_SPECIFIER ("top-gutter-border-width",
1504 &Vgutter_border_width[TOP_GUTTER] /* 1474 &Vgutter_border_width[TOP_EDGE] /*
1505 *Border width of the top gutter. 1475 *Border width of the top gutter.
1506 This is a specifier; use `set-specifier' to change it. 1476 This is a specifier; use `set-specifier' to change it.
1507 1477
1508 See `default-gutter-height' for more information. 1478 See `default-gutter-height' for more information.
1509 */ ); 1479 */ );
1510 Vgutter_border_width[TOP_GUTTER] = Fmake_specifier (Qnatnum); 1480 Vgutter_border_width[TOP_EDGE] = Fmake_specifier (Qnatnum);
1511 set_specifier_caching (Vgutter_border_width[TOP_GUTTER], 1481 set_specifier_caching (Vgutter_border_width[TOP_EDGE],
1512 offsetof (struct window, 1482 offsetof (struct window,
1513 gutter_border_width[TOP_GUTTER]), 1483 gutter_border_width[TOP_EDGE]),
1514 gutter_geometry_changed_in_window, 0, 0, 0); 1484 gutter_geometry_changed_in_window, 0, 0, 0);
1515 1485
1516 DEFVAR_SPECIFIER ("bottom-gutter-border-width", 1486 DEFVAR_SPECIFIER ("bottom-gutter-border-width",
1517 &Vgutter_border_width[BOTTOM_GUTTER] /* 1487 &Vgutter_border_width[BOTTOM_EDGE] /*
1518 *Border width of the bottom gutter. 1488 *Border width of the bottom gutter.
1519 This is a specifier; use `set-specifier' to change it. 1489 This is a specifier; use `set-specifier' to change it.
1520 1490
1521 See `default-gutter-height' for more information. 1491 See `default-gutter-height' for more information.
1522 */ ); 1492 */ );
1523 Vgutter_border_width[BOTTOM_GUTTER] = Fmake_specifier (Qnatnum); 1493 Vgutter_border_width[BOTTOM_EDGE] = Fmake_specifier (Qnatnum);
1524 set_specifier_caching (Vgutter_border_width[BOTTOM_GUTTER], 1494 set_specifier_caching (Vgutter_border_width[BOTTOM_EDGE],
1525 offsetof (struct window, 1495 offsetof (struct window,
1526 gutter_border_width[BOTTOM_GUTTER]), 1496 gutter_border_width[BOTTOM_EDGE]),
1527 gutter_geometry_changed_in_window, 0, 0, 0); 1497 gutter_geometry_changed_in_window, 0, 0, 0);
1528 1498
1529 DEFVAR_SPECIFIER ("left-gutter-border-width", 1499 DEFVAR_SPECIFIER ("left-gutter-border-width",
1530 &Vgutter_border_width[LEFT_GUTTER] /* 1500 &Vgutter_border_width[LEFT_EDGE] /*
1531 *Border width of left gutter. 1501 *Border width of left gutter.
1532 This is a specifier; use `set-specifier' to change it. 1502 This is a specifier; use `set-specifier' to change it.
1533 1503
1534 See `default-gutter-height' for more information. 1504 See `default-gutter-height' for more information.
1535 */ ); 1505 */ );
1536 Vgutter_border_width[LEFT_GUTTER] = Fmake_specifier (Qnatnum); 1506 Vgutter_border_width[LEFT_EDGE] = Fmake_specifier (Qnatnum);
1537 set_specifier_caching (Vgutter_border_width[LEFT_GUTTER], 1507 set_specifier_caching (Vgutter_border_width[LEFT_EDGE],
1538 offsetof (struct window, 1508 offsetof (struct window,
1539 gutter_border_width[LEFT_GUTTER]), 1509 gutter_border_width[LEFT_EDGE]),
1540 gutter_geometry_changed_in_window, 0, 0, 0); 1510 gutter_geometry_changed_in_window, 0, 0, 0);
1541 1511
1542 DEFVAR_SPECIFIER ("right-gutter-border-width", 1512 DEFVAR_SPECIFIER ("right-gutter-border-width",
1543 &Vgutter_border_width[RIGHT_GUTTER] /* 1513 &Vgutter_border_width[RIGHT_EDGE] /*
1544 *Border width of right gutter. 1514 *Border width of right gutter.
1545 This is a specifier; use `set-specifier' to change it. 1515 This is a specifier; use `set-specifier' to change it.
1546 1516
1547 See `default-gutter-height' for more information. 1517 See `default-gutter-height' for more information.
1548 */ ); 1518 */ );
1549 Vgutter_border_width[RIGHT_GUTTER] = Fmake_specifier (Qnatnum); 1519 Vgutter_border_width[RIGHT_EDGE] = Fmake_specifier (Qnatnum);
1550 set_specifier_caching (Vgutter_border_width[RIGHT_GUTTER], 1520 set_specifier_caching (Vgutter_border_width[RIGHT_EDGE],
1551 offsetof (struct window, 1521 offsetof (struct window,
1552 gutter_border_width[RIGHT_GUTTER]), 1522 gutter_border_width[RIGHT_EDGE]),
1553 gutter_geometry_changed_in_window, 0, 0, 0); 1523 gutter_geometry_changed_in_window, 0, 0, 0);
1554 1524
1555 fb = Qnil; 1525 fb = Qnil;
1556 #ifdef HAVE_TTY 1526 #ifdef HAVE_TTY
1557 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); 1527 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
1564 fb = Fcons (Fcons (list1 (Qmswindows), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb); 1534 fb = Fcons (Fcons (list1 (Qmswindows), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb);
1565 #endif 1535 #endif
1566 if (!NILP (fb)) 1536 if (!NILP (fb))
1567 set_specifier_fallback (Vdefault_gutter_border_width, fb); 1537 set_specifier_fallback (Vdefault_gutter_border_width, fb);
1568 1538
1569 set_specifier_fallback (Vgutter_border_width[TOP_GUTTER], Vdefault_gutter_border_width); 1539 set_specifier_fallback (Vgutter_border_width[TOP_EDGE], Vdefault_gutter_border_width);
1570 fb = list1 (Fcons (Qnil, Qzero)); 1540 fb = list1 (Fcons (Qnil, Qzero));
1571 set_specifier_fallback (Vgutter_border_width[BOTTOM_GUTTER], fb); 1541 set_specifier_fallback (Vgutter_border_width[BOTTOM_EDGE], fb);
1572 set_specifier_fallback (Vgutter_border_width[LEFT_GUTTER], fb); 1542 set_specifier_fallback (Vgutter_border_width[LEFT_EDGE], fb);
1573 set_specifier_fallback (Vgutter_border_width[RIGHT_GUTTER], fb); 1543 set_specifier_fallback (Vgutter_border_width[RIGHT_EDGE], fb);
1574 1544
1575 DEFVAR_SPECIFIER ("default-gutter-visible-p", &Vdefault_gutter_visible_p /* 1545 DEFVAR_SPECIFIER ("default-gutter-visible-p", &Vdefault_gutter_visible_p /*
1576 *Whether the default gutter is visible. 1546 *Whether the default gutter is visible.
1577 This is a specifier; use `set-specifier' to change it. 1547 This is a specifier; use `set-specifier' to change it.
1578 1548
1593 default_gutter_visible_p), 1563 default_gutter_visible_p),
1594 default_gutter_visible_p_changed_in_window, 1564 default_gutter_visible_p_changed_in_window,
1595 0, 0, 0); 1565 0, 0, 0);
1596 1566
1597 DEFVAR_SPECIFIER ("top-gutter-visible-p", 1567 DEFVAR_SPECIFIER ("top-gutter-visible-p",
1598 &Vgutter_visible_p[TOP_GUTTER] /* 1568 &Vgutter_visible_p[TOP_EDGE] /*
1599 *Whether the top gutter is visible. 1569 *Whether the top gutter is visible.
1600 This is a specifier; use `set-specifier' to change it. 1570 This is a specifier; use `set-specifier' to change it.
1601 1571
1602 See `default-gutter-visible-p' for more information. 1572 See `default-gutter-visible-p' for more information.
1603 */ ); 1573 */ );
1604 Vgutter_visible_p[TOP_GUTTER] = Fmake_specifier (Qgutter_visible); 1574 Vgutter_visible_p[TOP_EDGE] = Fmake_specifier (Qgutter_visible);
1605 set_specifier_caching (Vgutter_visible_p[TOP_GUTTER], 1575 set_specifier_caching (Vgutter_visible_p[TOP_EDGE],
1606 offsetof (struct window, 1576 offsetof (struct window,
1607 gutter_visible_p[TOP_GUTTER]), 1577 gutter_visible_p[TOP_EDGE]),
1608 top_gutter_specs_changed, 0, 0, 0); 1578 top_gutter_specs_changed, 0, 0, 0);
1609 1579
1610 DEFVAR_SPECIFIER ("bottom-gutter-visible-p", 1580 DEFVAR_SPECIFIER ("bottom-gutter-visible-p",
1611 &Vgutter_visible_p[BOTTOM_GUTTER] /* 1581 &Vgutter_visible_p[BOTTOM_EDGE] /*
1612 *Whether the bottom gutter is visible. 1582 *Whether the bottom gutter is visible.
1613 This is a specifier; use `set-specifier' to change it. 1583 This is a specifier; use `set-specifier' to change it.
1614 1584
1615 See `default-gutter-visible-p' for more information. 1585 See `default-gutter-visible-p' for more information.
1616 */ ); 1586 */ );
1617 Vgutter_visible_p[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_visible); 1587 Vgutter_visible_p[BOTTOM_EDGE] = Fmake_specifier (Qgutter_visible);
1618 set_specifier_caching (Vgutter_visible_p[BOTTOM_GUTTER], 1588 set_specifier_caching (Vgutter_visible_p[BOTTOM_EDGE],
1619 offsetof (struct window, 1589 offsetof (struct window,
1620 gutter_visible_p[BOTTOM_GUTTER]), 1590 gutter_visible_p[BOTTOM_EDGE]),
1621 bottom_gutter_specs_changed, 0, 0, 0); 1591 bottom_gutter_specs_changed, 0, 0, 0);
1622 1592
1623 DEFVAR_SPECIFIER ("left-gutter-visible-p", 1593 DEFVAR_SPECIFIER ("left-gutter-visible-p",
1624 &Vgutter_visible_p[LEFT_GUTTER] /* 1594 &Vgutter_visible_p[LEFT_EDGE] /*
1625 *Whether the left gutter is visible. 1595 *Whether the left gutter is visible.
1626 This is a specifier; use `set-specifier' to change it. 1596 This is a specifier; use `set-specifier' to change it.
1627 1597
1628 See `default-gutter-visible-p' for more information. 1598 See `default-gutter-visible-p' for more information.
1629 */ ); 1599 */ );
1630 Vgutter_visible_p[LEFT_GUTTER] = Fmake_specifier (Qgutter_visible); 1600 Vgutter_visible_p[LEFT_EDGE] = Fmake_specifier (Qgutter_visible);
1631 set_specifier_caching (Vgutter_visible_p[LEFT_GUTTER], 1601 set_specifier_caching (Vgutter_visible_p[LEFT_EDGE],
1632 offsetof (struct window, 1602 offsetof (struct window,
1633 gutter_visible_p[LEFT_GUTTER]), 1603 gutter_visible_p[LEFT_EDGE]),
1634 left_gutter_specs_changed, 0, 0, 0); 1604 left_gutter_specs_changed, 0, 0, 0);
1635 1605
1636 DEFVAR_SPECIFIER ("right-gutter-visible-p", 1606 DEFVAR_SPECIFIER ("right-gutter-visible-p",
1637 &Vgutter_visible_p[RIGHT_GUTTER] /* 1607 &Vgutter_visible_p[RIGHT_EDGE] /*
1638 *Whether the right gutter is visible. 1608 *Whether the right gutter is visible.
1639 This is a specifier; use `set-specifier' to change it. 1609 This is a specifier; use `set-specifier' to change it.
1640 1610
1641 See `default-gutter-visible-p' for more information. 1611 See `default-gutter-visible-p' for more information.
1642 */ ); 1612 */ );
1643 Vgutter_visible_p[RIGHT_GUTTER] = Fmake_specifier (Qgutter_visible); 1613 Vgutter_visible_p[RIGHT_EDGE] = Fmake_specifier (Qgutter_visible);
1644 set_specifier_caching (Vgutter_visible_p[RIGHT_GUTTER], 1614 set_specifier_caching (Vgutter_visible_p[RIGHT_EDGE],
1645 offsetof (struct window, 1615 offsetof (struct window,
1646 gutter_visible_p[RIGHT_GUTTER]), 1616 gutter_visible_p[RIGHT_EDGE]),
1647 right_gutter_specs_changed, 0, 0, 0); 1617 right_gutter_specs_changed, 0, 0, 0);
1648 1618
1649 /* initially, top inherits from default; this can be 1619 /* initially, top inherits from default; this can be
1650 changed with `set-default-gutter-position'. */ 1620 changed with `set-default-gutter-position'. */
1651 fb = list1 (Fcons (Qnil, Qt)); 1621 fb = list1 (Fcons (Qnil, Qt));
1652 set_specifier_fallback (Vdefault_gutter_visible_p, fb); 1622 set_specifier_fallback (Vdefault_gutter_visible_p, fb);
1653 set_specifier_fallback (Vgutter_visible_p[TOP_GUTTER], 1623 set_specifier_fallback (Vgutter_visible_p[TOP_EDGE],
1654 Vdefault_gutter_visible_p); 1624 Vdefault_gutter_visible_p);
1655 set_specifier_fallback (Vgutter_visible_p[BOTTOM_GUTTER], fb); 1625 set_specifier_fallback (Vgutter_visible_p[BOTTOM_EDGE], fb);
1656 set_specifier_fallback (Vgutter_visible_p[LEFT_GUTTER], fb); 1626 set_specifier_fallback (Vgutter_visible_p[LEFT_EDGE], fb);
1657 set_specifier_fallback (Vgutter_visible_p[RIGHT_GUTTER], fb); 1627 set_specifier_fallback (Vgutter_visible_p[RIGHT_EDGE], fb);
1658 } 1628 }