diff options
| author | Dmitry Antipov | 2013-08-13 16:13:04 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-08-13 16:13:04 +0400 |
| commit | 9e37ee3be620a64afe9d9760076f80c22c986b62 (patch) | |
| tree | 19e22877f995f4115ae684cbe3e0865cd92059d8 /src | |
| parent | 31593bf6331776d08c1b439675b70a58492d657e (diff) | |
| download | emacs-9e37ee3be620a64afe9d9760076f80c22c986b62.tar.gz emacs-9e37ee3be620a64afe9d9760076f80c22c986b62.zip | |
* window.h (struct window): Convert left_fringe_width
and right_fringe_width from Lisp_Objects to integers.
Adjust comment.
(WINDOW_FRINGE_COLS, WINDOW_LEFT_FRINGE_WIDTH)
(WINDOW_RIGHT_FRINGE_WIDTH): Adjust users.
* window.c (wset_left_fringe_width, wset_right_fringe_width):
Remove.
(make_window): Initialize new integer fields to -1.
(Fsplit_window_internal): Use direct assignment.
(Fset_window_configuration, save_window_save): Convert
Lisp_Object to integer and back where appropriate.
(Fset_window_fringes): Adjust user. Return t if any fringe
was actually changed, and mention this in docstring.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 16 | ||||
| -rw-r--r-- | src/window.c | 51 | ||||
| -rw-r--r-- | src/window.h | 24 |
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 @@ | |||
| 1 | 2013-08-13 Dmitry Antipov <dmantipov@yandex.ru> | 1 | 2013-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 | |||
| 17 | 2013-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 be009d37810..6de93b077ca 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -151,11 +151,6 @@ wset_display_table (struct window *w, Lisp_Object val) | |||
| 151 | w->display_table = val; | 151 | w->display_table = val; |
| 152 | } | 152 | } |
| 153 | static void | 153 | static void |
| 154 | wset_left_fringe_width (struct window *w, Lisp_Object val) | ||
| 155 | { | ||
| 156 | w->left_fringe_width = val; | ||
| 157 | } | ||
| 158 | static void | ||
| 159 | wset_left_margin_cols (struct window *w, Lisp_Object val) | 154 | wset_left_margin_cols (struct window *w, Lisp_Object val) |
| 160 | { | 155 | { |
| 161 | w->left_margin_cols = val; | 156 | w->left_margin_cols = val; |
| @@ -191,11 +186,6 @@ wset_pointm (struct window *w, Lisp_Object val) | |||
| 191 | w->pointm = val; | 186 | w->pointm = val; |
| 192 | } | 187 | } |
| 193 | static void | 188 | static void |
| 194 | wset_right_fringe_width (struct window *w, Lisp_Object val) | ||
| 195 | { | ||
| 196 | w->right_fringe_width = val; | ||
| 197 | } | ||
| 198 | static void | ||
| 199 | wset_right_margin_cols (struct window *w, Lisp_Object val) | 189 | wset_right_margin_cols (struct window *w, Lisp_Object val) |
| 200 | { | 190 | { |
| 201 | w->right_margin_cols = val; | 191 | w->right_margin_cols = val; |
| @@ -3481,6 +3471,7 @@ make_window (void) | |||
| 3481 | /* Initialize non-Lisp data. Note that allocate_window zeroes out all | 3471 | /* Initialize non-Lisp data. Note that allocate_window zeroes out all |
| 3482 | non-Lisp data, so do it only for slots which should not be zero. */ | 3472 | non-Lisp data, so do it only for slots which should not be zero. */ |
| 3483 | w->nrows_scale_factor = w->ncols_scale_factor = 1; | 3473 | w->nrows_scale_factor = w->ncols_scale_factor = 1; |
| 3474 | w->left_fringe_width = w->right_fringe_width = -1; | ||
| 3484 | w->phys_cursor_type = -1; | 3475 | w->phys_cursor_type = -1; |
| 3485 | w->phys_cursor_width = -1; | 3476 | w->phys_cursor_width = -1; |
| 3486 | w->column_number_displayed = -1; | 3477 | w->column_number_displayed = -1; |
| @@ -3950,8 +3941,8 @@ set correctly. See the code of `split-window' for how this is done. */) | |||
| 3950 | /* Get special geometry settings from reference window. */ | 3941 | /* Get special geometry settings from reference window. */ |
| 3951 | wset_left_margin_cols (n, r->left_margin_cols); | 3942 | wset_left_margin_cols (n, r->left_margin_cols); |
| 3952 | wset_right_margin_cols (n, r->right_margin_cols); | 3943 | wset_right_margin_cols (n, r->right_margin_cols); |
| 3953 | wset_left_fringe_width (n, r->left_fringe_width); | 3944 | n->left_fringe_width = r->left_fringe_width; |
| 3954 | wset_right_fringe_width (n, r->right_fringe_width); | 3945 | n->right_fringe_width = r->right_fringe_width; |
| 3955 | n->fringes_outside_margins = r->fringes_outside_margins; | 3946 | n->fringes_outside_margins = r->fringes_outside_margins; |
| 3956 | wset_scroll_bar_width (n, r->scroll_bar_width); | 3947 | wset_scroll_bar_width (n, r->scroll_bar_width); |
| 3957 | wset_vertical_scroll_bar_type (n, r->vertical_scroll_bar_type); | 3948 | wset_vertical_scroll_bar_type (n, r->vertical_scroll_bar_type); |
| @@ -5693,8 +5684,8 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5693 | wset_display_table (w, p->display_table); | 5684 | wset_display_table (w, p->display_table); |
| 5694 | wset_left_margin_cols (w, p->left_margin_cols); | 5685 | wset_left_margin_cols (w, p->left_margin_cols); |
| 5695 | wset_right_margin_cols (w, p->right_margin_cols); | 5686 | wset_right_margin_cols (w, p->right_margin_cols); |
| 5696 | wset_left_fringe_width (w, p->left_fringe_width); | 5687 | w->left_fringe_width = XINT (p->left_fringe_width); |
| 5697 | wset_right_fringe_width (w, p->right_fringe_width); | 5688 | w->right_fringe_width = XINT (p->right_fringe_width); |
| 5698 | w->fringes_outside_margins = !NILP (p->fringes_outside_margins); | 5689 | w->fringes_outside_margins = !NILP (p->fringes_outside_margins); |
| 5699 | wset_scroll_bar_width (w, p->scroll_bar_width); | 5690 | wset_scroll_bar_width (w, p->scroll_bar_width); |
| 5700 | wset_vertical_scroll_bar_type (w, p->vertical_scroll_bar_type); | 5691 | wset_vertical_scroll_bar_type (w, p->vertical_scroll_bar_type); |
| @@ -5994,8 +5985,8 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i) | |||
| 5994 | p->display_table = w->display_table; | 5985 | p->display_table = w->display_table; |
| 5995 | p->left_margin_cols = w->left_margin_cols; | 5986 | p->left_margin_cols = w->left_margin_cols; |
| 5996 | p->right_margin_cols = w->right_margin_cols; | 5987 | p->right_margin_cols = w->right_margin_cols; |
| 5997 | p->left_fringe_width = w->left_fringe_width; | 5988 | p->left_fringe_width = make_number (w->left_fringe_width); |
| 5998 | p->right_fringe_width = w->right_fringe_width; | 5989 | p->right_fringe_width = make_number (w->right_fringe_width); |
| 5999 | p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil; | 5990 | p->fringes_outside_margins = w->fringes_outside_margins ? Qt : Qnil; |
| 6000 | p->scroll_bar_width = w->scroll_bar_width; | 5991 | p->scroll_bar_width = w->scroll_bar_width; |
| 6001 | p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; | 5992 | p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; |
| @@ -6221,25 +6212,28 @@ frame's default fringe width. Default fringe widths can be set with | |||
| 6221 | the command `set-fringe-style'. | 6212 | the command `set-fringe-style'. |
| 6222 | If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes | 6213 | If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes |
| 6223 | outside of the display margins. By default, fringes are drawn between | 6214 | outside of the display margins. By default, fringes are drawn between |
| 6224 | display marginal areas and the text area. */) | 6215 | display marginal areas and the text area. |
| 6225 | (Lisp_Object window, Lisp_Object left_width, Lisp_Object right_width, Lisp_Object outside_margins) | 6216 | |
| 6217 | Return t if any fringe was actually changed and nil otherwise. */) | ||
| 6218 | (Lisp_Object window, Lisp_Object left_width, | ||
| 6219 | Lisp_Object right_width, Lisp_Object outside_margins) | ||
| 6226 | { | 6220 | { |
| 6227 | struct window *w = decode_live_window (window); | 6221 | struct window *w = decode_live_window (window); |
| 6228 | int outside = !NILP (outside_margins); | 6222 | int left, right, outside = !NILP (outside_margins); |
| 6229 | 6223 | ||
| 6230 | if (!NILP (left_width)) | 6224 | left = (NILP (left_width) ? -1 |
| 6231 | CHECK_NATNUM (left_width); | 6225 | : (CHECK_NATNUM (left_width), XINT (left_width))); |
| 6232 | if (!NILP (right_width)) | 6226 | right = (NILP (right_width) ? -1 |
| 6233 | CHECK_NATNUM (right_width); | 6227 | : (CHECK_NATNUM (right_width), XINT (right_width))); |
| 6234 | 6228 | ||
| 6235 | /* Do nothing on a tty. */ | 6229 | /* Do nothing on a tty or if nothing to actually change. */ |
| 6236 | if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) | 6230 | if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) |
| 6237 | && (!EQ (w->left_fringe_width, left_width) | 6231 | && (w->left_fringe_width != left |
| 6238 | || !EQ (w->right_fringe_width, right_width) | 6232 | || w->right_fringe_width != right |
| 6239 | || w->fringes_outside_margins != outside)) | 6233 | || w->fringes_outside_margins != outside)) |
| 6240 | { | 6234 | { |
| 6241 | wset_left_fringe_width (w, left_width); | 6235 | w->left_fringe_width = left; |
| 6242 | wset_right_fringe_width (w, right_width); | 6236 | w->right_fringe_width = right; |
| 6243 | w->fringes_outside_margins = outside; | 6237 | w->fringes_outside_margins = outside; |
| 6244 | 6238 | ||
| 6245 | adjust_window_margins (w); | 6239 | adjust_window_margins (w); |
| @@ -6249,6 +6243,7 @@ display marginal areas and the text area. */) | |||
| 6249 | 6243 | ||
| 6250 | ++windows_or_buffers_changed; | 6244 | ++windows_or_buffers_changed; |
| 6251 | adjust_glyphs (XFRAME (WINDOW_FRAME (w))); | 6245 | adjust_glyphs (XFRAME (WINDOW_FRAME (w))); |
| 6246 | return Qt; | ||
| 6252 | } | 6247 | } |
| 6253 | 6248 | ||
| 6254 | return Qnil; | 6249 | 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. */ |