aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog16
-rw-r--r--src/window.c51
-rw-r--r--src/window.h24
3 files changed, 50 insertions, 41 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c8735ab96ae..7c6f9c3557f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,21 @@
12013-08-13 Dmitry Antipov <dmantipov@yandex.ru> 12013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2 2
3 * window.h (struct window): Convert left_fringe_width
4 and right_fringe_width from Lisp_Objects to integers.
5 Adjust comment.
6 (WINDOW_FRINGE_COLS, WINDOW_LEFT_FRINGE_WIDTH)
7 (WINDOW_RIGHT_FRINGE_WIDTH): Adjust users.
8 * window.c (wset_left_fringe_width, wset_right_fringe_width):
9 Remove.
10 (make_window): Initialize new integer fields to -1.
11 (Fsplit_window_internal): Use direct assignment.
12 (Fset_window_configuration, save_window_save): Convert
13 Lisp_Object to integer and back where appropriate.
14 (Fset_window_fringes): Adjust user. Return t if any fringe
15 was actually changed, and mention this in docstring.
16
172013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
18
3 * keyboard.c (Fdiscard_input): Do not increment update_mode_lines. 19 * keyboard.c (Fdiscard_input): Do not increment update_mode_lines.
4 * nsfns.m (x_set_cursor_type): 20 * nsfns.m (x_set_cursor_type):
5 * w32fns.c (x_set_cursor_type): 21 * w32fns.c (x_set_cursor_type):
diff --git a/src/window.c b/src/window.c
index 7b5b8e4df7a..1328adcacd0 100644
--- a/src/window.c
+++ b/src/window.c
@@ -154,11 +154,6 @@ wset_display_table (struct window *w, Lisp_Object val)
154 w->display_table = val; 154 w->display_table = val;
155} 155}
156static void 156static void
157wset_left_fringe_width (struct window *w, Lisp_Object val)
158{
159 w->left_fringe_width = val;
160}
161static void
162wset_left_margin_cols (struct window *w, Lisp_Object val) 157wset_left_margin_cols (struct window *w, Lisp_Object val)
163{ 158{
164 w->left_margin_cols = val; 159 w->left_margin_cols = val;
@@ -194,11 +189,6 @@ wset_pointm (struct window *w, Lisp_Object val)
194 w->pointm = val; 189 w->pointm = val;
195} 190}
196static void 191static void
197wset_right_fringe_width (struct window *w, Lisp_Object val)
198{
199 w->right_fringe_width = val;
200}
201static void
202wset_right_margin_cols (struct window *w, Lisp_Object val) 192wset_right_margin_cols (struct window *w, Lisp_Object val)
203{ 193{
204 w->right_margin_cols = val; 194 w->right_margin_cols = val;
@@ -3484,6 +3474,7 @@ make_window (void)
3484 /* Initialize non-Lisp data. Note that allocate_window zeroes out all 3474 /* Initialize non-Lisp data. Note that allocate_window zeroes out all
3485 non-Lisp data, so do it only for slots which should not be zero. */ 3475 non-Lisp data, so do it only for slots which should not be zero. */
3486 w->nrows_scale_factor = w->ncols_scale_factor = 1; 3476 w->nrows_scale_factor = w->ncols_scale_factor = 1;
3477 w->left_fringe_width = w->right_fringe_width = -1;
3487 w->phys_cursor_type = -1; 3478 w->phys_cursor_type = -1;
3488 w->phys_cursor_width = -1; 3479 w->phys_cursor_width = -1;
3489 w->column_number_displayed = -1; 3480 w->column_number_displayed = -1;
@@ -3953,8 +3944,8 @@ set correctly. See the code of `split-window' for how this is done. */)
3953 /* Get special geometry settings from reference window. */ 3944 /* Get special geometry settings from reference window. */
3954 wset_left_margin_cols (n, r->left_margin_cols); 3945 wset_left_margin_cols (n, r->left_margin_cols);
3955 wset_right_margin_cols (n, r->right_margin_cols); 3946 wset_right_margin_cols (n, r->right_margin_cols);
3956 wset_left_fringe_width (n, r->left_fringe_width); 3947 n->left_fringe_width = r->left_fringe_width;
3957 wset_right_fringe_width (n, r->right_fringe_width); 3948 n->right_fringe_width = r->right_fringe_width;
3958 n->fringes_outside_margins = r->fringes_outside_margins; 3949 n->fringes_outside_margins = r->fringes_outside_margins;
3959 wset_scroll_bar_width (n, r->scroll_bar_width); 3950 wset_scroll_bar_width (n, r->scroll_bar_width);
3960 wset_vertical_scroll_bar_type (n, r->vertical_scroll_bar_type); 3951 wset_vertical_scroll_bar_type (n, r->vertical_scroll_bar_type);
@@ -5699,8 +5690,8 @@ the return value is nil. Otherwise the value is t. */)
5699 wset_display_table (w, p->display_table); 5690 wset_display_table (w, p->display_table);
5700 wset_left_margin_cols (w, p->left_margin_cols); 5691 wset_left_margin_cols (w, p->left_margin_cols);
5701 wset_right_margin_cols (w, p->right_margin_cols); 5692 wset_right_margin_cols (w, p->right_margin_cols);
5702 wset_left_fringe_width (w, p->left_fringe_width); 5693 w->left_fringe_width = XINT (p->left_fringe_width);
5703 wset_right_fringe_width (w, p->right_fringe_width); 5694 w->right_fringe_width = XINT (p->right_fringe_width);
5704 w->fringes_outside_margins = !NILP (p->fringes_outside_margins); 5695 w->fringes_outside_margins = !NILP (p->fringes_outside_margins);
5705 wset_scroll_bar_width (w, p->scroll_bar_width); 5696 wset_scroll_bar_width (w, p->scroll_bar_width);
5706 wset_vertical_scroll_bar_type (w, p->vertical_scroll_bar_type); 5697 wset_vertical_scroll_bar_type (w, p->vertical_scroll_bar_type);
@@ -6000,8 +5991,8 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
6000 p->display_table = w->display_table; 5991 p->display_table = w->display_table;
6001 p->left_margin_cols = w->left_margin_cols; 5992 p->left_margin_cols = w->left_margin_cols;
6002 p->right_margin_cols = w->right_margin_cols; 5993 p->right_margin_cols = w->right_margin_cols;
6003 p->left_fringe_width = w->left_fringe_width; 5994 p->left_fringe_width = make_number (w->left_fringe_width);
6004 p->right_fringe_width = w->right_fringe_width; 5995 p->right_fringe_width = make_number (w->right_fringe_width);
6005 p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil; 5996 p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil;
6006 p->scroll_bar_width = w->scroll_bar_width; 5997 p->scroll_bar_width = w->scroll_bar_width;
6007 p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; 5998 p->vertical_scroll_bar_type = w->vertical_scroll_bar_type;
@@ -6227,25 +6218,28 @@ frame's default fringe width. Default fringe widths can be set with
6227the command `set-fringe-style'. 6218the command `set-fringe-style'.
6228If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes 6219If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes
6229outside of the display margins. By default, fringes are drawn between 6220outside of the display margins. By default, fringes are drawn between
6230display marginal areas and the text area. */) 6221display marginal areas and the text area.
6231 (Lisp_Object window, Lisp_Object left_width, Lisp_Object right_width, Lisp_Object outside_margins) 6222
6223Return t if any fringe was actually changed and nil otherwise. */)
6224 (Lisp_Object window, Lisp_Object left_width,
6225 Lisp_Object right_width, Lisp_Object outside_margins)
6232{ 6226{
6233 struct window *w = decode_live_window (window); 6227 struct window *w = decode_live_window (window);
6234 int outside = !NILP (outside_margins); 6228 int left, right, outside = !NILP (outside_margins);
6235 6229
6236 if (!NILP (left_width)) 6230 left = (NILP (left_width) ? -1
6237 CHECK_NATNUM (left_width); 6231 : (CHECK_NATNUM (left_width), XINT (left_width)));
6238 if (!NILP (right_width)) 6232 right = (NILP (right_width) ? -1
6239 CHECK_NATNUM (right_width); 6233 : (CHECK_NATNUM (right_width), XINT (right_width)));
6240 6234
6241 /* Do nothing on a tty. */ 6235 /* Do nothing on a tty or if nothing to actually change. */
6242 if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) 6236 if (FRAME_WINDOW_P (WINDOW_XFRAME (w))
6243 && (!EQ (w->left_fringe_width, left_width) 6237 && (w->left_fringe_width != left
6244 || !EQ (w->right_fringe_width, right_width) 6238 || w->right_fringe_width != right
6245 || w->fringes_outside_margins != outside)) 6239 || w->fringes_outside_margins != outside))
6246 { 6240 {
6247 wset_left_fringe_width (w, left_width); 6241 w->left_fringe_width = left;
6248 wset_right_fringe_width (w, right_width); 6242 w->right_fringe_width = right;
6249 w->fringes_outside_margins = outside; 6243 w->fringes_outside_margins = outside;
6250 6244
6251 adjust_window_margins (w); 6245 adjust_window_margins (w);
@@ -6255,6 +6249,7 @@ display marginal areas and the text area. */)
6255 6249
6256 ++windows_or_buffers_changed; 6250 ++windows_or_buffers_changed;
6257 adjust_glyphs (XFRAME (WINDOW_FRAME (w))); 6251 adjust_glyphs (XFRAME (WINDOW_FRAME (w)));
6252 return Qt;
6258 } 6253 }
6259 6254
6260 return Qnil; 6255 return Qnil;
diff --git a/src/window.h b/src/window.h
index 260a672d93a..ea573fbf3e1 100644
--- a/src/window.h
+++ b/src/window.h
@@ -146,11 +146,6 @@ struct window
146 Lisp_Object left_margin_cols; 146 Lisp_Object left_margin_cols;
147 Lisp_Object right_margin_cols; 147 Lisp_Object right_margin_cols;
148 148
149 /* Width of left and right fringes.
150 A value of nil or t means use frame values. */
151 Lisp_Object left_fringe_width;
152 Lisp_Object right_fringe_width;
153
154 /* Pixel width of scroll bars. 149 /* Pixel width of scroll bars.
155 A value of nil or t means use frame values. */ 150 A value of nil or t means use frame values. */
156 Lisp_Object scroll_bar_width; 151 Lisp_Object scroll_bar_width;
@@ -269,6 +264,11 @@ struct window
269 /* This is handy for undrawing the cursor. */ 264 /* This is handy for undrawing the cursor. */
270 int phys_cursor_ascent, phys_cursor_height; 265 int phys_cursor_ascent, phys_cursor_height;
271 266
267 /* Width of left and right fringes, in pixels.
268 A value of -1 means use frame values. */
269 int left_fringe_width;
270 int right_fringe_width;
271
272 /* Non-zero if this window is a minibuffer window. */ 272 /* Non-zero if this window is a minibuffer window. */
273 unsigned mini : 1; 273 unsigned mini : 1;
274 274
@@ -635,10 +635,10 @@ wset_next_buffers (struct window *w, Lisp_Object val)
635 able to split windows horizontally nicely. */ 635 able to split windows horizontally nicely. */
636 636
637#define WINDOW_FRINGE_COLS(W) \ 637#define WINDOW_FRINGE_COLS(W) \
638 ((INTEGERP (W->left_fringe_width) \ 638 ((W->left_fringe_width >= 0 \
639 || INTEGERP (W->right_fringe_width)) \ 639 && W->right_fringe_width >= 0) \
640 ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \ 640 ? ((W->left_fringe_width \
641 + WINDOW_RIGHT_FRINGE_WIDTH (W) \ 641 + W->right_fringe_width \
642 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ 642 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
643 / WINDOW_FRAME_COLUMN_WIDTH (W)) \ 643 / WINDOW_FRAME_COLUMN_WIDTH (W)) \
644 : FRAME_FRINGE_COLS (WINDOW_XFRAME (W))) 644 : FRAME_FRINGE_COLS (WINDOW_XFRAME (W)))
@@ -658,13 +658,11 @@ wset_next_buffers (struct window *w, Lisp_Object val)
658/* Pixel-width of the left and right fringe. */ 658/* Pixel-width of the left and right fringe. */
659 659
660#define WINDOW_LEFT_FRINGE_WIDTH(W) \ 660#define WINDOW_LEFT_FRINGE_WIDTH(W) \
661 (INTEGERP (W->left_fringe_width) \ 661 (W->left_fringe_width >= 0 ? W->left_fringe_width \
662 ? XFASTINT (W->left_fringe_width) \
663 : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W))) 662 : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
664 663
665#define WINDOW_RIGHT_FRINGE_WIDTH(W) \ 664#define WINDOW_RIGHT_FRINGE_WIDTH(W) \
666 (INTEGERP (W->right_fringe_width) \ 665 (W->right_fringe_width >= 0 ? W->right_fringe_width \
667 ? XFASTINT (W->right_fringe_width) \
668 : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W))) 666 : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
669 667
670/* Total width of fringes in pixels. */ 668/* Total width of fringes in pixels. */