annotate src/gutter.c @ 424:11054d720c21 r21-2-20

Import from CVS: tag r21-2-20
author cvs
date Mon, 13 Aug 2007 11:26:11 +0200
parents 95016f13131a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1 /* Gutter implementation.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
2 Copyright (C) 1999 Andy Piper.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
3
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
4 This file is part of XEmacs.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
5
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
9 later version.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
10
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
14 for more details.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
15
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
20
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
22
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
23 /* written by Andy Piper <andy@xemacs.org> with specifiers partially
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
24 ripped-off from toolbar.c */
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
25
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
26 #include <config.h>
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
27 #include "lisp.h"
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
28
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
29 #include "buffer.h"
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
30 #include "frame.h"
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
31 #include "device.h"
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
32 #include "faces.h"
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
33 #include "glyphs.h"
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
34 #include "redisplay.h"
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
35 #include "window.h"
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
36 #include "gutter.h"
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
37
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
38 Lisp_Object Vgutter[4];
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
39 Lisp_Object Vgutter_size[4];
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
40 Lisp_Object Vgutter_visible_p[4];
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
41 Lisp_Object Vgutter_border_width[4];
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
42
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
43 Lisp_Object Vdefault_gutter, Vdefault_gutter_visible_p;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
44 Lisp_Object Vdefault_gutter_width, Vdefault_gutter_height;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
45 Lisp_Object Vdefault_gutter_border_width;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
46
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
47 Lisp_Object Vdefault_gutter_position;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
48
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
49 Lisp_Object Qgutter_size;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
50
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
51 #define SET_GUTTER_WAS_VISIBLE_FLAG(frame, pos, flag) \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
52 do { \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
53 switch (pos) \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
54 { \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
55 case TOP_GUTTER: \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
56 (frame)->top_gutter_was_visible = flag; \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
57 break; \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
58 case BOTTOM_GUTTER: \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
59 (frame)->bottom_gutter_was_visible = flag; \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
60 break; \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
61 case LEFT_GUTTER: \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
62 (frame)->left_gutter_was_visible = flag; \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
63 break; \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
64 case RIGHT_GUTTER: \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
65 (frame)->right_gutter_was_visible = flag; \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
66 break; \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
67 default: \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
68 abort (); \
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
69 } \
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
70 } while (0)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
71
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
72 static int gutter_was_visible (struct frame* frame, enum gutter_pos pos)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
73 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
74 switch (pos)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
75 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
76 case TOP_GUTTER:
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
77 return frame->top_gutter_was_visible;
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
78 case BOTTOM_GUTTER:
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
79 return frame->bottom_gutter_was_visible;
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
80 case LEFT_GUTTER:
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
81 return frame->left_gutter_was_visible;
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
82 case RIGHT_GUTTER:
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
83 return frame->right_gutter_was_visible;
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
84 default:
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
85 abort ();
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
86 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
87 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
88
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
89 static Lisp_Object
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
90 frame_topmost_window (struct frame *f)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
91 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
92 Lisp_Object w = FRAME_ROOT_WINDOW (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
93
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
94 do {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
95 while (!NILP (XWINDOW (w)->vchild))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
96 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
97 w = XWINDOW (w)->vchild;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
98 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
99 } while (!NILP (XWINDOW (w)->hchild) && !NILP (w = XWINDOW (w)->hchild));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
100
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
101 return w;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
102 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
103
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
104 static Lisp_Object
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
105 frame_bottommost_window (struct frame *f)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
106 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
107 Lisp_Object w = FRAME_ROOT_WINDOW (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
108
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
109 do {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
110 while (!NILP (XWINDOW (w)->vchild))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
111 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
112 w = XWINDOW (w)->vchild;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
113 while (!NILP (XWINDOW (w)->next))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
114 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
115 w = XWINDOW (w)->next;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
116 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
117 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
118 } while (!NILP (XWINDOW (w)->hchild) && !NILP (w = XWINDOW (w)->hchild));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
119
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
120 return w;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
121 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
122
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
123 #if 0
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
124 static Lisp_Object
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
125 frame_leftmost_window (struct frame *f)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
126 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
127 Lisp_Object w = FRAME_ROOT_WINDOW (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
128
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
129 do {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
130 while (!NILP (XWINDOW (w)->hchild))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
131 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
132 w = XWINDOW (w)->hchild;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
133 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
134 } while (!NILP (XWINDOW (w)->vchild) && !NILP (w = XWINDOW (w)->vchild));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
135
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
136 return w;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
137 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
138
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
139 static Lisp_Object
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
140 frame_rightmost_window (struct frame *f)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
141 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
142 Lisp_Object w = FRAME_ROOT_WINDOW (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
143
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
144 do {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
145 while (!NILP (XWINDOW (w)->hchild))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
146 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
147 w = XWINDOW (w)->hchild;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
148 while (!NILP (XWINDOW (w)->next))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
149 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
150 w = XWINDOW (w)->next;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
151 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
152 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
153 } while (!NILP (XWINDOW (w)->vchild) && !NILP (w = XWINDOW (w)->vchild));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
154 return w;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
155 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
156 #endif
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
157
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
158 /* calculate the coordinates of a gutter for the current frame and
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
159 selected window. we have to be careful in calculating this as we
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
160 need to use *two* windows, the currently selected window will give
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
161 us the actual height, width and contents of the gutter, but if we
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
162 use this for calculating the gutter positions we run into trouble
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
163 if it is not the window nearest the gutter. Instead we predetermine
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
164 the nearest window and then use that.*/
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
165 static void
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
166 get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
167 int *width, int *height)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
168 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
169 struct window
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
170 * top = XWINDOW (frame_topmost_window (f)),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
171 * bot = XWINDOW (frame_bottommost_window (f));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
172 /* The top and bottom gutters take precedence over the left and
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
173 right. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
174 switch (pos)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
175 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
176 case TOP_GUTTER:
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
177 *x = FRAME_LEFT_BORDER_END (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
178 *y = FRAME_TOP_BORDER_END (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
179 *width = FRAME_RIGHT_BORDER_START (f)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
180 - FRAME_LEFT_BORDER_END (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
181 *height = FRAME_TOP_GUTTER_BOUNDS (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
182 break;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
183
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
184 case BOTTOM_GUTTER:
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
185 *x = FRAME_LEFT_BORDER_END (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
186 *y = WINDOW_BOTTOM (bot)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
187 - FRAME_BOTTOM_GUTTER_BOUNDS (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
188 *width = FRAME_RIGHT_BORDER_START (f)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
189 - FRAME_LEFT_BORDER_END (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
190 *height = FRAME_BOTTOM_GUTTER_BOUNDS (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
191 break;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
192
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
193 case LEFT_GUTTER:
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
194 *x = FRAME_LEFT_BORDER_END (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
195 *y = WINDOW_TEXT_TOP (top);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
196 *width = FRAME_LEFT_GUTTER_BOUNDS (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
197 *height = WINDOW_BOTTOM (bot)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
198 - (WINDOW_TEXT_TOP (top)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
199 + FRAME_BOTTOM_GUTTER_BOUNDS (f));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
200 break;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
201
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
202 case RIGHT_GUTTER:
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
203 *x = FRAME_RIGHT_BORDER_START (f)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
204 - FRAME_RIGHT_GUTTER_BOUNDS (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
205 *y = WINDOW_TEXT_TOP (top);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
206 *width = FRAME_RIGHT_GUTTER_BOUNDS (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
207 *height = WINDOW_BOTTOM (bot)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
208 - (WINDOW_TEXT_TOP (top)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
209 + FRAME_BOTTOM_GUTTER_BOUNDS (f));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
210 break;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
211
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
212 default:
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
213 abort ();
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
214 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
215 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
216
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
217 static void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
218 output_gutter (struct frame *f, enum gutter_pos pos)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
219 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
220 Lisp_Object frame;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
221 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
222 struct device *d = XDEVICE (f->device);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
223 struct window* w = XWINDOW (window);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
224 int x, y, width, height, ypos;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
225 int line;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
226 int border_width = FRAME_GUTTER_BORDER_WIDTH (f, pos);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
227 face_index findex = get_builtin_face_cache_index (w, Vgui_element_face);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
228 display_line_dynarr* ddla, *cdla;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
229 struct display_line *dl;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
230 int cdla_len;
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
231
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
232 if (!f->current_display_lines)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
233 f->current_display_lines = Dynarr_new (display_line);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
234 if (!f->desired_display_lines)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
235 f->desired_display_lines = Dynarr_new (display_line);
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
236
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
237 ddla = f->desired_display_lines;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
238 cdla = f->current_display_lines;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
239 cdla_len = Dynarr_length (cdla);
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
240
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
241 XSETFRAME (frame, f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
242
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
243 get_gutter_coords (f, pos, &x, &y, &width, &height);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
244 /* generate some display lines */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
245 generate_displayable_area (w, WINDOW_GUTTER (w, pos),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
246 x + border_width, y + border_width,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
247 width - 2 * border_width,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
248 height - 2 * border_width, ddla, 0, findex);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
249 /* Output each line. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
250 for (line = 0; line < Dynarr_length (ddla); line++)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
251 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
252 output_display_line (w, cdla, ddla, line, -1, -1);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
253 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
254
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
255 /* If the number of display lines has shrunk, adjust. */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
256 if (cdla_len > Dynarr_length (ddla))
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
257 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
258 Dynarr_length (cdla) = Dynarr_length (ddla);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
259 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
260
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
261 /* grab coordinates of last line and blank after it. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
262 dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
263 ypos = dl->ypos + dl->descent - dl->clip;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
264 redisplay_clear_region (window, findex, x + border_width , ypos,
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
265 width - 2 * border_width, height - (ypos - y) - border_width);
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
266 /* bevel the gutter area if so desired */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
267 if (border_width != 0)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
268 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
269 MAYBE_DEVMETH (d, bevel_area,
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
270 (w, findex, x, y, width, height, border_width,
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
271 EDGE_ALL, EDGE_BEVEL_OUT));
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
272 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
273 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
274
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
275 /* sizing gutters is a pain so we try and help the user by detemining
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
276 what height will accommodate all lines. This is useless on left and
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
277 right gutters as we always have a maximal number of lines. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
278 static Lisp_Object
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
279 calculate_gutter_size (struct window *w, enum gutter_pos pos)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
280 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
281 struct frame* f = XFRAME (WINDOW_FRAME (w));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
282 int ypos;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
283 display_line_dynarr* ddla;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
284 struct display_line *dl;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
285
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
286 /* we cannot autodetect gutter sizes for the left and right as there
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
287 is no reasonable metric to use */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
288 assert (pos == TOP_GUTTER || pos == BOTTOM_GUTTER);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
289 /* degenerate case */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
290 if (NILP (WINDOW_GUTTER (w, pos))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
291 ||
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
292 !FRAME_VISIBLE_P (f)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
293 ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
294 NILP (w->buffer))
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
295 return Qnil;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
296
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
297 ddla = Dynarr_new (display_line);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
298 /* generate some display lines */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
299 generate_displayable_area (w, WINDOW_GUTTER (w, pos),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
300 FRAME_LEFT_BORDER_END (f),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
301 0,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
302 FRAME_RIGHT_BORDER_START (f)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
303 - FRAME_LEFT_BORDER_END (f),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
304 200,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
305 ddla, 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
306 /* grab coordinates of last line */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
307 if (Dynarr_length (ddla))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
308 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
309 dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
310 ypos = dl->ypos + dl->descent - dl->clip;
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
311 free_display_lines (ddla);
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
312 return make_int (ypos);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
313 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
314 else
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
315 {
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
316 free_display_lines (ddla);
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
317 return Qnil;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
318 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
319 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
320
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
321 static void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
322 clear_gutter (struct frame *f, enum gutter_pos pos)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
323 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
324 int x, y, width, height;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
325 Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
326 face_index findex = get_builtin_face_cache_index (XWINDOW (window),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
327 Vgui_element_face);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
328 get_gutter_coords (f, pos, &x, &y, &width, &height);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
329
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
330 SET_GUTTER_WAS_VISIBLE_FLAG (f, pos, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
331
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
332 redisplay_clear_region (window, findex, x, y, width, height);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
333 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
334
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
335 void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
336 update_frame_gutters (struct frame *f)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
337 {
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
338 if (f->gutter_changed || f->clear ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
339 f->glyphs_changed || f->subwindows_changed ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
340 f->windows_changed || f->windows_structure_changed ||
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
341 f->extents_changed || f->faces_changed)
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
342 {
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
343 enum gutter_pos pos;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
344
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
345 /* We don't actually care about these when outputting the gutter
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
346 so locally disable them. */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
347 int local_clip_changed = f->clip_changed;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
348 int local_buffers_changed = f->buffers_changed;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
349 f->clip_changed = 0;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
350 f->buffers_changed = 0;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
351
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
352 /* and output */
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
353 GUTTER_POS_LOOP (pos)
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
354 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
355 if (FRAME_GUTTER_VISIBLE (f, pos))
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
356 output_gutter (f, pos);
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
357 else if (gutter_was_visible (f, pos))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
358 clear_gutter (f, pos);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
359 }
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
360 f->clip_changed = local_clip_changed;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
361 f->buffers_changed = local_buffers_changed;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
362 f->gutter_changed = 0;
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
363 }
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
364 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
365
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
366 void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
367 reset_gutter_display_lines (struct frame* f)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
368 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
369 if (f->current_display_lines)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
370 Dynarr_reset (f->current_display_lines);
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
371 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
372
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
373 static void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
374 redraw_exposed_gutter (struct frame *f, enum gutter_pos pos, int x, int y,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
375 int width, int height)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
376 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
377 int g_x, g_y, g_width, g_height;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
378
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
379 get_gutter_coords (f, pos, &g_x, &g_y, &g_width, &g_height);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
380
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
381 if (((y + height) < g_y) || (y > (g_y + g_height)) || !height || !width || !g_height || !g_width)
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
382 return;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
383 if (((x + width) < g_x) || (x > (g_x + g_width)))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
384 return;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
385
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
386 /* #### optimize this - redrawing the whole gutter for every expose
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
387 is very expensive. We reset the current display lines because if
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
388 they're being exposed they are no longer current. */
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
389 reset_gutter_display_lines (f);
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
390
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
391 /* Even if none of the gutter is in the area, the blank region at
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
392 the very least must be because the first thing we did is verify
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
393 that some portion of the gutter is in the exposed region. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
394 output_gutter (f, pos);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
395 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
396
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
397 void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
398 redraw_exposed_gutters (struct frame *f, int x, int y, int width,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
399 int height)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
400 {
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
401 enum gutter_pos pos;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
402 GUTTER_POS_LOOP (pos)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
403 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
404 if (FRAME_GUTTER_VISIBLE (f, pos))
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
405 redraw_exposed_gutter (f, pos, x, y, width, height);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
406 }
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
407 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
408
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
409 void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
410 free_frame_gutters (struct frame *f)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
411 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
412 if (f->current_display_lines)
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
413 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
414 free_display_lines (f->current_display_lines);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
415 f->current_display_lines = 0;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
416 }
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
417 if (f->desired_display_lines)
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
418 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
419 free_display_lines (f->desired_display_lines);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
420 f->desired_display_lines = 0;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
421 }
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
422 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
423
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
424 static enum gutter_pos
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
425 decode_gutter_position (Lisp_Object position)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
426 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
427 if (EQ (position, Qtop)) return TOP_GUTTER;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
428 if (EQ (position, Qbottom)) return BOTTOM_GUTTER;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
429 if (EQ (position, Qleft)) return LEFT_GUTTER;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
430 if (EQ (position, Qright)) return RIGHT_GUTTER;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
431 signal_simple_error ("Invalid gutter position", position);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
432
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
433 return TOP_GUTTER; /* not reached */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
434 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
435
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
436 DEFUN ("set-default-gutter-position", Fset_default_gutter_position, 1, 1, 0, /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
437 Set the position that the `default-gutter' will be displayed at.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
438 Valid positions are 'top, 'bottom, 'left and 'right.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
439 See `default-gutter-position'.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
440 */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
441 (position))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
442 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
443 enum gutter_pos cur = decode_gutter_position (Vdefault_gutter_position);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
444 enum gutter_pos new = decode_gutter_position (position);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
445
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
446 if (cur != new)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
447 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
448 /* The following calls will automatically cause the dirty
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
449 flags to be set; we delay frame size changes to avoid
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
450 lots of frame flickering. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
451 /* #### I think this should be GC protected. -sb */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
452 hold_frame_size_changes ();
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
453 set_specifier_fallback (Vgutter[cur], list1 (Fcons (Qnil, Qnil)));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
454 set_specifier_fallback (Vgutter[new], Vdefault_gutter);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
455 set_specifier_fallback (Vgutter_size[cur], list1 (Fcons (Qnil, Qzero)));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
456 set_specifier_fallback (Vgutter_size[new],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
457 new == TOP_GUTTER || new == BOTTOM_GUTTER
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
458 ? Vdefault_gutter_height
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
459 : Vdefault_gutter_width);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
460 set_specifier_fallback (Vgutter_border_width[cur],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
461 list1 (Fcons (Qnil, Qzero)));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
462 set_specifier_fallback (Vgutter_border_width[new],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
463 Vdefault_gutter_border_width);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
464 set_specifier_fallback (Vgutter_visible_p[cur],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
465 list1 (Fcons (Qnil, Qt)));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
466 set_specifier_fallback (Vgutter_visible_p[new],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
467 Vdefault_gutter_visible_p);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
468 Vdefault_gutter_position = position;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
469 unhold_frame_size_changes ();
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
470 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
471
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
472 return position;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
473 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
474
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
475 DEFUN ("default-gutter-position", Fdefault_gutter_position, 0, 0, 0, /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
476 Return the position that the `default-gutter' will be displayed at.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
477 The `default-gutter' will only be displayed here if the corresponding
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
478 position-specific gutter specifier does not provide a value.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
479 */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
480 ())
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
481 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
482 return Vdefault_gutter_position;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
483 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
484
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
485 DEFUN ("gutter-pixel-width", Fgutter_pixel_width, 0, 2, 0, /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
486 Return the pixel width of the gutter at POS in LOCALE.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
487 POS defaults to the default gutter position. LOCALE defaults to
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
488 the current window.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
489 */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
490 (pos, locale))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
491 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
492 int x, y, width, height;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
493 enum gutter_pos p = TOP_GUTTER;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
494 struct frame *f = decode_frame (FW_FRAME (locale));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
495
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
496 if (NILP (pos))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
497 pos = Vdefault_gutter_position;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
498 p = decode_gutter_position (pos);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
499
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
500 get_gutter_coords (f, p, &x, &y, &width, &height);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
501 width -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
502
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
503 return make_int (width);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
504 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
505
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
506 DEFUN ("gutter-pixel-height", Fgutter_pixel_height, 0, 2, 0, /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
507 Return the pixel height of the gutter at POS in LOCALE.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
508 POS defaults to the default gutter position. LOCALE defaults to
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
509 the current window.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
510 */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
511 (pos, locale))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
512 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
513 int x, y, width, height;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
514 enum gutter_pos p = TOP_GUTTER;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
515 struct frame *f = decode_frame (FW_FRAME (locale));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
516
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
517 if (NILP (pos))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
518 pos = Vdefault_gutter_position;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
519 p = decode_gutter_position (pos);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
520
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
521 get_gutter_coords (f, p, &x, &y, &width, &height);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
522 height -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
523
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
524 return make_int (height);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
525 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
526
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
527 DEFINE_SPECIFIER_TYPE (gutter);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
528
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
529 static void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
530 gutter_after_change (Lisp_Object specifier, Lisp_Object locale)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
531 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
532 MARK_GUTTER_CHANGED;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
533 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
534
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
535 static void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
536 gutter_validate (Lisp_Object instantiator)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
537 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
538 if (NILP (instantiator))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
539 return;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
540
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
541 if (!STRINGP (instantiator))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
542 signal_simple_error ("Gutter spec must be string or nil", instantiator);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
543 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
544
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
545 DEFUN ("gutter-specifier-p", Fgutter_specifier_p, 1, 1, 0, /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
546 Return non-nil if OBJECT is a gutter specifier.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
547 Gutter specifiers are used to specify the format of a gutter.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
548 The values of the variables `default-gutter', `top-gutter',
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
549 `left-gutter', `right-gutter', and `bottom-gutter' are always
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
550 gutter specifiers.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
551
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
552 Valid gutter instantiators are called "gutter descriptors"
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
553 and are lists of vectors. See `default-gutter' for a description
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
554 of the exact format.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
555 */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
556 (object))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
557 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
558 return GUTTER_SPECIFIERP (object) ? Qt : Qnil;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
559 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
560
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
561
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
562 /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
563 Helper for invalidating the real specifier when default
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
564 specifier caching changes
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
565 */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
566 static void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
567 recompute_overlaying_specifier (Lisp_Object real_one[4])
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
568 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
569 enum gutter_pos pos = decode_gutter_position (Vdefault_gutter_position);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
570 Fset_specifier_dirty_flag (real_one[pos]);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
571 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
572
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
573 static void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
574 gutter_specs_changed (Lisp_Object specifier, struct window *w,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
575 Lisp_Object oldval)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
576 {
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
577 enum gutter_pos pos;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
578 GUTTER_POS_LOOP (pos)
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
579 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
580 w->real_gutter_size[pos] = w->gutter_size[pos];
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
581 if (EQ (w->real_gutter_size[pos], Qautodetect)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
582 && !NILP (w->gutter_visible_p[pos]))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
583 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
584 w->real_gutter_size [pos] = calculate_gutter_size (w, pos);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
585 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
586 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
587 MARK_GUTTER_CHANGED;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
588 MARK_WINDOWS_CHANGED (w);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
589 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
590
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
591 static void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
592 default_gutter_specs_changed (Lisp_Object specifier, struct window *w,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
593 Lisp_Object oldval)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
594 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
595 recompute_overlaying_specifier (Vgutter);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
596 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
597
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
598 static void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
599 gutter_geometry_changed_in_window (Lisp_Object specifier, struct window *w,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
600 Lisp_Object oldval)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
601 {
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
602 enum gutter_pos pos;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
603 GUTTER_POS_LOOP (pos)
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
604 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
605 w->real_gutter_size[pos] = w->gutter_size[pos];
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
606 if (EQ (w->real_gutter_size[pos], Qautodetect)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
607 && !NILP (w->gutter_visible_p[pos]))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
608 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
609 w->real_gutter_size [pos] = calculate_gutter_size (w, pos);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
610 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
611 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
612
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
613 MARK_GUTTER_CHANGED;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
614 MARK_WINDOWS_CHANGED (w);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
615 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
616
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
617 static void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
618 default_gutter_size_changed_in_window (Lisp_Object specifier, struct window *w,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
619 Lisp_Object oldval)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
620 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
621 recompute_overlaying_specifier (Vgutter_size);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
622 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
623
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
624 static void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
625 default_gutter_border_width_changed_in_window (Lisp_Object specifier,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
626 struct window *w,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
627 Lisp_Object oldval)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
628 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
629 recompute_overlaying_specifier (Vgutter_border_width);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
630 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
631
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
632 static void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
633 default_gutter_visible_p_changed_in_window (Lisp_Object specifier,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
634 struct window *w,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
635 Lisp_Object oldval)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
636 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
637 recompute_overlaying_specifier (Vgutter_visible_p);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
638 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
639
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
640
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
641 DECLARE_SPECIFIER_TYPE (gutter_size);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
642 #define GUTTER_SIZE_SPECIFIERP(x) SPECIFIER_TYPEP (x, gutter_size)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
643 DEFINE_SPECIFIER_TYPE (gutter_size);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
644
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
645 static void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
646 gutter_size_validate (Lisp_Object instantiator)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
647 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
648 if (NILP (instantiator))
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
649 return;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
650
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
651 if (!INTP (instantiator) && !EQ (instantiator, Qautodetect))
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
652 signal_simple_error ("Gutter size must be an integer or 'autodetect", instantiator);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
653 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
654
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
655 DEFUN ("gutter-size-specifier-p", Fgutter_size_specifier_p, 1, 1, 0, /*
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
656 Return non-nil if OBJECT is a gutter-size specifier.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
657 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
658 (object))
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
659 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
660 return GUTTER_SIZE_SPECIFIERP (object) ? Qt : Qnil;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
661 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
662
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
663 DEFUN ("redisplay-gutter-area", Fredisplay_gutter_area, 0, 0, 0, /*
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
664 Ensure that all gutters are correctly showing their gutter specifier.
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
665 */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
666 ())
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
667 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
668 Lisp_Object devcons, concons;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
669
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
670 DEVICE_LOOP_NO_BREAK (devcons, concons)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
671 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
672 struct device *d = XDEVICE (XCAR (devcons));
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
673 Lisp_Object frmcons;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
674
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
675 DEVICE_FRAME_LOOP (frmcons, d)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
676 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
677 struct frame *f = XFRAME (XCAR (frmcons));
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
678
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
679 if (FRAME_REPAINT_P (f))
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
680 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
681 update_frame_gutters (f);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
682 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
683 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
684
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
685 /* We now call the output_end routine for tty frames. We delay
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
686 doing so in order to avoid cursor flicker. So much for 100%
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
687 encapsulation. */
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
688 if (DEVICE_TTY_P (d))
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
689 DEVMETH (d, output_end, (d));
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
690 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
691
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
692 return Qnil;
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
693 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
694
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
695 void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
696 init_frame_gutters (struct frame *f)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
697 {
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
698 enum gutter_pos pos;
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
699 struct window* w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
700 /* We are here as far in frame creation so cached specifiers are
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
701 already recomputed, and possibly modified by resource
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
702 initialization. We need to recalculate autodetected gutters. */
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
703 GUTTER_POS_LOOP (pos)
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
704 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
705 w->real_gutter_size[pos] = w->gutter_size[pos];
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
706 if (EQ (w->gutter_size[pos], Qautodetect)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
707 && !NILP (w->gutter_visible_p[pos]))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
708 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
709 w->real_gutter_size [pos] = calculate_gutter_size (w, pos);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
710 MARK_GUTTER_CHANGED;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
711 MARK_WINDOWS_CHANGED (w);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
712 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
713 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
714 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
715
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
716 void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
717 syms_of_gutter (void)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
718 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
719 DEFSUBR (Fgutter_specifier_p);
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
720 DEFSUBR (Fgutter_size_specifier_p);
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
721 DEFSUBR (Fset_default_gutter_position);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
722 DEFSUBR (Fdefault_gutter_position);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
723 DEFSUBR (Fgutter_pixel_height);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
724 DEFSUBR (Fgutter_pixel_width);
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
725 DEFSUBR (Fredisplay_gutter_area);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
726
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
727 defsymbol (&Qgutter_size, "gutter-size");
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
728 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
729
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
730 void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
731 vars_of_gutter (void)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
732 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
733 staticpro (&Vdefault_gutter_position);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
734 Vdefault_gutter_position = Qtop;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
735
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
736 Fprovide (Qgutter);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
737 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
738
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
739 void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
740 specifier_type_create_gutter (void)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
741 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
742 INITIALIZE_SPECIFIER_TYPE (gutter, "gutter", "gutter-specifier-p");
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
743
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
744 SPECIFIER_HAS_METHOD (gutter, validate);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
745 SPECIFIER_HAS_METHOD (gutter, after_change);
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
746
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
747 INITIALIZE_SPECIFIER_TYPE (gutter_size, "gutter-size", "gutter-size-specifier-p");
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
748
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
749 SPECIFIER_HAS_METHOD (gutter_size, validate);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
750 }
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
751
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
752 void
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
753 reinit_specifier_type_create_gutter (void)
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
754 {
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
755 REINITIALIZE_SPECIFIER_TYPE (gutter);
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
756 REINITIALIZE_SPECIFIER_TYPE (gutter_size);
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
757 }
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
758
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
759 void
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
760 specifier_vars_of_gutter (void)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
761 {
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
762 Lisp_Object fb;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
763
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
764 DEFVAR_SPECIFIER ("default-gutter", &Vdefault_gutter /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
765 Specifier for a fallback gutter.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
766 Use `set-specifier' to change this.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
767
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
768 The position of this gutter is specified in the function
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
769 `default-gutter-position'. If the corresponding position-specific
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
770 gutter (e.g. `top-gutter' if `default-gutter-position' is 'top)
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
771 does not specify a gutter in a particular domain (usually a window),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
772 then the value of `default-gutter' in that domain, if any, will be
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
773 used instead.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
774
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
775 Note that the gutter at any particular position will not be
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
776 displayed unless its visibility flag is true and its thickness
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
777 \(width or height, depending on orientation) is non-zero. The
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
778 visibility is controlled by the specifiers `top-gutter-visible-p',
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
779 `bottom-gutter-visible-p', `left-gutter-visible-p', and
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
780 `right-gutter-visible-p', and the thickness is controlled by the
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
781 specifiers `top-gutter-height', `bottom-gutter-height',
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
782 `left-gutter-width', and `right-gutter-width'.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
783
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
784 Note that one of the four visibility specifiers inherits from
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
785 `default-gutter-visibility' and one of the four thickness
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
786 specifiers inherits from either `default-gutter-width' or
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
787 `default-gutter-height' (depending on orientation), just
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
788 like for the gutter description specifiers (e.g. `top-gutter')
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
789 mentioned above.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
790
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
791 Therefore, if you are setting `default-gutter', you should control
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
792 the visibility and thickness using `default-gutter-visible-p',
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
793 `default-gutter-width', and `default-gutter-height', rather than
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
794 using position-specific specifiers. That way, you will get sane
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
795 behavior if the user changes the default gutter position.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
796
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
797 The gutter value should be a string or nil. You can attach extents and
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
798 glyphs to the string and hence display glyphs and text in other fonts
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
799 in the gutter area.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
800
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
801 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
802
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
803 Vdefault_gutter = Fmake_specifier (Qgutter);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
804 /* #### It would be even nicer if the specifier caching
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
805 automatically knew about specifier fallbacks, so we didn't
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
806 have to do it ourselves. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
807 set_specifier_caching (Vdefault_gutter,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
808 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
809 default_gutter),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
810 default_gutter_specs_changed,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
811 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
812
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
813 DEFVAR_SPECIFIER ("top-gutter",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
814 &Vgutter[TOP_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
815 Specifier for the gutter at the top of the frame.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
816 Use `set-specifier' to change this.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
817 See `default-gutter' for a description of a valid gutter instantiator.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
818 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
819 Vgutter[TOP_GUTTER] = Fmake_specifier (Qgutter);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
820 set_specifier_caching (Vgutter[TOP_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
821 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
822 gutter[TOP_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
823 gutter_specs_changed,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
824 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
825
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
826 DEFVAR_SPECIFIER ("bottom-gutter",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
827 &Vgutter[BOTTOM_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
828 Specifier for the gutter at the bottom of the frame.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
829 Use `set-specifier' to change this.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
830 See `default-gutter' for a description of a valid gutter instantiator.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
831
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
832 Note that, unless the `default-gutter-position' is `bottom', by
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
833 default the height of the bottom gutter (controlled by
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
834 `bottom-gutter-height') is 0; thus, a bottom gutter will not be
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
835 displayed even if you provide a value for `bottom-gutter'.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
836 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
837 Vgutter[BOTTOM_GUTTER] = Fmake_specifier (Qgutter);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
838 set_specifier_caching (Vgutter[BOTTOM_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
839 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
840 gutter[BOTTOM_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
841 gutter_specs_changed,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
842 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
843
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
844 DEFVAR_SPECIFIER ("left-gutter",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
845 &Vgutter[LEFT_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
846 Specifier for the gutter at the left edge of the frame.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
847 Use `set-specifier' to change this.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
848 See `default-gutter' for a description of a valid gutter instantiator.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
849
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
850 Note that, unless the `default-gutter-position' is `left', by
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
851 default the height of the left gutter (controlled by
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
852 `left-gutter-width') is 0; thus, a left gutter will not be
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
853 displayed even if you provide a value for `left-gutter'.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
854 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
855 Vgutter[LEFT_GUTTER] = Fmake_specifier (Qgutter);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
856 set_specifier_caching (Vgutter[LEFT_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
857 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
858 gutter[LEFT_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
859 gutter_specs_changed,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
860 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
861
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
862 DEFVAR_SPECIFIER ("right-gutter",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
863 &Vgutter[RIGHT_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
864 Specifier for the gutter at the right edge of the frame.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
865 Use `set-specifier' to change this.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
866 See `default-gutter' for a description of a valid gutter instantiator.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
867
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
868 Note that, unless the `default-gutter-position' is `right', by
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
869 default the height of the right gutter (controlled by
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
870 `right-gutter-width') is 0; thus, a right gutter will not be
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
871 displayed even if you provide a value for `right-gutter'.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
872 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
873 Vgutter[RIGHT_GUTTER] = Fmake_specifier (Qgutter);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
874 set_specifier_caching (Vgutter[RIGHT_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
875 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
876 gutter[RIGHT_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
877 gutter_specs_changed,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
878 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
879
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
880 /* initially, top inherits from default; this can be
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
881 changed with `set-default-gutter-position'. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
882 fb = list1 (Fcons (Qnil, Qnil));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
883 set_specifier_fallback (Vdefault_gutter, fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
884 set_specifier_fallback (Vgutter[TOP_GUTTER], Vdefault_gutter);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
885 set_specifier_fallback (Vgutter[BOTTOM_GUTTER], fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
886 set_specifier_fallback (Vgutter[LEFT_GUTTER], fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
887 set_specifier_fallback (Vgutter[RIGHT_GUTTER], fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
888
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
889 DEFVAR_SPECIFIER ("default-gutter-height", &Vdefault_gutter_height /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
890 *Height of the default gutter, if it's oriented horizontally.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
891 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
892
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
893 The position of the default gutter is specified by the function
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
894 `set-default-gutter-position'. If the corresponding position-specific
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
895 gutter thickness specifier (e.g. `top-gutter-height' if
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
896 `default-gutter-position' is 'top) does not specify a thickness in a
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
897 particular domain (a window or a frame), then the value of
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
898 `default-gutter-height' or `default-gutter-width' (depending on the
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
899 gutter orientation) in that domain, if any, will be used instead.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
900
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
901 Note that `default-gutter-height' is only used when
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
902 `default-gutter-position' is 'top or 'bottom, and `default-gutter-width'
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
903 is only used when `default-gutter-position' is 'left or 'right.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
904
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
905 Note that all of the position-specific gutter thickness specifiers
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
906 have a fallback value of zero when they do not correspond to the
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
907 default gutter. Therefore, you will have to set a non-zero thickness
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
908 value if you want a position-specific gutter to be displayed.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
909
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
910 If you set the height to 'autodetect the size of the gutter will be
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
911 calculated to be large enough to hold the contents of the gutter. This
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
912 is the default.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
913 */ );
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
914 Vdefault_gutter_height = Fmake_specifier (Qgutter_size);
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
915 set_specifier_caching (Vdefault_gutter_height,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
916 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
917 default_gutter_height),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
918 default_gutter_size_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
919 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
920
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
921 DEFVAR_SPECIFIER ("default-gutter-width", &Vdefault_gutter_width /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
922 *Width of the default gutter, if it's oriented vertically.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
923 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
924
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
925 See `default-gutter-height' for more information.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
926 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
927 Vdefault_gutter_width = Fmake_specifier (Qnatnum);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
928 set_specifier_caching (Vdefault_gutter_width,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
929 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
930 default_gutter_width),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
931 default_gutter_size_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
932 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
933
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
934 DEFVAR_SPECIFIER ("top-gutter-height",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
935 &Vgutter_size[TOP_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
936 *Height of the top gutter.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
937 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
938
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
939 See `default-gutter-height' for more information.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
940 */ );
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
941 Vgutter_size[TOP_GUTTER] = Fmake_specifier (Qgutter_size);
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
942 set_specifier_caching (Vgutter_size[TOP_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
943 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
944 gutter_size[TOP_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
945 gutter_geometry_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
946 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
947
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
948 DEFVAR_SPECIFIER ("bottom-gutter-height",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
949 &Vgutter_size[BOTTOM_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
950 *Height of the bottom gutter.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
951 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
952
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
953 See `default-gutter-height' for more information.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
954 */ );
424
11054d720c21 Import from CVS: tag r21-2-20
cvs
parents: 422
diff changeset
955 Vgutter_size[BOTTOM_GUTTER] = Fmake_specifier (Qgutter_size);
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
956 set_specifier_caching (Vgutter_size[BOTTOM_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
957 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
958 gutter_size[BOTTOM_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
959 gutter_geometry_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
960 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
961
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
962 DEFVAR_SPECIFIER ("left-gutter-width",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
963 &Vgutter_size[LEFT_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
964 *Width of left gutter.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
965 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
966
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
967 See `default-gutter-height' for more information.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
968 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
969 Vgutter_size[LEFT_GUTTER] = Fmake_specifier (Qnatnum);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
970 set_specifier_caching (Vgutter_size[LEFT_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
971 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
972 gutter_size[LEFT_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
973 gutter_geometry_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
974 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
975
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
976 DEFVAR_SPECIFIER ("right-gutter-width",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
977 &Vgutter_size[RIGHT_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
978 *Width of right gutter.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
979 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
980
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
981 See `default-gutter-height' for more information.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
982 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
983 Vgutter_size[RIGHT_GUTTER] = Fmake_specifier (Qnatnum);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
984 set_specifier_caching (Vgutter_size[RIGHT_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
985 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
986 gutter_size[RIGHT_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
987 gutter_geometry_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
988 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
989
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
990 fb = Qnil;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
991 #ifdef HAVE_TTY
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
992 fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
993 #endif
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
994 #ifdef HAVE_X_WINDOWS
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
995 fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
996 #endif
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
997 #ifdef HAVE_MS_WINDOWS
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
998 fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
999 #endif
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1000 if (!NILP (fb))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1001 set_specifier_fallback (Vdefault_gutter_height, fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1002
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1003 fb = Qnil;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1004 #ifdef HAVE_TTY
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1005 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1006 #endif
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1007 #ifdef HAVE_X_WINDOWS
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1008 fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_GUTTER_WIDTH)), fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1009 #endif
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1010 #ifdef HAVE_MS_WINDOWS
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1011 fb = Fcons (Fcons (list1 (Qmswindows),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1012 make_int (DEFAULT_GUTTER_WIDTH)), fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1013 #endif
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1014 if (!NILP (fb))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1015 set_specifier_fallback (Vdefault_gutter_width, fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1016
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1017 set_specifier_fallback (Vgutter_size[TOP_GUTTER], Vdefault_gutter_height);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1018 fb = list1 (Fcons (Qnil, Qzero));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1019 set_specifier_fallback (Vgutter_size[BOTTOM_GUTTER], fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1020 set_specifier_fallback (Vgutter_size[LEFT_GUTTER], fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1021 set_specifier_fallback (Vgutter_size[RIGHT_GUTTER], fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1022
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1023 DEFVAR_SPECIFIER ("default-gutter-border-width",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1024 &Vdefault_gutter_border_width /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1025 *Width of the border around the default gutter.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1026 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1027
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1028 The position of the default gutter is specified by the function
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1029 `set-default-gutter-position'. If the corresponding position-specific
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1030 gutter border width specifier (e.g. `top-gutter-border-width' if
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1031 `default-gutter-position' is 'top) does not specify a border width in a
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1032 particular domain (a window or a frame), then the value of
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1033 `default-gutter-border-width' in that domain, if any, will be used
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1034 instead.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1035
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1036 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1037 Vdefault_gutter_border_width = Fmake_specifier (Qnatnum);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1038 set_specifier_caching (Vdefault_gutter_border_width,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1039 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1040 default_gutter_border_width),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1041 default_gutter_border_width_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1042 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1043
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1044 DEFVAR_SPECIFIER ("top-gutter-border-width",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1045 &Vgutter_border_width[TOP_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1046 *Border width of the top gutter.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1047 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1048
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1049 See `default-gutter-height' for more information.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1050 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1051 Vgutter_border_width[TOP_GUTTER] = Fmake_specifier (Qnatnum);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1052 set_specifier_caching (Vgutter_border_width[TOP_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1053 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1054 gutter_border_width[TOP_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1055 gutter_geometry_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1056 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1057
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1058 DEFVAR_SPECIFIER ("bottom-gutter-border-width",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1059 &Vgutter_border_width[BOTTOM_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1060 *Border width of the bottom gutter.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1061 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1062
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1063 See `default-gutter-height' for more information.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1064 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1065 Vgutter_border_width[BOTTOM_GUTTER] = Fmake_specifier (Qnatnum);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1066 set_specifier_caching (Vgutter_border_width[BOTTOM_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1067 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1068 gutter_border_width[BOTTOM_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1069 gutter_geometry_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1070 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1071
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1072 DEFVAR_SPECIFIER ("left-gutter-border-width",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1073 &Vgutter_border_width[LEFT_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1074 *Border width of left gutter.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1075 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1076
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1077 See `default-gutter-height' for more information.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1078 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1079 Vgutter_border_width[LEFT_GUTTER] = Fmake_specifier (Qnatnum);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1080 set_specifier_caching (Vgutter_border_width[LEFT_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1081 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1082 gutter_border_width[LEFT_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1083 gutter_geometry_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1084 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1085
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1086 DEFVAR_SPECIFIER ("right-gutter-border-width",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1087 &Vgutter_border_width[RIGHT_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1088 *Border width of right gutter.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1089 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1090
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1091 See `default-gutter-height' for more information.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1092 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1093 Vgutter_border_width[RIGHT_GUTTER] = Fmake_specifier (Qnatnum);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1094 set_specifier_caching (Vgutter_border_width[RIGHT_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1095 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1096 gutter_border_width[RIGHT_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1097 gutter_geometry_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1098 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1099
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1100 fb = Qnil;
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1101 #ifdef HAVE_TTY
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1102 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1103 #endif
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1104 #ifdef HAVE_X_WINDOWS
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1105 fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1106 #endif
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1107 #ifdef HAVE_MS_WINDOWS
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1108 fb = Fcons (Fcons (list1 (Qmswindows), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1109 #endif
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1110 if (!NILP (fb))
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1111 set_specifier_fallback (Vdefault_gutter_border_width, fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1112
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1113 set_specifier_fallback (Vgutter_border_width[TOP_GUTTER], Vdefault_gutter_border_width);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1114 fb = list1 (Fcons (Qnil, Qzero));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1115 set_specifier_fallback (Vgutter_border_width[BOTTOM_GUTTER], fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1116 set_specifier_fallback (Vgutter_border_width[LEFT_GUTTER], fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1117 set_specifier_fallback (Vgutter_border_width[RIGHT_GUTTER], fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1118
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1119 DEFVAR_SPECIFIER ("default-gutter-visible-p", &Vdefault_gutter_visible_p /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1120 *Whether the default gutter is visible.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1121 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1122
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1123 The position of the default gutter is specified by the function
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1124 `set-default-gutter-position'. If the corresponding position-specific
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1125 gutter visibility specifier (e.g. `top-gutter-visible-p' if
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1126 `default-gutter-position' is 'top) does not specify a visible-p value
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1127 in a particular domain (a window or a frame), then the value of
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1128 `default-gutter-visible-p' in that domain, if any, will be used
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1129 instead.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1130
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1131 `default-gutter-visible-p' and all of the position-specific gutter
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1132 visibility specifiers have a fallback value of true.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1133 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1134 Vdefault_gutter_visible_p = Fmake_specifier (Qboolean);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1135 set_specifier_caching (Vdefault_gutter_visible_p,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1136 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1137 default_gutter_visible_p),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1138 default_gutter_visible_p_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1139 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1140
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1141 DEFVAR_SPECIFIER ("top-gutter-visible-p",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1142 &Vgutter_visible_p[TOP_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1143 *Whether the top gutter is visible.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1144 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1145
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1146 See `default-gutter-visible-p' for more information.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1147 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1148 Vgutter_visible_p[TOP_GUTTER] = Fmake_specifier (Qboolean);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1149 set_specifier_caching (Vgutter_visible_p[TOP_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1150 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1151 gutter_visible_p[TOP_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1152 gutter_geometry_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1153 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1154
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1155 DEFVAR_SPECIFIER ("bottom-gutter-visible-p",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1156 &Vgutter_visible_p[BOTTOM_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1157 *Whether the bottom gutter is visible.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1158 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1159
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1160 See `default-gutter-visible-p' for more information.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1161 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1162 Vgutter_visible_p[BOTTOM_GUTTER] = Fmake_specifier (Qboolean);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1163 set_specifier_caching (Vgutter_visible_p[BOTTOM_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1164 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1165 gutter_visible_p[BOTTOM_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1166 gutter_geometry_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1167 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1168
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1169 DEFVAR_SPECIFIER ("left-gutter-visible-p",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1170 &Vgutter_visible_p[LEFT_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1171 *Whether the left gutter is visible.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1172 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1173
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1174 See `default-gutter-visible-p' for more information.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1175 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1176 Vgutter_visible_p[LEFT_GUTTER] = Fmake_specifier (Qboolean);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1177 set_specifier_caching (Vgutter_visible_p[LEFT_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1178 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1179 gutter_visible_p[LEFT_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1180 gutter_geometry_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1181 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1182
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1183 DEFVAR_SPECIFIER ("right-gutter-visible-p",
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1184 &Vgutter_visible_p[RIGHT_GUTTER] /*
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1185 *Whether the right gutter is visible.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1186 This is a specifier; use `set-specifier' to change it.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1187
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1188 See `default-gutter-visible-p' for more information.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1189 */ );
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1190 Vgutter_visible_p[RIGHT_GUTTER] = Fmake_specifier (Qboolean);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1191 set_specifier_caching (Vgutter_visible_p[RIGHT_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1192 slot_offset (struct window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1193 gutter_visible_p[RIGHT_GUTTER]),
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1194 gutter_geometry_changed_in_window,
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1195 0, 0);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1196
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1197 /* initially, top inherits from default; this can be
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1198 changed with `set-default-gutter-position'. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1199 fb = list1 (Fcons (Qnil, Qt));
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1200 set_specifier_fallback (Vdefault_gutter_visible_p, fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1201 set_specifier_fallback (Vgutter_visible_p[TOP_GUTTER],
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1202 Vdefault_gutter_visible_p);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1203 set_specifier_fallback (Vgutter_visible_p[BOTTOM_GUTTER], fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1204 set_specifier_fallback (Vgutter_visible_p[LEFT_GUTTER], fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1205 set_specifier_fallback (Vgutter_visible_p[RIGHT_GUTTER], fb);
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1206
95016f13131a Import from CVS: tag r21-2-19
cvs
parents:
diff changeset
1207 }