diff options
| author | Andreas Schwab | 2019-06-30 08:22:53 +0200 |
|---|---|---|
| committer | Andreas Schwab | 2019-06-30 10:38:03 +0200 |
| commit | 5f3a63d541b43178265326d70338c53a9d631f8e (patch) | |
| tree | c8f23c4d3f83bec022b26f29189ef000683170c5 /src | |
| parent | 36a8024e2b2e5e8714f8e636657c898a4bffaafb (diff) | |
| download | emacs-5f3a63d541b43178265326d70338c53a9d631f8e.tar.gz emacs-5f3a63d541b43178265326d70338c53a9d631f8e.zip | |
Fix use of undefined macro
* src/xdisp.c (append_space_for_newline): Use FRAME_FONT only
inside HAVE_WINDOW_SYSTEM.
(extend_face_to_end_of_line): Likewise.
(syms_of_xdisp): Doc fix.
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 90 |
2 files changed, 48 insertions, 48 deletions
diff --git a/src/image.c b/src/image.c index 5b02c6a9534..7f7e9fc160c 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -2161,7 +2161,7 @@ image_set_transform (struct frame *f, struct image *img) | |||
| 2161 | rotate_flag = 1; | 2161 | rotate_flag = 1; |
| 2162 | } | 2162 | } |
| 2163 | 2163 | ||
| 2164 | if (0 < rotate_flag) | 2164 | if (rotate_flag > 0) |
| 2165 | { | 2165 | { |
| 2166 | # if defined USE_CAIRO || defined HAVE_XRENDER | 2166 | # if defined USE_CAIRO || defined HAVE_XRENDER |
| 2167 | /* 1. Translate so (0, 0) is in the center of the image. */ | 2167 | /* 1. Translate so (0, 0) is in the center of the image. */ |
| @@ -2680,10 +2680,10 @@ image_create_x_image_and_pixmap_1 (struct frame *f, int width, int height, int d | |||
| 2680 | 2680 | ||
| 2681 | /* Create a DIBSection and raster array for the bitmap, | 2681 | /* Create a DIBSection and raster array for the bitmap, |
| 2682 | and store its handle in *pixmap. */ | 2682 | and store its handle in *pixmap. */ |
| 2683 | *pixmap = CreateDIBSection (hdc, &((*pimg)->info), | 2683 | *pixmap = CreateDIBSection (hdc, &(*pimg)->info, |
| 2684 | (depth < 16) ? DIB_PAL_COLORS : DIB_RGB_COLORS, | 2684 | (depth < 16) ? DIB_PAL_COLORS : DIB_RGB_COLORS, |
| 2685 | /* casting avoids a GCC warning */ | 2685 | /* casting avoids a GCC warning */ |
| 2686 | (void **)&((*pimg)->data), NULL, 0); | 2686 | (void **) &(*pimg)->data, NULL, 0); |
| 2687 | 2687 | ||
| 2688 | /* Realize display palette and garbage all frames. */ | 2688 | /* Realize display palette and garbage all frames. */ |
| 2689 | release_frame_dc (f, hdc); | 2689 | release_frame_dc (f, hdc); |
diff --git a/src/xdisp.c b/src/xdisp.c index 48b0edaa76b..5fee5310ac3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -20206,6 +20206,7 @@ compute_line_metrics (struct it *it) | |||
| 20206 | static bool | 20206 | static bool |
| 20207 | append_space_for_newline (struct it *it, bool default_face_p) | 20207 | append_space_for_newline (struct it *it, bool default_face_p) |
| 20208 | { | 20208 | { |
| 20209 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 20209 | if (FRAME_WINDOW_P (it->f)) | 20210 | if (FRAME_WINDOW_P (it->f)) |
| 20210 | { | 20211 | { |
| 20211 | int n = it->glyph_row->used[TEXT_AREA]; | 20212 | int n = it->glyph_row->used[TEXT_AREA]; |
| @@ -20246,27 +20247,27 @@ append_space_for_newline (struct it *it, bool default_face_p) | |||
| 20246 | int indicator_column = (it->w->pseudo_window_p == 0 | 20247 | int indicator_column = (it->w->pseudo_window_p == 0 |
| 20247 | ? fill_column_indicator_column (it) | 20248 | ? fill_column_indicator_column (it) |
| 20248 | : -1); | 20249 | : -1); |
| 20249 | if (0 <= indicator_column) | 20250 | if (indicator_column >= 0) |
| 20250 | { | 20251 | { |
| 20251 | struct font *font = | 20252 | struct font *font = (default_face->font |
| 20252 | default_face->font ? | 20253 | ? default_face->font |
| 20253 | default_face->font : FRAME_FONT (it->f); | 20254 | : FRAME_FONT (it->f)); |
| 20254 | const int char_width = | 20255 | const int char_width = (font->average_width |
| 20255 | font->average_width ? | 20256 | ? font->average_width |
| 20256 | font->average_width : font->space_width; | 20257 | : font->space_width); |
| 20257 | |||
| 20258 | int column_x; | 20258 | int column_x; |
| 20259 | |||
| 20259 | if (!INT_MULTIPLY_WRAPV (indicator_column, char_width, | 20260 | if (!INT_MULTIPLY_WRAPV (indicator_column, char_width, |
| 20260 | &column_x) | 20261 | &column_x) |
| 20261 | && !INT_ADD_WRAPV (it->lnum_pixel_width, column_x, | 20262 | && !INT_ADD_WRAPV (it->lnum_pixel_width, column_x, |
| 20262 | &column_x) | 20263 | &column_x) |
| 20263 | && it->current_x == column_x) | 20264 | && it->current_x == column_x) |
| 20264 | { | 20265 | { |
| 20265 | it->c = it->char_to_display = | 20266 | it->c = it->char_to_display |
| 20266 | XFIXNAT (Vdisplay_fill_column_indicator_character); | 20267 | = XFIXNAT (Vdisplay_fill_column_indicator_character); |
| 20267 | it->face_id = | 20268 | it->face_id |
| 20268 | merge_faces (it->w, Qfill_column_indicator, | 20269 | = merge_faces (it->w, Qfill_column_indicator, |
| 20269 | 0, saved_face_id); | 20270 | 0, saved_face_id); |
| 20270 | face = FACE_FROM_ID (it->f, it->face_id); | 20271 | face = FACE_FROM_ID (it->f, it->face_id); |
| 20271 | goto produce_glyphs; | 20272 | goto produce_glyphs; |
| 20272 | } | 20273 | } |
| @@ -20296,7 +20297,6 @@ append_space_for_newline (struct it *it, bool default_face_p) | |||
| 20296 | produce_glyphs: | 20297 | produce_glyphs: |
| 20297 | PRODUCE_GLYPHS (it); | 20298 | PRODUCE_GLYPHS (it); |
| 20298 | 20299 | ||
| 20299 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 20300 | /* Make sure this space glyph has the right ascent and | 20300 | /* Make sure this space glyph has the right ascent and |
| 20301 | descent values, or else cursor at end of line will look | 20301 | descent values, or else cursor at end of line will look |
| 20302 | funny, and height of empty lines will be incorrect. */ | 20302 | funny, and height of empty lines will be incorrect. */ |
| @@ -20375,7 +20375,6 @@ append_space_for_newline (struct it *it, bool default_face_p) | |||
| 20375 | 20375 | ||
| 20376 | g->ascent = it->max_ascent; | 20376 | g->ascent = it->max_ascent; |
| 20377 | g->descent = it->max_descent; | 20377 | g->descent = it->max_descent; |
| 20378 | #endif | ||
| 20379 | 20378 | ||
| 20380 | it->override_ascent = -1; | 20379 | it->override_ascent = -1; |
| 20381 | it->constrain_row_ascent_descent_p = false; | 20380 | it->constrain_row_ascent_descent_p = false; |
| @@ -20391,6 +20390,7 @@ append_space_for_newline (struct it *it, bool default_face_p) | |||
| 20391 | return true; | 20390 | return true; |
| 20392 | } | 20391 | } |
| 20393 | } | 20392 | } |
| 20393 | #endif | ||
| 20394 | 20394 | ||
| 20395 | return false; | 20395 | return false; |
| 20396 | } | 20396 | } |
| @@ -20460,6 +20460,7 @@ extend_face_to_end_of_line (struct it *it) | |||
| 20460 | it->face_id = FACE_FOR_CHAR (f, face, 0, -1, Qnil); | 20460 | it->face_id = FACE_FOR_CHAR (f, face, 0, -1, Qnil); |
| 20461 | } | 20461 | } |
| 20462 | 20462 | ||
| 20463 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 20463 | if (FRAME_WINDOW_P (f)) | 20464 | if (FRAME_WINDOW_P (f)) |
| 20464 | { | 20465 | { |
| 20465 | /* If the row is empty, add a space with the current face of IT, | 20466 | /* If the row is empty, add a space with the current face of IT, |
| @@ -20473,7 +20474,7 @@ extend_face_to_end_of_line (struct it *it) | |||
| 20473 | /* Mode line and the header line don't have margins, and | 20474 | /* Mode line and the header line don't have margins, and |
| 20474 | likewise the frame's tool-bar window, if there is any. */ | 20475 | likewise the frame's tool-bar window, if there is any. */ |
| 20475 | if (!(it->glyph_row->mode_line_p | 20476 | if (!(it->glyph_row->mode_line_p |
| 20476 | #if defined (HAVE_WINDOW_SYSTEM) && ! defined (HAVE_EXT_TOOL_BAR) | 20477 | #ifndef HAVE_EXT_TOOL_BAR |
| 20477 | || (WINDOWP (f->tool_bar_window) | 20478 | || (WINDOWP (f->tool_bar_window) |
| 20478 | && it->w == XWINDOW (f->tool_bar_window)) | 20479 | && it->w == XWINDOW (f->tool_bar_window)) |
| 20479 | #endif | 20480 | #endif |
| @@ -20502,18 +20503,19 @@ extend_face_to_end_of_line (struct it *it) | |||
| 20502 | int indicator_column = (it->w->pseudo_window_p == 0 | 20503 | int indicator_column = (it->w->pseudo_window_p == 0 |
| 20503 | ? fill_column_indicator_column (it) | 20504 | ? fill_column_indicator_column (it) |
| 20504 | : -1); | 20505 | : -1); |
| 20505 | if (0 <= indicator_column) | 20506 | if (indicator_column >= 0) |
| 20506 | { | 20507 | { |
| 20507 | struct font *font = | 20508 | struct font *font = (default_face->font |
| 20508 | default_face->font ? default_face->font : FRAME_FONT (f); | 20509 | ? default_face->font |
| 20509 | const int char_width = | 20510 | : FRAME_FONT (f)); |
| 20510 | font->average_width ? | 20511 | const int char_width = (font->average_width |
| 20511 | font->average_width : font->space_width; | 20512 | ? font->average_width |
| 20512 | 20513 | : font->space_width); | |
| 20513 | int column_x; | 20514 | int column_x; |
| 20515 | |||
| 20514 | if (!INT_MULTIPLY_WRAPV (indicator_column, char_width, &column_x) | 20516 | if (!INT_MULTIPLY_WRAPV (indicator_column, char_width, &column_x) |
| 20515 | && !INT_ADD_WRAPV (it->lnum_pixel_width, column_x, &column_x) | 20517 | && !INT_ADD_WRAPV (it->lnum_pixel_width, column_x, &column_x) |
| 20516 | && it->current_x <= column_x | 20518 | && column_x >= it->current_x |
| 20517 | && column_x <= it->last_visible_x) | 20519 | && column_x <= it->last_visible_x) |
| 20518 | { | 20520 | { |
| 20519 | const char saved_char = it->char_to_display; | 20521 | const char saved_char = it->char_to_display; |
| @@ -20525,8 +20527,8 @@ extend_face_to_end_of_line (struct it *it) | |||
| 20525 | 20527 | ||
| 20526 | /* The stretch width needs to considet the latter | 20528 | /* The stretch width needs to considet the latter |
| 20527 | added glyph. */ | 20529 | added glyph. */ |
| 20528 | const int stretch_width = | 20530 | const int stretch_width |
| 20529 | column_x - it->current_x - char_width; | 20531 | = column_x - it->current_x - char_width; |
| 20530 | 20532 | ||
| 20531 | memset (&it->position, 0, sizeof it->position); | 20533 | memset (&it->position, 0, sizeof it->position); |
| 20532 | it->avoid_cursor_p = true; | 20534 | it->avoid_cursor_p = true; |
| @@ -20547,11 +20549,11 @@ extend_face_to_end_of_line (struct it *it) | |||
| 20547 | append_space_for_newline didn't already. */ | 20549 | append_space_for_newline didn't already. */ |
| 20548 | if (it->current_x < column_x) | 20550 | if (it->current_x < column_x) |
| 20549 | { | 20551 | { |
| 20550 | it->char_to_display = | 20552 | it->char_to_display |
| 20551 | XFIXNAT (Vdisplay_fill_column_indicator_character); | 20553 | = XFIXNAT (Vdisplay_fill_column_indicator_character); |
| 20552 | it->face_id = | 20554 | it->face_id |
| 20553 | merge_faces (it->w, Qfill_column_indicator, | 20555 | = merge_faces (it->w, Qfill_column_indicator, |
| 20554 | 0, saved_face_id); | 20556 | 0, saved_face_id); |
| 20555 | PRODUCE_GLYPHS (it); | 20557 | PRODUCE_GLYPHS (it); |
| 20556 | } | 20558 | } |
| 20557 | 20559 | ||
| @@ -20572,7 +20574,6 @@ extend_face_to_end_of_line (struct it *it) | |||
| 20572 | } | 20574 | } |
| 20573 | } | 20575 | } |
| 20574 | } | 20576 | } |
| 20575 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 20576 | if (it->glyph_row->reversed_p) | 20577 | if (it->glyph_row->reversed_p) |
| 20577 | { | 20578 | { |
| 20578 | /* Prepend a stretch glyph to the row, such that the | 20579 | /* Prepend a stretch glyph to the row, such that the |
| @@ -20636,9 +20637,9 @@ extend_face_to_end_of_line (struct it *it) | |||
| 20636 | if (stretch_width < 0) | 20637 | if (stretch_width < 0) |
| 20637 | it->glyph_row->x = stretch_width; | 20638 | it->glyph_row->x = stretch_width; |
| 20638 | } | 20639 | } |
| 20639 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 20640 | } | 20640 | } |
| 20641 | else | 20641 | else |
| 20642 | #endif /* HAVE_WINDOW_SYSTEM */ | ||
| 20642 | { | 20643 | { |
| 20643 | /* Save some values that must not be changed. */ | 20644 | /* Save some values that must not be changed. */ |
| 20644 | int saved_x = it->current_x; | 20645 | int saved_x = it->current_x; |
| @@ -20695,7 +20696,7 @@ extend_face_to_end_of_line (struct it *it) | |||
| 20695 | 20696 | ||
| 20696 | /* Display fill-column indicator if needed. */ | 20697 | /* Display fill-column indicator if needed. */ |
| 20697 | int indicator_column = fill_column_indicator_column (it); | 20698 | int indicator_column = fill_column_indicator_column (it); |
| 20698 | if (0 <= indicator_column | 20699 | if (indicator_column >= 0 |
| 20699 | && INT_ADD_WRAPV (it->lnum_pixel_width, indicator_column, | 20700 | && INT_ADD_WRAPV (it->lnum_pixel_width, indicator_column, |
| 20700 | &indicator_column)) | 20701 | &indicator_column)) |
| 20701 | indicator_column = -1; | 20702 | indicator_column = -1; |
| @@ -20706,10 +20707,10 @@ extend_face_to_end_of_line (struct it *it) | |||
| 20706 | if (indicate) | 20707 | if (indicate) |
| 20707 | { | 20708 | { |
| 20708 | saved_face_id = it->face_id; | 20709 | saved_face_id = it->face_id; |
| 20709 | it->face_id = | 20710 | it->face_id |
| 20710 | merge_faces (it->w, Qfill_column_indicator, 0, saved_face_id); | 20711 | = merge_faces (it->w, Qfill_column_indicator, 0, saved_face_id); |
| 20711 | it->c = it->char_to_display = | 20712 | it->c = it->char_to_display |
| 20712 | XFIXNAT (Vdisplay_fill_column_indicator_character); | 20713 | = XFIXNAT (Vdisplay_fill_column_indicator_character); |
| 20713 | } | 20714 | } |
| 20714 | 20715 | ||
| 20715 | PRODUCE_GLYPHS (it); | 20716 | PRODUCE_GLYPHS (it); |
| @@ -33481,8 +33482,8 @@ either `relative' or `visual'. */); | |||
| 33481 | Fmake_variable_buffer_local (Qdisplay_fill_column_indicator); | 33482 | Fmake_variable_buffer_local (Qdisplay_fill_column_indicator); |
| 33482 | 33483 | ||
| 33483 | DEFVAR_LISP ("display-fill-column-indicator-column", Vdisplay_fill_column_indicator_column, | 33484 | DEFVAR_LISP ("display-fill-column-indicator-column", Vdisplay_fill_column_indicator_column, |
| 33484 | doc: /* Column for indicator when `display-fill-column-indicator' | 33485 | doc: /* Column for indicator when `display-fill-column-indicator' is non-nil. |
| 33485 | is non-nil. The default value is t which means that the indicator | 33486 | The default value is t which means that the indicator |
| 33486 | will use the `fill-column' variable. If it is set to an integer the | 33487 | will use the `fill-column' variable. If it is set to an integer the |
| 33487 | indicator will be drawn in that column. */); | 33488 | indicator will be drawn in that column. */); |
| 33488 | Vdisplay_fill_column_indicator_column = Qt; | 33489 | Vdisplay_fill_column_indicator_column = Qt; |
| @@ -33490,10 +33491,9 @@ indicator will be drawn in that column. */); | |||
| 33490 | Fmake_variable_buffer_local (Qdisplay_fill_column_indicator_column); | 33491 | Fmake_variable_buffer_local (Qdisplay_fill_column_indicator_column); |
| 33491 | 33492 | ||
| 33492 | DEFVAR_LISP ("display-fill-column-indicator-character", Vdisplay_fill_column_indicator_character, | 33493 | DEFVAR_LISP ("display-fill-column-indicator-character", Vdisplay_fill_column_indicator_character, |
| 33493 | doc: /* Character to draw the indicator when | 33494 | doc: /* Character to draw the indicator when `display-fill-column-indicator' is non-nil. |
| 33494 | `display-fill-column-indicator' is non-nil. The default is U+2502 but | 33495 | The default is U+2502 but a good alternative is (ascii 124) |
| 33495 | a good alternative is (ascii 124) if the font in fill-column-indicator | 33496 | if the font in fill-column-indicator face does not support Unicode characters. */); |
| 33496 | face does not support Unicode characters. */); | ||
| 33497 | Vdisplay_fill_column_indicator_character = Qnil; | 33497 | Vdisplay_fill_column_indicator_character = Qnil; |
| 33498 | DEFSYM (Qdisplay_fill_column_indicator_character, "display-fill-column-indicator-character"); | 33498 | DEFSYM (Qdisplay_fill_column_indicator_character, "display-fill-column-indicator-character"); |
| 33499 | Fmake_variable_buffer_local (Qdisplay_fill_column_indicator_character); | 33499 | Fmake_variable_buffer_local (Qdisplay_fill_column_indicator_character); |