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/window.c | |
| 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/window.c')
| -rw-r--r-- | src/window.c | 51 |
1 files changed, 23 insertions, 28 deletions
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; |